-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
152 lines (138 loc) · 3.9 KB
/
build.gradle
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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'jacoco'
alias libs.plugins.io.freefair.lombok
alias libs.plugins.com.github.ben.manes.versions
alias libs.plugins.nl.littlerobots.version.catalog.update
}
dependencies {
implementation libs.org.influxdb.influxdb.java
implementation libs.org.apache.commons.commons.lang3
implementation libs.org.slf4j.slf4j.api
implementation libs.com.vdurmont.semver4j
testImplementation libs.org.testcontainers.influxdb
testImplementation libs.ch.qos.logback.logback.classic
testImplementation libs.org.apache.commons.commons.collections4
testImplementation libs.org.mockito.mockito.core
testImplementation libs.org.junit.jupiter.junit.jupiter.engine
testImplementation libs.org.junit.jupiter.junit.jupiter.params
}
ext.moduleName = 'InfluxDbSqlDriver'
java {
sourceCompatibility = "11"
targetCompatibility = "11"
withJavadocJar()
withSourcesJar()
}
compileJava {
inputs.property('moduleName', moduleName)
doFirst {
options.compilerArgs = ['--module-path', classpath.asPath]
}
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
useJUnitPlatform()
}
jacocoTestReport {
reports {
xml.required = true
html.required = false
}
}
repositories {
mavenCentral()
}
javadoc {
inputs.property('moduleName', moduleName)
doFirst {
options.modulePath = [] + classpath.files
options.classpath = []
}
options {
//failOnError = false
encoding = 'UTF-8'
//addBooleanOption 'Xdoclint:all,-html,-accessibility,-reference', true
}
}
jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}
tasks.processResources.finalizedBy tasks.register('applicationVersion') {
doFirst {
new File(sourceSets.main.output.resourcesDir, 'version.properties').write "version=${version}\n"
}
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/konikvranik/jdbc-influxdb")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
maven {
name = "OSSRHPackages"
url = uri(version.endsWith('SNAPSHOT')
? "https://s01.oss.sonatype.org/content/repositories/snapshots/"
: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.findProperty("ossrh.username") ?: System.getenv("OSSRH_USERNAME")
password = project.findProperty("ossrh.password") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
from(project.components.java)
}
project.publishing.publications.withType(MavenPublication) {
pom {
name = 'influxdb-jdbc'
description = 'JDBC driver for InfluxDB'
url = 'https://github.com/konikvranik/jdbc-influxdb'
organization {
name = 'SuTeren'
url = 'https://github.com/konikvranik'
}
ciManagement {
system = 'GitHub'
url = 'https://github.com/konikvranik/jdbc-influxdb/actions'
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/konikvranik/jdbc-influxdb/issues'
}
scm {
connection = 'scm:git:https://github.com/konikvranik/jdbc-influxdb.git'
developerConnection = 'scm:git:ssh:git@github.com:konikvranik/jdbc-influxdb.git'
url = 'https://github.com/konikvranik/jdbc-influxdb/'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'konikvranik'
name = 'Petr Vraník'
email = 'petr@vranik.name'
}
}
}
}
}
}
signing {
useInMemoryPgpKeys(findProperty('signing.key') ?: System.getenv('GPG_SIGNING_KEY'), findProperty('signing.password') ?: System.getenv('GPG_SIGNING_PASSWORD'))
sign publishing.publications.mavenJava
}