diff --git a/.travis.yml b/.travis.yml index 53610f6d06..c79d0f6468 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/README.md b/README.md index a8d66cfbc9..20a83016f8 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ framework. ###### Gradle ``` -testCompile 'com.tngtech.archunit:archunit:0.13.1' +testImplementation 'com.tngtech.archunit:archunit:0.13.1' ``` ###### Maven diff --git a/archunit-example/build.gradle b/archunit-example/build.gradle index 77a670519e..28de84232f 100644 --- a/archunit-example/build.gradle +++ b/archunit-example/build.gradle @@ -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') } } } diff --git a/archunit-example/example-junit4/build.gradle b/archunit-example/example-junit4/build.gradle index cffa6da9bd..6cb1b24f03 100644 --- a/archunit-example/example-junit4/build.gradle +++ b/archunit-example/example-junit4/build.gradle @@ -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 { diff --git a/archunit-example/example-junit5/build.gradle b/archunit-example/example-junit5/build.gradle index 00d7e41228..38115216cc 100644 --- a/archunit-example/example-junit5/build.gradle +++ b/archunit-example/example-junit5/build.gradle @@ -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 { diff --git a/archunit-example/example-plain/build.gradle b/archunit-example/example-plain/build.gradle index 7cc90afd8d..7679f17774 100644 --- a/archunit-example/example-plain/build.gradle +++ b/archunit-example/example-plain/build.gradle @@ -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 { diff --git a/archunit-integration-test/build.gradle b/archunit-integration-test/build.gradle index db2f370ec3..cb0b666974 100644 --- a/archunit-integration-test/build.gradle +++ b/archunit-integration-test/build.gradle @@ -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 { diff --git a/archunit-junit/build.gradle b/archunit-junit/build.gradle index 1f4d44e1aa..77a8ff2eec 100644 --- a/archunit-junit/build.gradle +++ b/archunit-junit/build.gradle @@ -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 @@ -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 diff --git a/archunit-junit/junit4/build.gradle b/archunit-junit/junit4/build.gradle index 3f8fdb5012..c10594585d 100644 --- a/archunit-junit/junit4/build.gradle +++ b/archunit-junit/junit4/build.gradle @@ -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 } } @@ -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) \ No newline at end of file +this.with project(':archunit-junit').configureJUnitArchive(configureDependencies) diff --git a/archunit-junit/junit5/aggregator/build.gradle b/archunit-junit/junit5/aggregator/build.gradle index 5d42410dd8..4f63cc8076 100644 --- a/archunit-junit/junit5/aggregator/build.gradle +++ b/archunit-junit/junit5/aggregator/build.gradle @@ -1,5 +1,3 @@ -apply plugin: 'java-library' - ext.moduleName = 'com.tngtech.archunit.junit5' sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/archunit-junit/junit5/api/build.gradle b/archunit-junit/junit5/api/build.gradle index 0f6174d9db..5c54f9dd50 100644 --- a/archunit-junit/junit5/api/build.gradle +++ b/archunit-junit/junit5/api/build.gradle @@ -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 { diff --git a/archunit-junit/junit5/engine-api/build.gradle b/archunit-junit/junit5/engine-api/build.gradle index 1f4638a2e9..22f8f93044 100644 --- a/archunit-junit/junit5/engine-api/build.gradle +++ b/archunit-junit/junit5/engine-api/build.gradle @@ -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 diff --git a/archunit-junit/junit5/engine/build.gradle b/archunit-junit/junit5/engine/build.gradle index 92fe9f2808..405ca5a1af 100644 --- a/archunit-junit/junit5/engine/build.gradle +++ b/archunit-junit/junit5/engine/build.gradle @@ -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 @@ -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 }) diff --git a/archunit/build.gradle b/archunit/build.gradle index 7369ab9ab7..fbcb0dac9e 100644 --- a/archunit/build.gradle +++ b/archunit/build.gradle @@ -3,18 +3,18 @@ apply plugin: 'idea' ext.moduleName = 'com.tngtech.archunit' dependencies { - compile dependency.asm - compile dependency.guava - compile dependency.slf4j - - testCompile dependency.log4j_api - testCompile dependency.log4j_core - testCompile dependency.log4j_slf4j - testCompile dependency.junit4 - testCompile dependency.junit_dataprovider - testCompile dependency.mockito - testCompile dependency.assertj - testCompile(dependency.assertj_guava) { + api dependency.slf4j + implementation dependency.asm + implementation dependency.guava + + 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' } @@ -63,11 +63,11 @@ sourceSets { } dependencies { - jdk9mainCompile sourceSets.main.output - jdk9testCompile sourceSets.test.output - jdk9testCompile sourceSets.jdk9main.output + jdk9mainImplementation sourceSets.main.output + jdk9testImplementation sourceSets.test.output + jdk9testImplementation sourceSets.jdk9main.output - runtime sourceSets.jdk9main.output + runtimeOnly sourceSets.jdk9main.output } compileJdk9mainJava.with { diff --git a/build-steps/archiving/archiving.gradle b/build-steps/archiving/archiving.gradle index 782c171e92..30f882f97b 100644 --- a/build-steps/archiving/archiving.gradle +++ b/build-steps/archiving/archiving.gradle @@ -12,10 +12,10 @@ subprojects { 'Built-By': "Gradle ${gradle.gradleVersion}", 'Built-Date': new Date().format('yyyy-MM-dd'), 'Specification-Title': createModuleDescription(app.name, project), - 'Specification-Version': version, + 'Specification-Version': archiveVersion.get(), 'Specification-Vendor': company.name, 'Implementation-Title': "com.tngtech.${project.name.replace('-', '.')}", - 'Implementation-Version': version, + 'Implementation-Version': archiveVersion.get(), 'Implementation-Vendor': company.name, 'Issue-Tracker': app.urls.issues, 'Documentation-URL': app.urls.doc, @@ -32,7 +32,7 @@ productionProjects*.with { apply plugin: 'com.github.johnrengelman.shadow' shadowJar { - classifier = '' + archiveClassifier = '' exclude 'org/apache/**' exclude 'Log4j*' @@ -43,6 +43,13 @@ productionProjects*.with { relocate 'com.google.thirdparty', "${googleRelocationPackage}.thirdparty" } jar.enabled = false + // we need this, since we want to publish the shadow JAR, not the original JAR -> https://docs.gradle.org/current/userguide/upgrading_version_6.html + configurations { + [apiElements, runtimeElements].each { + it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) } + it.outgoing.artifact(shadowJar) + } + } task finishArchive(dependsOn: shadowJar) {} build.dependsOn(finishArchive) diff --git a/build-steps/build-scan/build-scan.gradle b/build-steps/build-scan/build-scan.gradle deleted file mode 100644 index b12cac521d..0000000000 --- a/build-steps/build-scan/build-scan.gradle +++ /dev/null @@ -1,5 +0,0 @@ -buildScan { - publishAlwaysIf(project.hasProperty('scanBuild')) - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" -} diff --git a/build-steps/build-steps.gradle b/build-steps/build-steps.gradle index 3c9cda89e7..32487608fd 100644 --- a/build-steps/build-steps.gradle +++ b/build-steps/build-steps.gradle @@ -5,7 +5,6 @@ apply from: utilsPath('codequality/spotbugs.gradle') apply from: utilsPath('release/publish.gradle') apply from: utilsPath('license/license.gradle') apply from: utilsPath('maven-integration-test/maven-integration-test.gradle') -apply from: utilsPath('build-scan/build-scan.gradle') apply from: utilsPath('ci/ci-config.gradle') apply from: utilsPath('release/check-uploaded-artifacts.gradle') apply from: utilsPath('release/create-release-news.gradle') diff --git a/build-steps/maven-integration-test/maven-integration-test.gradle b/build-steps/maven-integration-test/maven-integration-test.gradle index 9a4b397ac0..01c3e8e2cb 100644 --- a/build-steps/maven-integration-test/maven-integration-test.gradle +++ b/build-steps/maven-integration-test/maven-integration-test.gradle @@ -197,8 +197,8 @@ def javaConfigs = [ [suffix: "java10", javaVersion: JavaVersion.VERSION_1_10, jdkProp: "java10Home"], [suffix: "java11", javaVersion: JavaVersion.VERSION_11, jdkProp: "java11Home"], [suffix: "java12", javaVersion: JavaVersion.VERSION_12, jdkProp: "java12Home"], - [suffix: "java13", javaVersion: JavaVersion.VERSION_HIGHER, jdkProp: "java13Home"], - [suffix: "java14", javaVersion: JavaVersion.VERSION_HIGHER, jdkProp: "java14Home"] + [suffix: "java13", javaVersion: JavaVersion.VERSION_13, jdkProp: "java13Home"], + [suffix: "java14", javaVersion: JavaVersion.VERSION_14, jdkProp: "java14Home"] ] javaConfigs = javaConfigs.findAll { project.hasProperty(it.jdkProp) } diff --git a/build-steps/release/expected/archunit-junit4.pom b/build-steps/release/expected/archunit-junit4.pom index 37b21bc30f..ef9388102c 100644 --- a/build-steps/release/expected/archunit-junit4.pom +++ b/build-steps/release/expected/archunit-junit4.pom @@ -1,6 +1,11 @@ + + + + + 4.0.0 com.tngtech.archunit archunit-junit4 diff --git a/build-steps/release/expected/archunit-junit5-api.pom b/build-steps/release/expected/archunit-junit5-api.pom index 997fba34a7..26bf355570 100644 --- a/build-steps/release/expected/archunit-junit5-api.pom +++ b/build-steps/release/expected/archunit-junit5-api.pom @@ -1,6 +1,11 @@ + + + + + 4.0.0 com.tngtech.archunit archunit-junit5-api diff --git a/build-steps/release/expected/archunit-junit5-engine-api.pom b/build-steps/release/expected/archunit-junit5-engine-api.pom index 0fd9f9e9af..41789c1395 100644 --- a/build-steps/release/expected/archunit-junit5-engine-api.pom +++ b/build-steps/release/expected/archunit-junit5-engine-api.pom @@ -1,6 +1,11 @@ + + + + + 4.0.0 com.tngtech.archunit archunit-junit5-engine-api diff --git a/build-steps/release/expected/archunit-junit5-engine.pom b/build-steps/release/expected/archunit-junit5-engine.pom index b2c49502ee..048dc09d8c 100644 --- a/build-steps/release/expected/archunit-junit5-engine.pom +++ b/build-steps/release/expected/archunit-junit5-engine.pom @@ -1,6 +1,11 @@ + + + + + 4.0.0 com.tngtech.archunit archunit-junit5-engine diff --git a/build-steps/release/expected/archunit-junit5.pom b/build-steps/release/expected/archunit-junit5.pom index 490e28a9a8..723c03d2cf 100644 --- a/build-steps/release/expected/archunit-junit5.pom +++ b/build-steps/release/expected/archunit-junit5.pom @@ -2,6 +2,11 @@ + + + + + 4.0.0 com.tngtech.archunit archunit-junit5 diff --git a/build-steps/release/expected/archunit.pom b/build-steps/release/expected/archunit.pom index cfc5434a12..07d7d9424e 100644 --- a/build-steps/release/expected/archunit.pom +++ b/build-steps/release/expected/archunit.pom @@ -1,6 +1,11 @@ + + + + + 4.0.0 com.tngtech.archunit archunit diff --git a/build-steps/release/publish.gradle b/build-steps/release/publish.gradle index 683c9b55a6..2aa598078f 100644 --- a/build-steps/release/publish.gradle +++ b/build-steps/release/publish.gradle @@ -15,14 +15,9 @@ releaseProjects*.with { enabled = isReleaseVersion // signing of these artifacts causes failure for snapshot versions } - task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource - } - - task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir + java { + withJavadocJar() + withSourcesJar() } // If I write @see ..., I don't want to fail my build because of a missing @param :-( @@ -34,10 +29,14 @@ releaseProjects*.with { } } - publish.dependsOn(build) - publish.doFirst { - assert !gradle.startParameter.isParallelProjectExecutionEnabled(): - 'uploading archives with parallel execution seems to lead to broken uploads in Sonatype Nexus' + tasks.withType(AbstractPublishToMaven) { + it.dependsOn(build) + } + tasks.withType(PublishToMavenRepository) { + it.doFirst { + assert !gradle.startParameter.isParallelProjectExecutionEnabled(): + 'uploading archives with parallel execution seems to lead to broken uploads in Sonatype Nexus' + } } publishing { @@ -45,8 +44,6 @@ releaseProjects*.with { mavenJava(MavenPublication) { artifactId = project.archivesBaseName from components.java - artifact tasks.sourcesJar - artifact tasks.javadocJar pom { name = app.name packaging = "jar" diff --git a/build.gradle b/build.gradle index 76c1bf1135..8a03eed039 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ plugins { - id 'com.gradle.build-scan' version '3.1.1' - id 'com.github.johnrengelman.shadow' version '5.2.0' - id 'com.github.spotbugs' version '4.0.5' + id 'com.github.johnrengelman.shadow' version '5.2.0' apply false + id 'com.github.spotbugs' version '4.0.5' apply false } def appAndSourceUrl = 'https://github.com/TNG/ArchUnit' @@ -96,7 +95,7 @@ ext { } task testJar(type: Jar) { - classifier = 'tests' + archiveClassifier = 'tests' from sourceSets.test.output } @@ -143,7 +142,7 @@ task clean { } subprojects { - apply plugin: 'java' + apply plugin: 'java-library' description createModuleDescription(rootProject.description, project) diff --git a/docs/_pages/getting-started.md b/docs/_pages/getting-started.md index ca513b6869..8ce84102bc 100644 --- a/docs/_pages/getting-started.md +++ b/docs/_pages/getting-started.md @@ -23,7 +23,7 @@ ArchUnit can be obtained from Maven Central. #### Gradle ```groovy dependencies { - testCompile 'com.tngtech.archunit:archunit:0.13.1' + testImplementation 'com.tngtech.archunit:archunit:0.13.1' } ``` diff --git a/docs/userguide/002_Installation.adoc b/docs/userguide/002_Installation.adoc index 7f40d157c8..71ac0c9c06 100644 --- a/docs/userguide/002_Installation.adoc +++ b/docs/userguide/002_Installation.adoc @@ -26,7 +26,7 @@ Maven Central: .build.gradle ---- dependencies { - testCompile 'com.tngtech.archunit:archunit-junit4:0.13.1' + testImplementation 'com.tngtech.archunit:archunit-junit4:0.13.1' } ---- @@ -54,7 +54,7 @@ from Maven Central: .build.gradle ---- dependencies { - testCompile 'com.tngtech.archunit:archunit-junit5:0.13.1' + testImplementation 'com.tngtech.archunit:archunit-junit5:0.13.1' } ---- @@ -78,7 +78,7 @@ context, include the core ArchUnit dependency from Maven Central: .build.gradle ---- dependencies { - testCompile 'com.tngtech.archunit:archunit:0.13.1' + testImplementation 'com.tngtech.archunit:archunit:0.13.1' } ---- diff --git a/docs/userguide/html/000_Index.html b/docs/userguide/html/000_Index.html index ea12382f26..cc59c1235a 100644 --- a/docs/userguide/html/000_Index.html +++ b/docs/userguide/html/000_Index.html @@ -620,7 +620,7 @@

