forked from gradle/gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
40 lines (33 loc) · 1.13 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
// tag::plugin[]
plugins {
// Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins
`java-gradle-plugin`
}
repositories {
// Use Maven Central for resolving dependencies
mavenCentral()
}
dependencies {
// Use JUnit test framework for unit tests
testImplementation("junit:junit:4.13")
}
gradlePlugin {
// Define the plugin
val greeting by plugins.creating {
id = "com.example.plugin.greeting"
implementationClass = "com.example.plugin.GreetingPlugin"
}
}
// end::plugin[]
// Add a source set and a task for a functional test suite
val functionalTest by sourceSets.creating
gradlePlugin.testSourceSets(functionalTest)
configurations[functionalTest.implementationConfigurationName].extendsFrom(configurations.testImplementation.get())
val functionalTestTask = tasks.register<Test>("functionalTest") {
testClassesDirs = functionalTest.output.classesDirs
classpath = configurations[functionalTest.runtimeClasspathConfigurationName] + functionalTest.output
}
tasks.check {
// Run the functional tests as part of `check`
dependsOn(functionalTestTask)
}