-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
155 lines (137 loc) · 4.52 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.jetbrains.kotlin.jvm")
id("java-gradle-plugin")
id("io.gitlab.arturbosch.detekt")
id("org.jetbrains.dokka")
id("net.researchgate.release")
id("com.gradle.plugin-publish")
id("maven-publish")
id("com.github.breadmoirai.github-release")
}
group = "com.neva.gradle"
description = "Gradle Fork Plugin"
defaultTasks("clean", "publishToMavenLocal")
val functionalTestSourceSet = sourceSets.create("functionalTest")
gradlePlugin.testSourceSets(functionalTestSourceSet)
configurations.getByName("functionalTestImplementation").extendsFrom(configurations.getByName("testImplementation"))
val functionalTest by tasks.creating(Test::class) {
testClassesDirs = functionalTestSourceSet.output.classesDirs
classpath = functionalTestSourceSet.runtimeClasspath
dependsOn("detektFunctionalTest")
}
repositories {
mavenLocal()
jcenter()
}
dependencies {
implementation(gradleApi())
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20")
implementation("org.apache.commons:commons-lang3:3.10")
implementation("commons-io:commons-io:2.6")
implementation("commons-validator:commons-validator:1.6")
implementation("commons-codec:commons-codec:1.15")
implementation("com.neva.commons:gitignore-file-filter:1.0.0")
implementation("com.miglayout:miglayout:3.7.4")
implementation("io.pebbletemplates:pebble:3.1.2")
implementation("nu.studer:java-ordered-properties:1.0.4")
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
"detektPlugins"("io.gitlab.arturbosch.detekt:detekt-formatting:${properties["detekt.version"]}")
}
java {
withSourcesJar()
withJavadocJar()
}
tasks {
withType<JavaCompile>().configureEach{
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
withType<Test>().configureEach {
testLogging.showStandardStreams = true
useJUnitPlatform()
}
withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
named("build") {
dependsOn("sourcesJar")
}
named("publishToMavenLocal") {
dependsOn("sourcesJar")
}
named("afterReleaseBuild") {
dependsOn("publishPlugins")
}
register("fullRelease") {
dependsOn("release", "githubRelease")
}
named("githubRelease") {
mustRunAfter("release")
}
check {
dependsOn(functionalTest)
}
}
detekt {
config.from(file("detekt.yml"))
parallel = true
autoCorrect = true
failFast = true
}
gradlePlugin {
plugins {
create("fork") {
id = "com.neva.fork"
implementationClass = "com.neva.gradle.fork.ForkPlugin"
displayName = "Fork Plugin"
description = "Project generator based on live archetypes (example projects) & interactive 'gradle.properties' file generator."
}
create("props") {
id = "com.neva.fork.props"
implementationClass = "com.neva.gradle.fork.PropsPlugin"
displayName = "Fork Properties Plugin"
description = "Extension to Fork Plugin for reading encrypted properties like passwords."
}
}
}
pluginBundle {
website = "https://github.com/neva-dev/gradle-fork-plugin"
vcsUrl = "https://github.com/neva-dev/gradle-fork-plugin.git"
description = "Gradle Fork Plugin"
tags = listOf("archetype", "template", "properties", "password-encryption", "maven-archetype", "gui")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
}
githubRelease {
owner("neva-dev")
repo("gradle-fork-plugin")
token((project.findProperty("github.token") ?: "").toString())
tagName(project.version.toString())
releaseName(project.version.toString())
releaseAssets(project.fileTree("build/libs") { include("**/${project.name}-${project.version}*.jar") })
draft((project.findProperty("github.draft") ?: "false").toString().toBoolean())
prerelease((project.findProperty("github.prerelease") ?: "false").toString().toBoolean())
overwrite((project.findProperty("github.override") ?: "false").toString().toBoolean())
body { """
|# What's new
|
|TBD
|
|# Upgrade notes
|
|Nothing to do.
|
|# Contributions
|
|None.
""".trimMargin()
}
}