-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
190 lines (164 loc) · 5.79 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Kotlin application project to get you started.
*/
import org.jetbrains.dokka.gradle.DokkaTask
import groovy.lang.Closure
import org.jetbrains.kotlin.gradle.utils.loadPropertyFromResources
import java.util.Properties
import java.io.File
import java.time.Duration
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM.
kotlin("jvm") version "1.4.20"
id("org.jetbrains.dokka") version "1.4.20"
id("net.researchgate.release").version("2.6.0")
id("java-library")
id("com.bmuschko.nexus").version("2.3.1")
id("io.codearte.nexus-staging").version("0.21.2")
id("de.marcphilipp.nexus-publish").version("0.3.0")
}
group = "org.bradfordmiller"
tasks.create("set-defaults") {
doFirst {
val props = Properties()
val inputStream = File("version.properties").inputStream()
props.load(inputStream)
val softwareVersion = props.get("version")!!.toString()
println("Software Version: " + softwareVersion)
group = "org.bradfordmiller"
version = softwareVersion
inputStream.close()
}
doLast {
println("Current software version is $version")
}
}
tasks.build {
dependsOn("set-defaults")
}
//Sample gradle CLI: gradle release -Prelease.useAutomaticVersion=true
release {
failOnCommitNeeded = true
failOnPublishNeeded = true
failOnSnapshotDependencies = true
failOnUnversionedFiles = true
failOnUpdateNeeded = true
revertOnFail = true
preCommitText = ""
preTagCommitMessage = "[Gradle Release Plugin] - pre tag commit: "
tagCommitMessage = "[Gradle Release Plugin] - creating tag: "
newVersionCommitMessage = "[Gradle Release Plugin] - new version commit: "
version = "$version"
versionPropertyFile = "version.properties"
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("net.sourceforge.csvjdbc:csvjdbc:1.0.35")
implementation("com.fasterxml.jackson.core:jackson-core:2.9.4")
implementation("org.apache.logging.log4j", "log4j-core", "2.12.0")
implementation("org.apache.logging.log4j", "log4j-api", "2.12.0")
api("commons-codec", "commons-codec","1.12")
implementation("org.apache.logging.log4j", "log4j-slf4j-impl", "2.12.0")
implementation("org.xerial", "sqlite-jdbc", "3.28.0")
implementation("org.json", "json", "20190722")
implementation("org.apache.commons", "commons-dbcp2", "2.7.0")
implementation("commons-io", "commons-io", "2.6")
implementation("net.sf.trove4j", "core", "3.1.0")
implementation("com.opencsv", "opencsv", "4.6")
api("org.bradfordmiller", "simplejndiutils", "0.0.13") {
isTransitive = true
}
api("org.bradfordmiller:sqlutils:0.0.4")
implementation("com.google.guava", "guava", "29.0-jre")
// Use the Kotlin test library.
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Use the Kotlin JUnit integration.
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.5.1")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.matching{it.name != "set-defaults"}.forEach {t ->
println("Found Task: " + t.name)
t.dependsOn("set-defaults")
}
tasks {
"publish" {
dependsOn("set-defaults")
doFirst {
println("Defaults are set. Current software version is $version")
}
}
}
nexusStaging {
packageGroup = "org.bradfordmiller" //optional if packageGroup == project.getGroup()
}
tasks.register<Jar>("sourcesJars") {
from(sourceSets.main.get().allJava)
archiveClassifier.set("sources")
}
tasks.register<Jar>("javadocJars") {
from(tasks.javadoc)
archiveClassifier.set("javadoc")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
tasks.matching{it.name != "set-defaults"}.forEach {t ->
println("Found Task: " + t.name)
t.dependsOn("set-defaults")
}
pom {
name.set("deduper")
description.set("General deduping engine for JDBC sources with output to JDBC/csv targets")
url.set("https://github.com/bmiller1009/deduper")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("bmiller1009")
name.set("Bradford Miller")
email.set("bfm@bradfordmiller.org")
}
}
scm {
connection.set("scm:git@github.com:bmiller1009/deduper.git")
developerConnection.set("scm:git:ssh://github.com/deduper.git")
url.set("git@github.com:bmiller1009/deduper.git/")
}
}
from(components["java"])
artifact(tasks["sourcesJars"])
artifact(tasks["javadocJars"])
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
val uname: String? by project
val pwd: String? by project
nexusPublishing {
repositories {
sonatype {
username.set(uname)
password.set(pwd)
}
}
//val duration: java.time.Duration? = Duration.ofSeconds(900)
clientTimeout.set(Duration.ofSeconds(900))
}