@@ -6,7 +6,7 @@ plugins {
66 id " maven-publish"
77 id " signing"
88 id ' checkstyle'
9- id " org.embulk.embulk-plugins" version " 0.5.5 " apply false
9+ id " org.embulk.embulk-plugins" version " 0.6.1 " apply false
1010}
1111
1212allprojects {
@@ -28,17 +28,20 @@ subprojects {
2828
2929 configurations {
3030 defaultJdbcDriver
31+ compileClasspath. resolutionStrategy. activateDependencyLocking()
32+ runtimeClasspath. resolutionStrategy. activateDependencyLocking()
3133 }
3234
33- sourceCompatibility = 1.8
34- targetCompatibility = 1.8
35-
3635 tasks. withType(JavaCompile ) {
37- options. compilerArgs << " -Xlint:unchecked " << " -Xlint:deprecation "
36+ options. compilerArgs << " -Xlint:deprecation " << " -Xlint:unchecked "
3837 options. encoding = " UTF-8"
3938 }
4039
4140 java {
41+ toolchain {
42+ languageVersion = JavaLanguageVersion . of(8 )
43+ }
44+
4245 withJavadocJar()
4346 withSourcesJar()
4447 }
@@ -47,7 +50,7 @@ subprojects {
4750 compileOnly " org.embulk:embulk-api:0.10.36"
4851 compileOnly " org.embulk:embulk-spi:0.10.36"
4952
50- compile (" org.embulk:embulk-util-config:0.3.2" ) {
53+ implementation (" org.embulk:embulk-util-config:0.3.2" ) {
5154 // They conflict with embulk-core. They are once excluded here,
5255 // and added explicitly with versions exactly the same with older embulk-core (until v0.10.31).
5356 exclude group : " com.fasterxml.jackson.core" , module : " jackson-annotations"
@@ -59,18 +62,18 @@ subprojects {
5962
6063 // They are once excluded from transitive dependencies of other dependencies,
6164 // and added explicitly with versions exactly the same with older embulk-core (until 0.10.31).
62- compile " com.fasterxml.jackson.core:jackson-annotations:2.6.7"
63- compile " com.fasterxml.jackson.core:jackson-core:2.6.7"
64- compile " com.fasterxml.jackson.core:jackson-databind:2.6.7"
65- compile " com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.6.7"
66- compile " javax.validation:validation-api:1.1.0.Final"
65+ implementation " com.fasterxml.jackson.core:jackson-annotations:2.6.7"
66+ implementation " com.fasterxml.jackson.core:jackson-core:2.6.7"
67+ implementation " com.fasterxml.jackson.core:jackson-databind:2.6.7"
68+ implementation " com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.6.7"
69+ implementation " javax.validation:validation-api:1.1.0.Final"
6770
68- compile " org.embulk:embulk-util-json:0.1.1"
69- compile " org.embulk:embulk-util-timestamp:0.2.1"
71+ implementation " org.embulk:embulk-util-json:0.1.1"
72+ implementation " org.embulk:embulk-util-timestamp:0.2.1"
7073
71- testCompile " org.embulk:embulk-junit4:0.10.36"
72- testCompile " org.embulk:embulk-core:0.10.36"
73- testCompile " org.embulk:embulk-deps:0.10.36"
74+ testImplementation " org.embulk:embulk-junit4:0.10.36"
75+ testImplementation " org.embulk:embulk-core:0.10.36"
76+ testImplementation " org.embulk:embulk-deps:0.10.36"
7477 }
7578
7679 javadoc {
@@ -80,73 +83,23 @@ subprojects {
8083 }
8184 }
8285
83- test {
84- // JDBC input plugins depend on local time zone to parse timestamp without time stamp and datetime types.
85- jvmArgs " -Duser.country=FI" , " -Duser.timezone=Europe/Helsinki"
86- environment " TZ" , " Europe/Helsinki"
87- }
88-
89- tasks. withType(Test ) {
90- testLogging {
91- // set options for log level LIFECYCLE
92- events TestLogEvent . FAILED ,
93- TestLogEvent . PASSED ,
94- TestLogEvent . SKIPPED ,
95- TestLogEvent . STANDARD_OUT
96- exceptionFormat TestExceptionFormat . FULL
97- showExceptions true
98- showCauses true
99- showStackTraces true
100-
101- afterSuite { desc , result ->
102- if (! desc. parent) { // will match the outermost suite
103- def output = " Results: ${ result.resultType} (${ result.testCount} tests, ${ result.successfulTestCount} passed, ${ result.failedTestCount} failed, ${ result.skippedTestCount} skipped)"
104- def startItem = ' | ' , endItem = ' |'
105- def repeatLength = startItem. length() + output. length() + endItem. length()
106- println (' \n ' + (' -' * repeatLength) + ' \n ' + startItem + output + endItem + ' \n ' + (' -' * repeatLength))
107- }
108- }
86+ // A safer and strict alternative to: "dependencies" (and "dependencies --write-locks")
87+ //
88+ // This task fails explicitly when the specified dependency is not available.
89+ // In contrast, "dependencies (--write-locks)" does not fail even when a part the dependencies are unavailable.
90+ //
91+ // https://docs.gradle.org/7.6.1/userguide/dependency_locking.html#generating_and_updating_dependency_locks
92+ task checkDependencies {
93+ notCompatibleWithConfigurationCache(" The task \" checkDependencies\" filters configurations at execution time." )
94+ doLast {
95+ configurations. findAll { it. canBeResolved }. each { it. resolve() }
10996 }
11097 }
11198
112- checkstyle {
113- configFile = file(" ${ project.rootDir} /config/checkstyle/checkstyle.xml" )
114- toolVersion = ' 6.14.1'
115- }
116- checkstyleMain {
117- configFile = file(" ${ project.rootDir} /config/checkstyle/default.xml" )
118- ignoreFailures = true
119- }
120- checkstyleTest {
121- configFile = file(" ${ project.rootDir} /config/checkstyle/default.xml" )
122- ignoreFailures = true
123- }
124- task checkstyle(type : Checkstyle ) {
125- classpath = sourceSets. main. output + sourceSets. test. output
126- source = sourceSets. main. allJava + sourceSets. test. allJava
127- }
128-
129- gem {
130- authors = [ " Sadayuki Furuhashi" ]
131- email = [ " frsyuki@gmail.com" ]
132- summary = " JDBC input plugin for Embulk"
133- homepage = " https://github.com/embulk/embulk-input-jdbc"
134- licenses = [ " Apache-2.0" ]
135-
136- into(" default_jdbc_driver" ) {
137- from configurations. defaultJdbcDriver
138- }
139- }
140-
141- gemPush {
142- host = " https://rubygems.org"
143- }
144-
145- javadoc {
146- options {
147- locale = ' en_US'
148- encoding = ' UTF-8'
149- }
99+ // It should not publish a `.module` file in Maven Central.
100+ // https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html#sub:disabling-gmm-publication
101+ tasks. withType(GenerateModuleMetadata ) {
102+ enabled = false
150103 }
151104
152105 publishing {
@@ -173,6 +126,7 @@ subprojects {
173126 // http://central.sonatype.org/pages/requirements.html#license-information
174127 name = " The Apache License, Version 2.0"
175128 url = " https://www.apache.org/licenses/LICENSE-2.0.txt"
129+ distribution = " repo"
176130 }
177131 }
178132
@@ -205,6 +159,72 @@ subprojects {
205159 }
206160
207161 signing {
162+ if (project. hasProperty(" signingKey" ) && project. hasProperty(" signingPassword" )) {
163+ logger. lifecycle(" Signing with an in-memory key." )
164+ useInMemoryPgpKeys(signingKey, signingPassword)
165+ }
208166 sign publishing. publications. maven
209167 }
168+
169+ gem {
170+ authors = [ " Sadayuki Furuhashi" ]
171+ email = [ " frsyuki@gmail.com" ]
172+ summary = " JDBC input plugin for Embulk"
173+ homepage = " https://github.com/embulk/embulk-input-jdbc"
174+ licenses = [ " Apache-2.0" ]
175+
176+ into(" default_jdbc_driver" ) {
177+ from configurations. defaultJdbcDriver
178+ }
179+ }
180+
181+ gemPush {
182+ host = " https://rubygems.org"
183+ }
184+
185+ test {
186+ // JDBC input plugins depend on local time zone to parse timestamp without time stamp and datetime types.
187+ jvmArgs " -Duser.country=FI" , " -Duser.timezone=Europe/Helsinki"
188+ environment " TZ" , " Europe/Helsinki"
189+ }
190+
191+ tasks. withType(Test ) {
192+ testLogging {
193+ // set options for log level LIFECYCLE
194+ events TestLogEvent . FAILED ,
195+ TestLogEvent . PASSED ,
196+ TestLogEvent . SKIPPED ,
197+ TestLogEvent . STANDARD_OUT
198+ exceptionFormat TestExceptionFormat . FULL
199+ showExceptions true
200+ showCauses true
201+ showStackTraces true
202+
203+ afterSuite { desc , result ->
204+ if (! desc. parent) { // will match the outermost suite
205+ def output = " Results: ${ result.resultType} (${ result.testCount} tests, ${ result.successfulTestCount} passed, ${ result.failedTestCount} failed, ${ result.skippedTestCount} skipped)"
206+ def startItem = ' | ' , endItem = ' |'
207+ def repeatLength = startItem. length() + output. length() + endItem. length()
208+ println (' \n ' + (' -' * repeatLength) + ' \n ' + startItem + output + endItem + ' \n ' + (' -' * repeatLength))
209+ }
210+ }
211+ }
212+ }
213+
214+ checkstyle {
215+ configFile = file(" ${ project.rootDir} /config/checkstyle/checkstyle.xml" )
216+ toolVersion = ' 6.14.1'
217+ }
218+ checkstyleMain {
219+ configFile = file(" ${ project.rootDir} /config/checkstyle/default.xml" )
220+ ignoreFailures = true
221+ }
222+ checkstyleTest {
223+ configFile = file(" ${ project.rootDir} /config/checkstyle/default.xml" )
224+ ignoreFailures = true
225+ }
226+ task checkstyle(type : Checkstyle ) {
227+ classpath = sourceSets. main. output + sourceSets. test. output
228+ source = sourceSets. main. allJava + sourceSets. test. allJava
229+ }
210230}
0 commit comments