-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
131 lines (106 loc) · 3.29 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.utils.addExtendsFromRelation
plugins {
kotlin("jvm") version "1.6.21"
`java-gradle-plugin`
`maven-publish`
id("com.gradle.plugin-publish") version "1.0.0"
}
group = "io.github.frontrider.godle"
version = "0.23.0"
repositories {
mavenCentral()
}
allprojects {
tasks.withType(Javadoc::class.java).all { enabled = false }
}
val openapiDir = "$buildDir/generated"
val generatedLicenseSource = project.buildDir.absolutePath+"/license/src"
java {
sourceSets {
main {
this.java.apply{
srcDir("$openapiDir/src/main/java")
}
}
}
}
kotlin {
sourceSets {
main {
this.kotlin.apply{
srcDir(generatedLicenseSource)
}
}
}
}
val functionalTest: SourceSet by sourceSets.creating
val integrationTest: SourceSet by sourceSets.creating
addExtendsFromRelation("integrationTestImplementation", "testImplementation")
addExtendsFromRelation("functionalTestImplementation", "testImplementation")
dependencies {
implementation(gradleApi())
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation("org.apache.commons:commons-lang3:3.12.0")
// https://mvnrepository.com/artifact/commons-io/commons-io
implementation("commons-io:commons-io:2.11.0")
testImplementation(gradleTestKit())
testImplementation("org.junit.jupiter:junit-jupiter:5.9.0")
testImplementation("org.junit.platform:junit-platform-runner:1.9.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.0")
}
pluginBundle {
vcsUrl = "https://github.com/Frontrider/Godle"
website = vcsUrl
tags = listOf("game development", "godot")
}
gradlePlugin {
isAutomatedPublishing = false
plugins {
create("godle") {
id = group.toString()
displayName = "Godle"
implementationClass = "io.github.frontrider.godle.Godle"
description = "Plugin to manage small tasks around godot, like addons and the godot binary itself."
}
}
testSourceSets(functionalTest)
testSourceSets(integrationTest)
}
publishing {
publications {
create<MavenPublication>("pluginMaven") {
groupId = project.group.toString()
artifactId ="godle"
version = project.version.toString()
from(components["java"])
}
}
}
val functionalTestTestTask = tasks.register<Test>("functionalTest") {
description = "Runs the functional tests."
group = "verification"
testClassesDirs = functionalTest.output.classesDirs
classpath = functionalTest.runtimeClasspath
mustRunAfter(tasks.test)
}
val integrationTestTestTask = tasks.register<Test>("integrationTest") {
description = "Runs the integration tests."
group = "verification"
testClassesDirs = integrationTest.output.classesDirs
classpath = integrationTest.runtimeClasspath
mustRunAfter(tasks.test)
}
tasks.check {
dependsOn(functionalTestTestTask)
dependsOn(integrationTestTestTask)
}
tasks.withType<Test> {
dependsOn(tasks.pluginUnderTestMetadata)
useJUnitPlatform {
maxParallelForks = 8
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}