-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
116 lines (103 loc) · 2.67 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.4/userguide/java_library_plugin.html
*/
group = "com.github.juliomarcopineda"
version = "0.1.1"
plugins {
`java-library`
`maven-publish`
signing
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
testImplementation("junit:junit:4.12")
testImplementation("org.xerial:sqlite-jdbc:3.27.2.1")
}
tasks {
jar {
manifest {
attributes(
mapOf("Implementation-Title" to project.name,
"Implementation-Version" to project.version)
)
}
}
}
tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
}
tasks.register<Jar>("javadocJar") {
archiveClassifier.set("javadoc")
from(tasks.javadoc.get().destinationDir)
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
tasks.test {
useJUnit()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "jdbc-stream"
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("JDBC Stream")
description.set("Light-weight library to wrap JDBC ResultSet to Java 8 Stream")
url.set("https://github.com/juliomarcopineda/jdbc-stream")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("juliomarcopineda")
name.set("Julio Marco Pineda")
email.set("[email protected]")
}
}
scm {
connection.set("[email protected]:juliomarcopineda/jdbc-stream.git")
developerConnection.set("[email protected]:juliomarcopineda/jdbc-stream.git")
url.set("https://github.com/juliomarcopineda/jdbc-stream")
}
}
}
}
repositories {
maven {
val sonatypeUsername: String? by project
val sonatypePassword: String? by project
url=uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}