Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Gradle to 6.3 #345

Merged
merged 24 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9bc3a02
upgrade Gradle to 6.3
aaschmid Feb 16, 2020
4b9c265
update build scan plugin for Gradle 6 compatibility
aaschmid Feb 16, 2020
a8ee782
Gradles newer versions prefer `testImplementation` over `testCompile`
aaschmid Feb 16, 2020
af5bd26
replace deprecated property by "archiveFileName"
aaschmid Feb 16, 2020
961d022
replace deprecated property by "archiveVersion"
aaschmid Feb 16, 2020
2db9288
replace deprecated property by "archiveClassifier"
aaschmid Feb 16, 2020
adcab80
replace deprecated property by "archiveFile"
aaschmid Feb 16, 2020
9028869
migrate integration test build to non-deprecated configurations
aaschmid Feb 16, 2020
746dc0a
migrate examples build to non-deprecated configurations
aaschmid Feb 16, 2020
dbf5b73
migrate archunit-junit build to non-deprecated configurations
aaschmid Feb 16, 2020
3b15c6e
migrate archunit-junit4 build to non-deprecated configurations
aaschmid Feb 16, 2020
ff80df6
prevent name conflict with newly available `api` configuration
aaschmid Feb 16, 2020
b4734e6
migrate archunit-junit5 builds to non-deprecated configurations
aaschmid Feb 16, 2020
bfb07e5
migrate archunit core build to non-deprecated configurations
aaschmid Feb 16, 2020
d829e65
use by default provided config for creating sources and javadoc jars
aaschmid Feb 16, 2020
c775795
replace `java` with `java-library` plugin globally
aaschmid Feb 16, 2020
0ff062f
do not apply external plugins directly
aaschmid Feb 16, 2020
1e3558b
remove unnecessary implementation dependency
codecholeric Apr 11, 2020
998dcb9
fix broken publishing
codecholeric Apr 12, 2020
afc6495
make all `AbstractPublishToMaven` tasks depend on `build`
codecholeric Apr 13, 2020
90b8649
adjust `JavaVersions` for `maven-integration-test`
codecholeric Apr 13, 2020
26f0ea1
add hack to be able to run tests with IntelliJ test runner
codecholeric Apr 13, 2020
b79220f
move check for non-parallel build to tasks with type `PublishToMavenR…
codecholeric Apr 13, 2020
0fa7444
adjust `checkUploadedArtifacts` to newly generated POM
codecholeric Apr 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java

script:
- ./gradlew --no-daemon --info -PallTests -PscanBuild clean build publishToMavenLocal runMavenTest
- ./gradlew --no-daemon --scan --info -PallTests clean build publishToMavenLocal runMavenTest

jdk:
- openjdk11
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ framework.
###### Gradle

```
testCompile 'com.tngtech.archunit:archunit:0.13.1'
testImplementation 'com.tngtech.archunit:archunit:0.13.1'
```

###### Maven
Expand Down
15 changes: 8 additions & 7 deletions archunit-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ ext.moduleName = 'com.tngtech.archunit.example'

proj.with {
dependencies {
compile dependency.jodaTime
compile dependency.javaxAnnotationApi
compile dependency.springBeans
compile dependency.guice
compile dependency.geronimoEjb
compile dependency.geronimoJpa
// `api` dependencies so we can access them within `archunit-integration-test`
api dependency.jodaTime
api dependency.javaxAnnotationApi
api dependency.springBeans
api dependency.guice
api dependency.geronimoEjb
api dependency.geronimoJpa

testCompile project(path: ':archunit')
testImplementation project(path: ':archunit')
}
}
}
10 changes: 5 additions & 5 deletions archunit-example/example-junit4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ext.moduleName = 'com.tngtech.archunit.example.junit4'

dependencies {
testCompile project(path: ':archunit-junit4')
testCompile project(path: ':archunit-example:example-plain')
testImplementation project(path: ':archunit-junit4')
testImplementation project(path: ':archunit-example:example-plain')

testRuntime dependency.log4j_api
testRuntime dependency.log4j_core
testRuntime dependency.log4j_slf4j
testRuntimeOnly dependency.log4j_api
testRuntimeOnly dependency.log4j_core
testRuntimeOnly dependency.log4j_slf4j
}

test {
Expand Down
10 changes: 5 additions & 5 deletions archunit-example/example-junit5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
testCompile project(path: ':archunit-junit5')
testCompile project(path: ':archunit-example:example-plain')
testImplementation project(path: ':archunit-junit5')
testImplementation project(path: ':archunit-example:example-plain')

testRuntime dependency.log4j_api
testRuntime dependency.log4j_core
testRuntime dependency.log4j_slf4j
testRuntimeOnly dependency.log4j_api
testRuntimeOnly dependency.log4j_core
testRuntimeOnly dependency.log4j_slf4j
}

test {
Expand Down
4 changes: 2 additions & 2 deletions archunit-example/example-plain/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ext.moduleName = 'com.tngtech.archunit.example.plain'

dependencies {
testCompile project(path: ':archunit')
testImplementation project(path: ':archunit')

// we still use JUnit 4 as the test runner, but we don't use JUnit 4 support within this project
// so tests could well be run using TestNG, etc.
testCompile dependency.junit4
testImplementation dependency.junit4
}

test {
Expand Down
32 changes: 16 additions & 16 deletions archunit-integration-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
testCompile dependency.junit5JupiterEngine
testCompile dependency.junitPlatform
testCompile dependency.assertj
testCompile dependency.mockito
testCompile dependency.guava
testCompile dependency.log4j_api
testCompile dependency.log4j_core
testCompile dependency.log4j_slf4j
testCompile project(path: ':archunit', configuration: 'tests')
testCompile project(path: ':archunit-junit4')
testCompile project(path: ':archunit-junit5-api')
testCompile project(path: ':archunit-example:example-plain')
testCompile project(path: ':archunit-example:example-plain', configuration: 'tests')
testCompile project(path: ':archunit-example:example-junit4', configuration: 'tests')
testCompile project(path: ':archunit-example:example-junit5', configuration: 'tests')
testImplementation dependency.junit5JupiterEngine
testImplementation dependency.junitPlatform
testImplementation dependency.assertj
testImplementation dependency.mockito
testImplementation dependency.guava
testImplementation dependency.log4j_api
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
testImplementation project(path: ':archunit', configuration: 'tests')
testImplementation project(path: ':archunit-junit4')
testImplementation project(path: ':archunit-junit5-api')
testImplementation project(path: ':archunit-example:example-plain')
testImplementation project(path: ':archunit-example:example-plain', configuration: 'tests')
testImplementation project(path: ':archunit-example:example-junit4', configuration: 'tests')
testImplementation project(path: ':archunit-example:example-junit5', configuration: 'tests')

testRuntime project(path: ':archunit-junit5-engine')
testRuntimeOnly project(path: ':archunit-junit5-engine')
}

test {
Expand Down
55 changes: 28 additions & 27 deletions archunit-junit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
ext.moduleName = 'com.tngtech.archunit.junit'

configurations {
api
compile.extendsFrom api
testCompile.extendsFrom api
archJunitApi
api.extendsFrom archJunitApi
}

sourceSets {
api {
archJunitApi {
java {
srcDirs = ['src/api/java']
}
compileClasspath = configurations.api
compileClasspath = configurations.archJunitApi
}
}

dependencies {
compileOnly sourceSets.api.output
testCompile sourceSets.api.output
compileOnly sourceSets.archJunitApi.output
testImplementation sourceSets.archJunitApi.output
}

task apiJar(type: Jar) {
archiveName = jar.archiveName.replace(project.name, "${project.name}-api")
from sourceSets.api.output
archiveFileName = jar.archiveFileName.get().replace(project.name, "${project.name}-api")
from sourceSets.archJunitApi.output
}
build.dependsOn apiJar

artifacts {
api apiJar
archJunitApi apiJar
}

dependencies {
api project(path: ':archunit', configuration: 'shadow')
compile project(path: ':archunit', configuration: 'shadow')
compile dependency.guava
compile dependency.slf4j

testCompile dependency.log4j_api
testCompile dependency.log4j_core
testCompile dependency.log4j_slf4j
testCompile dependency.mockito
testCompile dependency.assertj
testCompile(dependency.assertj_guava) {
archJunitApi project(path: ':archunit', configuration: 'shadow')
implementation dependency.guava
implementation dependency.slf4j

testImplementation dependency.log4j_api
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
testImplementation dependency.junit4
testImplementation dependency.junit_dataprovider
testImplementation dependency.mockito
testImplementation dependency.assertj
testImplementation(dependency.assertj_guava) {
exclude module: 'assertj-core'
exclude module: 'guava'
}
testCompile project(path: ':archunit', configuration: 'tests')
testImplementation project(path: ':archunit', configuration: 'tests')
}

addTestJarTo this
Expand All @@ -64,13 +64,14 @@ def addCleanThirdPartyTask = {
tasks.create(name: 'removeDuplicateThirdParty', type: Jar, dependsOn: shadowJar) {
exclude "${thirdPartyRelocationPackage.replace('.', '/')}/**"

File tempPath = tempJar(jar.archivePath)
from zipTree(shadowJar.archivePath)
archiveName tempPath.name
File tempPath = tempJar(jar.archiveFile.get().getAsFile())
File jarPath = shadowJar.archiveFile.get().getAsFile()
from zipTree(jarPath)
archiveFileName = tempPath.name

doLast {
assert shadowJar.archivePath.delete()
assert tempPath.renameTo(shadowJar.archivePath)
assert jarPath.delete()
assert tempPath.renameTo(jarPath)
}
}
finishArchive.dependsOn removeDuplicateThirdParty
Expand Down
42 changes: 24 additions & 18 deletions archunit-junit/junit4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
ext.moduleName = 'com.tngtech.archunit.junit4'

dependencies {
compile project(path: ':archunit', configuration: 'shadow')
compile project(path: ':archunit-junit', configuration: 'api')
compile project(path: ':archunit-junit', configuration: 'shadow')
compile dependency.guava
compile dependency.junit4
compile dependency.slf4j

testCompile dependency.log4j_api
testCompile dependency.log4j_core
testCompile dependency.log4j_slf4j
testCompile dependency.mockito
testCompile dependency.assertj
testCompile(dependency.assertj_guava) {
api project(path: ':archunit', configuration: 'shadow')
api project(path: ':archunit-junit', configuration: 'archJunitApi')
api dependency.junit4
implementation project(path: ':archunit-junit', configuration: 'shadow')
implementation dependency.guava
implementation dependency.slf4j

testImplementation dependency.log4j_api
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
testImplementation dependency.junit4
testImplementation dependency.junit_dataprovider
testImplementation dependency.mockito
testImplementation dependency.assertj
testImplementation(dependency.assertj_guava) {
exclude module: 'assertj-core'
exclude module: 'guava'
}
testCompile project(path: ':archunit', configuration: 'tests')
testCompile project(path: ':archunit-junit', configuration: 'tests')
testImplementation project(path: ':archunit', configuration: 'tests')
testImplementation project(path: ':archunit-junit', configuration: 'tests')

// This is a hack for running tests with IntelliJ instead of delegating to Gradle,
// because for some reason this dependency cannot be resolved otherwise only for archunit-junit4 :-(
testRuntimeOnly dependency.asm
}

javadoc {
source(['api', 'main'].collect { project(':archunit-junit').sourceSets[it].allJava })
source(['archJunitApi', 'main'].collect { project(':archunit-junit').sourceSets[it].allJava })
}
sourcesJar {
['api', 'main'].each {
['archJunitApi', 'main'].each {
from project(':archunit-junit').sourceSets[it].allSource
}
}
Expand All @@ -48,4 +54,4 @@ def configureDependencies = { deps ->
dep.scope.text() != 'compile' || !(dep.artifactId.text() in ['archunit', 'archunit-junit5-api', 'archunit-junit5-engine-api', 'junit'])
}
}
this.with project(':archunit-junit').configureJUnitArchive(configureDependencies)
this.with project(':archunit-junit').configureJUnitArchive(configureDependencies)
2 changes: 0 additions & 2 deletions archunit-junit/junit5/aggregator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
apply plugin: 'java-library'

ext.moduleName = 'com.tngtech.archunit.junit5'

sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
10 changes: 5 additions & 5 deletions archunit-junit/junit5/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
compile project(path: ':archunit')
compile project(path: ':archunit-junit', configuration: 'api')
compile dependency.junitPlatformCommons
api project(path: ':archunit')
api project(path: ':archunit-junit', configuration: 'archJunitApi')
api dependency.junitPlatformCommons
}

javadoc {
source(project(':archunit-junit').sourceSets.api.allJava)
source(project(':archunit-junit').sourceSets.archJunitApi.allJava)
}
sourcesJar {
from project(':archunit-junit').sourceSets.api.allSource
from project(':archunit-junit').sourceSets.archJunitApi.allSource
}

shadowJar {
Expand Down
24 changes: 12 additions & 12 deletions archunit-junit/junit5/engine-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
compile project(path: ':archunit')
compile dependency.guava
compile dependency.slf4j
compile dependency.junitPlatformEngine

testCompile project(path: ':archunit-junit5-api')
testCompile project(path: ':archunit', configuration: 'tests')
testCompile dependency.assertj
testCompile dependency.mockito
testCompile dependency.junit5JupiterApi

testRuntime dependency.junit5JupiterEngine
api dependency.junitPlatformEngine
implementation project(path: ':archunit')
implementation dependency.guava
implementation dependency.slf4j

testImplementation project(path: ':archunit-junit5-api')
testImplementation project(path: ':archunit', configuration: 'tests')
testImplementation dependency.assertj
testImplementation dependency.mockito
testImplementation dependency.junit5JupiterApi

testRuntimeOnly dependency.junit5JupiterEngine
}

compileJava.dependsOn project(':archunit-junit5-api').finishArchive
Expand Down
28 changes: 14 additions & 14 deletions archunit-junit/junit5/engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
compile project(path: ':archunit')
compile project(path: ':archunit-junit')
compile project(path: ':archunit-junit5-api')
compile project(path: ':archunit-junit5-engine-api')
compile dependency.guava
compile dependency.slf4j

testCompile project(path: ':archunit', configuration: 'tests')
testCompile dependency.assertj
testCompile dependency.mockito
testCompile dependency.junit5JupiterApi

testRuntime dependency.junit5JupiterEngine
api project(path: ':archunit')
api project(path: ':archunit-junit5-api')
api project(path: ':archunit-junit5-engine-api')
implementation project(path: ':archunit-junit')
implementation dependency.guava
implementation dependency.slf4j

testImplementation project(path: ':archunit', configuration: 'tests')
testImplementation dependency.assertj
testImplementation dependency.mockito
testImplementation dependency.junit5JupiterApi

testRuntimeOnly dependency.junit5JupiterEngine
}

compileJava.dependsOn project(':archunit-junit5-api').finishArchive
Expand All @@ -42,7 +42,7 @@ shadowJar {

dependencies {
exclude(dependency {
def isApi = it.configuration == 'api'
def isApi = it.configuration == 'archJunitApi'
def isUnwantedDependency = it.name != dependency.guava && it.moduleName != 'archunit-junit'
isUnwantedDependency || isApi
})
Expand Down
Loading