-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
103 lines (83 loc) · 3.01 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
plugins {
`java-gradle-plugin`
`convention-plugin`
`maven-publish`
id("com.gradle.plugin-publish") version "0.21.0"
id("org.jetbrains.dokka") version "1.7.20"
id("org.jetbrains.kotlin.jvm") version "1.8.10"
}
group = "jp.skypencil.flix"
repositories {
mavenCentral()
gradlePluginPortal()
}
val flixCompiler = tasks.downloadFlixCompiler.map { it.outputs.files }
dependencies {
implementation("de.undercouch:gradle-download-task:5.4.0")
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compileOnly(project("modules:packager-shell"))
compileOnly(flixCompiler)
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation(flixCompiler)
}
gradlePlugin {
val flixPlugin by
plugins.creating {
id = "jp.skypencil.flix"
displayName = "Flix plugin"
description = "A Gradle plugin which provides conventions for Flix projects"
implementationClass = "jp.skypencil.flix.FlixPlugin"
}
val flixBasePlugin by
plugins.creating {
id = "jp.skypencil.flix-base"
displayName = "Flix base plugin"
description = "A Gradle plugin which provides tasks and an extension for Flix projects"
implementationClass = "jp.skypencil.flix.FlixBasePlugin"
}
}
val functionalTestSourceSet = sourceSets.create("functionalTest") {}
configurations["functionalTestImplementation"].extendsFrom(configurations["testImplementation"])
val functionalTest by
tasks.registering(Test::class) {
testClassesDirs = functionalTestSourceSet.output.classesDirs
classpath = functionalTestSourceSet.runtimeClasspath
}
gradlePlugin.testSourceSets(functionalTestSourceSet)
val copyPackagerShell by
tasks.registering(Copy::class) {
from("modules/packager-shell/build/classes/scala/main")
into("build/classes/kotlin/main")
}
tasks.dokkaHtml.configure { outputDirectory.set(buildDir.resolve("reports").resolve("dokka")) }
tasks.named<Task>("check") { dependsOn(functionalTest) }
tasks.named<Task>("build") { dependsOn(tasks.dokkaHtml) }
tasks.named<Task>("compileKotlin") { finalizedBy(copyPackagerShell) }
pluginBundle {
website = "https://github.com/KengoTODA/flix-gradle-plugin"
vcsUrl = "https://github.com/KengoTODA/flix-gradle-plugin"
tags = listOf("flix")
}
publishing {
publications.withType<MavenPublication> {
pom {
scm {
connection.set("[email protected]:KengoTODA/flix-gradle-plugin.git")
developerConnection.set("[email protected]:KengoTODA/flix-gradle-plugin.git")
url.set("https://github.com/KengoTODA/flix-gradle-plugin")
}
licenses {
license {
name.set("GNU Affero General Public License v3.0")
url.set("https://www.gnu.org/licenses/agpl-3.0.en.html")
}
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions { jvmTarget = "1.8" }
}
defaultTasks("spotlessApply", "build")