-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
163 lines (144 loc) · 5.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
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
156
157
158
159
160
161
162
163
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("java-gradle-plugin")
id("maven-publish")
id("org.jetbrains.kotlin.jvm") version "1.6.21"
id("com.gradle.plugin-publish") version "1.0.0"
id("io.gitlab.arturbosch.detekt") version "1.21.0"
id("net.researchgate.release") version "3.0.2"
id("com.github.breadmoirai.github-release") version "2.4.1"
}
defaultTasks("build", "publishToMavenLocal")
description = "Gradle Common Plugin"
group = "com.cognifide.gradle"
allprojects {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
plugins.withId("java") {
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<JavaCompile>().configureEach{
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
tasks.withType<Test>().configureEach {
testLogging.showStandardStreams = true
useJUnitPlatform()
}
}
plugins.withId("kotlin") {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
}
}
dependencies {
// Build environment
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
// External dependencies
implementation("org.apache.commons:commons-lang3:3.12.0")
implementation("org.apache.sshd:sshd-sftp:2.8.0")
implementation("org.apache.httpcomponents:httpclient:4.5.13")
implementation("org.apache.httpcomponents:httpmime:4.5.13")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.1")
implementation("org.codelibs:jcifs:1.3.18.3")
implementation("org.jsoup:jsoup:1.14.3")
implementation("commons-io:commons-io:2.11.0")
implementation("io.pebbletemplates:pebble:3.1.5")
implementation("com.dorkbox:Notify:3.7")
implementation("net.lingala.zip4j:zip4j:2.9.1")
implementation("org.buildobjects:jproc:2.8.0")
}
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")
}
val check by tasks.getting(Task::class) {
dependsOn(functionalTest)
}
tasks {
test {
dependsOn("detektTest")
}
afterReleaseBuild {
dependsOn("publishPlugins")
}
named("githubRelease") {
mustRunAfter("release")
}
register("fullRelease") {
dependsOn("release", "githubRelease")
}
}
detekt {
config.from(file("detekt.yml"))
parallel = true
autoCorrect = true
}
gradlePlugin {
plugins {
create("common") {
id = "com.cognifide.common"
implementationClass = "com.cognifide.gradle.common.CommonPlugin"
displayName = "Common Plugin"
description = "Provides generic purpose Gradle utilities like: file transfer (upload/download)" +
" via SMB/SFTP/HTTP, file watcher, async progress logger, GUI notification service."
}
create("runtime") {
id = "com.cognifide.common.runtime"
implementationClass = "com.cognifide.gradle.common.RuntimePlugin"
displayName = "Runtime Plugin"
description = "Introduces base lifecycle tasks (like 'up', 'down') for controlling runtimes (servers, applications)"
}
}
}
pluginBundle {
website = "https://github.com/wttech/gradle-common-plugin"
vcsUrl = "https://github.com/wttech/gradle-common-plugin.git"
description = "Gradle Common Plugin"
tags = listOf(
"sftp", "smb", "ssh", "progress", "file watcher", "file download", "file upload",
"gui notification", "gradle-plugin", "gradle plugin development"
)
}
githubRelease {
owner("wttech")
repo("gradle-common-plugin")
token((project.findProperty("github.token") ?: "").toString())
tagName(project.version.toString())
releaseName(project.version.toString())
releaseAssets(tasks["jar"], tasks["sourcesJar"], tasks["javadocJar"])
draft((project.findProperty("github.draft") ?: "false").toString().toBoolean())
prerelease((project.findProperty("github.prerelease") ?: "false").toString().toBoolean())
overwrite((project.findProperty("github.override") ?: "true").toString().toBoolean())
body { """
|# What's new
|
|TBD
|
|# Upgrade notes
|
|Nothing to do.
|
|# Contributions
|
|None.
""".trimMargin()
}
}