-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle.kts
88 lines (76 loc) · 2.32 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
import org.gradle.api.internal.classpath.ModuleRegistry
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.configurationcache.extensions.serviceOf
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
plugins {
id("com.gradle.plugin-publish").version("1.0.0")
kotlin("jvm") version "1.7.21"
id("idea")
id("maven-publish")
id("java-gradle-plugin")
}
group = "com.github.psxpaul"
version = File(rootDir, "VERSION").readText().trim()
java {
toolchain {
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
implementation(gradleApi())
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.21")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.7.21")
testImplementation("junit:junit:4.12")
testImplementation("org.hamcrest:hamcrest-all:1.3")
// https://github.com/gradle/gradle/issues/16774
testRuntimeOnly(
files(
serviceOf<ModuleRegistry>().getModule("gradle-tooling-api-builders")
.classpath.asFiles
)
)
}
pluginBundle {
website = "http://github.com/psxpaul"
vcsUrl = "https://github.com/psxpaul/gradle-execfork-plugin"
tags = listOf("java", "exec", "background", "process")
}
gradlePlugin {
plugins {
create("execForkPlugin") {
id = "com.github.psxpaul.execfork"
displayName = "Gradle Exec Fork Plugin"
description = "Execute Java or shell processes in the background during a build"
implementationClass = "com.github.psxpaul.ExecForkPlugin"
}
}
}
tasks {
val sampleProjects by creating(GradleBuild::class) {
buildFile = File("${project.rootDir}/sample_projects/build.gradle")
tasks = listOf("clean", "build")
}
sampleProjects.dependsOn("publishToMavenLocal")
"test" { finalizedBy(sampleProjects) }
named<Test>("test") {
testLogging.showStandardStreams = false
testLogging.exceptionFormat = TestExceptionFormat.FULL
}
}
val javadocJar by tasks.creating(Jar::class) {
archiveClassifier.set("javadoc")
from("javadoc")
}
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
artifacts {
add("archives", javadocJar)
add("archives", sourcesJar)
}