2.1. JUnit 4

build.gradle
dependencies {
-    testCompile 'com.tngtech.archunit:archunit-junit4:0.13.1'
+    testImplementation 'com.tngtech.archunit:archunit-junit4:0.13.1'
 }
@@ -650,7 +650,7 @@

2.2. JUnit 5

build.gradle
dependencies {
-    testCompile 'com.tngtech.archunit:archunit-junit5:0.13.1'
+    testImplementation 'com.tngtech.archunit:archunit-junit5:0.13.1'
 }
@@ -676,7 +676,7 @@

build.gradle
dependencies {
-   testCompile 'com.tngtech.archunit:archunit:0.13.1'
+   testImplementation 'com.tngtech.archunit:archunit:0.13.1'
 }
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf016..f3d88b1c2f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5028f28f8e..a4b4429748 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 83f2acfdc3..2fe81a7d95 100755 --- a/gradlew +++ b/gradlew @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 9618d8d960..24467a141f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,100 +1,100 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle index 01784cef16..7dbee14b3a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,7 @@ +plugins { + id "com.gradle.enterprise" version "3.1.1" +} + include 'archunit', 'archunit-example', 'archunit-integration-test', 'archunit-junit', 'archunit-junit4', 'archunit-junit5-api','archunit-junit5-engine-api','archunit-junit5-engine', 'archunit-junit5', 'archunit-example:example-plain', 'archunit-example:example-junit4', 'archunit-example:example-junit5' @@ -7,3 +11,10 @@ project(':archunit-junit5-api').projectDir = file('archunit-junit/junit5/api') project(':archunit-junit5-engine-api').projectDir = file('archunit-junit/junit5/engine-api') project(':archunit-junit5-engine').projectDir = file('archunit-junit/junit5/engine') project(':archunit-junit5').projectDir = file('archunit-junit/junit5/aggregator') + +gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + } +} \ No newline at end of file