11import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
23import java.util.regex.Matcher
34
45plugins {
@@ -33,39 +34,6 @@ subprojects {
3334 configurations {
3435 included
3536 archives. extendsFrom included
36-
37- for (version in flywayCoreVersions) {
38- " testRuntimeWithFlywayCore$version " {
39- extendsFrom testRuntime
40- resolutionStrategy {
41- eachDependency { details ->
42- if (details. requested. name == ' flyway-core' ) {
43- details. useVersion " $version "
44- }
45- }
46- }
47- }
48- }
49-
50- for (version in flywayTestExtensionsVersions) {
51- " testRuntimeWithFlywayTestExtensions$version " {
52- extendsFrom testRuntime
53- resolutionStrategy {
54- eachDependency { details ->
55- if (details. requested. group == ' org.flywaydb.flyway-test-extensions' ) {
56- details. useVersion " $version "
57- }
58- }
59- }
60- }
61- }
62- }
63-
64- dependencies {
65- testCompile ' junit:junit:4.12'
66- testCompile ' org.mockito:mockito-all:1.9.5'
67- testCompile ' org.assertj:assertj-core:3.6.1'
68- testCompile ' ch.qos.logback:logback-classic:1.2.3'
6937 }
7038
7139 tasks. withType(JavaCompile ) {
@@ -77,44 +45,6 @@ subprojects {
7745 options. addStringOption(' Xdoclint:none' , ' -quiet' )
7846 }
7947
80- test {
81- useJUnit()
82- }
83-
84- for (version in flywayCoreVersions) {
85- task " testWithFlywayCore$version " (type : Test ) {
86- dependsOn jar
87-
88- classpath - = configurations. testRuntime
89- classpath + = configurations. " testRuntimeWithFlywayCore$version "
90-
91- useJUnit {
92- includeCategories ' io.zonky.test.category.FlywayIntegrationTests'
93- includeCategories ' io.zonky.test.category.MultiFlywayIntegrationTests'
94- }
95- }
96- check. dependsOn(" testWithFlywayCore$version " )
97- }
98-
99- for (version in flywayTestExtensionsVersions) {
100- task " testWithFlywayTestExtensions$version " (type : Test ) {
101- dependsOn jar
102-
103- classpath - = configurations. testRuntime
104- classpath + = configurations. " testRuntimeWithFlywayTestExtensions$version "
105-
106- useJUnit {
107- includeCategories ' io.zonky.test.category.FlywayIntegrationTests'
108-
109- if (VersionNumber . withPatchNumber(). parse(version) >= VersionNumber . withPatchNumber(). parse(" 4.2.0.1" )) {
110- println " MultiFlywayIntegrationTests category has been applied!!! - $version "
111- includeCategories ' io.zonky.test.category.MultiFlywayIntegrationTests'
112- }
113- }
114- }
115- check. dependsOn(" testWithFlywayTestExtensions$version " )
116- }
117-
11848 task sourcesJar(type : Jar ) {
11949 classifier = ' sources'
12050 from sourceSets. main. allSource
@@ -198,28 +128,29 @@ subprojects {
198128}
199129
200130project(' :embedded-database-spring-test-autoconfigure' ) {
201- archivesBaseName = ' embedded-database-spring-test'
202-
203- dependencies {
204- compile project(' :embedded-database-spring-test-core' )
205- }
206131}
207132
208- project(' :embedded-database-spring-test-core ' ) {
133+ project(' :embedded-database-spring-test' ) {
209134 dependencies {
210135 runtime ' io.zonky.test.postgres:embedded-postgres-binaries-windows-amd64:10.4.0'
211136 runtime ' io.zonky.test.postgres:embedded-postgres-binaries-darwin-amd64:10.4.0'
212137 runtime ' io.zonky.test.postgres:embedded-postgres-binaries-linux-amd64:10.4.0'
213138 runtime ' io.zonky.test.postgres:embedded-postgres-binaries-linux-amd64-alpine:10.4.0'
214139
140+ compile project(' :embedded-database-spring-test-autoconfigure' )
215141 compile ' org.springframework:spring-context:4.3.10.RELEASE'
216142 compile ' org.springframework:spring-test:4.3.10.RELEASE'
217143 compile ' org.flywaydb.flyway-test-extensions:flyway-spring-test:4.2.0.2'
218144 compile ' com.google.guava:guava:23.0'
145+ compile ' org.tukaani:xz:1.8'
146+
147+ testCompile ' junit:junit:4.12'
148+ testCompile ' org.mockito:mockito-all:1.9.5'
149+ testCompile ' org.assertj:assertj-core:3.6.1'
150+ testCompile ' ch.qos.logback:logback-classic:1.2.3'
219151
220152 // some classes of otj-pg-embedded component are repackaged into the shadowed jar
221153 included ' com.opentable.components:otj-pg-embedded:0.9.0'
222-
223154 configurations. included. incoming. resolutionResult. allDependencies { result ->
224155 compile result. getRequested(). getDisplayName()
225156 }
@@ -256,6 +187,75 @@ project(':embedded-database-spring-test-core') {
256187 enabled = false
257188 dependsOn shadowJar
258189 }
190+
191+ configurations {
192+ for (version in flywayCoreVersions) {
193+ " testRuntimeWithFlywayCore$version " {
194+ extendsFrom testRuntime
195+ resolutionStrategy {
196+ eachDependency { details ->
197+ if (details. requested. name == ' flyway-core' ) {
198+ details. useVersion " $version "
199+ }
200+ }
201+ }
202+ }
203+ }
204+
205+ for (version in flywayTestExtensionsVersions) {
206+ " testRuntimeWithFlywayTestExtensions$version " {
207+ extendsFrom testRuntime
208+ resolutionStrategy {
209+ eachDependency { details ->
210+ if (details. requested. group == ' org.flywaydb.flyway-test-extensions' ) {
211+ details. useVersion " $version "
212+ }
213+ }
214+ }
215+ }
216+ }
217+ }
218+
219+ for (version in flywayCoreVersions) {
220+ task " testWithFlywayCore$version " (type : Test ) {
221+ dependsOn jar
222+
223+ classpath - = configurations. testRuntime
224+ classpath + = configurations. " testRuntimeWithFlywayCore$version "
225+
226+ useJUnit {
227+ includeCategories ' io.zonky.test.category.FlywayIntegrationTests'
228+ includeCategories ' io.zonky.test.category.MultiFlywayIntegrationTests'
229+ }
230+ }
231+ check. dependsOn(" testWithFlywayCore$version " )
232+ }
233+
234+ for (version in flywayTestExtensionsVersions) {
235+ task " testWithFlywayTestExtensions$version " (type : Test ) {
236+ dependsOn jar
237+
238+ classpath - = configurations. testRuntime
239+ classpath + = configurations. " testRuntimeWithFlywayTestExtensions$version "
240+
241+ useJUnit {
242+ includeCategories ' io.zonky.test.category.FlywayIntegrationTests'
243+
244+ if (VersionNumber . withPatchNumber(). parse(version) >= VersionNumber . withPatchNumber(). parse(" 4.2.0.1" )) {
245+ println " MultiFlywayIntegrationTests category has been applied!!! - $version "
246+ includeCategories ' io.zonky.test.category.MultiFlywayIntegrationTests'
247+ }
248+ }
249+ }
250+ check. dependsOn(" testWithFlywayTestExtensions$version " )
251+ }
252+
253+ tasks. withType(Test ) {
254+ testLogging {
255+ showStandardStreams = true
256+ exceptionFormat = ' full'
257+ }
258+ }
259259}
260260
261261task updateReadmeVersion () {
0 commit comments