Skip to content

Modernize build #428

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

Merged
merged 10 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 _ext/eclipse-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
}
compile("org.slf4j:slf4j-api:${VER_SLF4J}")

testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
testImplementation("org.slf4j:slf4j-simple:${VER_SLF4J}")
}

jar {
Expand Down
2 changes: 1 addition & 1 deletion _ext/eclipse-cdt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
// Required to by CCorePlugin calling PositionTrackerManager
compile "org.eclipse.platform:org.eclipse.core.filebuffers:${VER_ECLISPE_PLATFORM}"

testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
testImplementation("org.slf4j:slf4j-simple:${VER_SLF4J}")
}


Expand Down
2 changes: 1 addition & 1 deletion _ext/eclipse-groovy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies {
compile ("org.eclipse.platform:org.eclipse.jface.text:${VER_ECLISPE_JFACE}") {
exclude group: 'org.eclipse.platform', module: 'org.eclipse.swt'
}
testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
testImplementation("org.slf4j:slf4j-simple:${VER_SLF4J}")
}

//////////
Expand Down
2 changes: 1 addition & 1 deletion _ext/eclipse-wtp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies {
// Required by org.eclipse.wst.xsd.core
compile "org.eclipse.xsd:org.eclipse.xsd:${VER_ECLISPE_XSD}"

testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
testImplementation("org.slf4j:slf4j-simple:${VER_SLF4J}")
}

jar {
Expand Down
4 changes: 2 additions & 2 deletions _ext/gradle/java-setup.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ dependencies {
compileOnly 'com.google.code.findbugs:annotations:3.0.0'
compileOnly 'com.google.code.findbugs:jsr305:3.0.0'

testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:3.5.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.5.2'
}
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ buildscript {
classpath "com.diffplug.gradle:goomph:${VER_GOOMPH}"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${VER_BINTRAY}"
classpath "com.gradle.publish:plugin-publish-plugin:${VER_PLUGIN_PUBLISH}"
classpath "org.ajoberstar:gradle-git:${VER_GRADLE_GIT}"
classpath "org.ajoberstar:gradle-git-publish:${VER_GRADLE_GIT}"
classpath "ch.raffael.pegdown-doclet:pegdown-doclet:${VER_PEGDOWN_DOCLET}"
classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:${VER_SPOTBUGS_PLUGIN}"
classpath "com.google.guava:guava:27.1-jre" // Force newer version for spotbugs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this should hopefully not be necessary anymore after Gradle 5.6 is released, which has a lot of work to properly not expose these dependencies on its classpath

classpath "com.gradle:build-scan-plugin:${VER_BUILDSCAN_PLUGIN}"
}
}
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ artifactIdGradle=spotless-plugin-gradle
# Build requirements
VER_JAVA=1.8
VER_SPOTBUGS=3.1.6
VER_SPOTBUGS_PLUGIN=1.6.2
VER_SPOTBUGS_PLUGIN=2.0.0
VER_BINTRAY=1.7.3
VER_PLUGIN_PUBLISH=0.9.7
VER_GOOMPH=3.17.4
VER_GRADLE_GIT=1.7.2
VER_GRADLE_GIT=2.1.1
VER_PEGDOWN_DOCLET=1.3
VER_BUILDSCAN_PLUGIN=1.16
VER_BUILDSCAN_PLUGIN=2.0.2

# Used in multiple places
VER_DURIAN=1.2.0
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
35 changes: 13 additions & 22 deletions javadoc-publish/build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
def cred = {
if (System.env[it] != null) {
return System.env[it]
} else if (project.hasProperty(it)) {
return project[it]
} else {
return 'unknown_' + it
}
}

apply plugin: 'org.ajoberstar.github-pages'
githubPages {
// https://github.com/ajoberstar/gradle-git-publish
apply plugin: 'org.ajoberstar.git-publish'
gitPublish {
repoUri = 'https://github.com/diffplug/spotless'
deleteExistingFiles = false
pages {
branch = 'gh-pages'
preserve { include '**/*' }
contents {
from 'build/javadoc/'
into 'javadoc/'
}
credentials {
username = cred('gh_token')
password = ''
}

// Credentials
// GRGIT_USER environment variable or org.ajoberstar.grgit.auth.username system property.
}
tasks.prepareGhPages.dependsOn(":lib:javadoc")
tasks.prepareGhPages.dependsOn(":lib-extra:javadoc")
tasks.prepareGhPages.dependsOn(":plugin-gradle:javadoc")
tasks.prepareGhPages.dependsOn(":plugin-maven:javadoc")
tasks.gitPublishCopy.dependsOn(":lib:javadoc")
tasks.gitPublishCopy.dependsOn(":lib-extra:javadoc")
tasks.gitPublishCopy.dependsOn(":plugin-gradle:javadoc")
tasks.gitPublishCopy.dependsOn(":plugin-maven:javadoc")
8 changes: 4 additions & 4 deletions lib-extra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ dependencies {
compile "org.codehaus.groovy:groovy-xml:2.4.7"

// testing
testCompile project(':testlib')
testCompile "junit:junit:${VER_JUNIT}"
testCompile "org.assertj:assertj-core:${VER_ASSERTJ}"
testCompile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
testImplementation project(':testlib')
testImplementation "junit:junit:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
}

// we'll hold the core lib to a high standard
Expand Down
6 changes: 3 additions & 3 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ apply from: rootProject.file('gradle/java-publish.gradle')
dependencies {
// zero runtime reqs is a hard requirements for spotless-lib
// if you need a dep, put it in lib-extra
testCompile "junit:junit:${VER_JUNIT}"
testCompile "org.assertj:assertj-core:${VER_ASSERTJ}"
testCompile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
testImplementation "junit:junit:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
}

// we'll hold the core lib to a high standard
Expand Down
8 changes: 4 additions & 4 deletions plugin-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ dependencies {
compile "com.diffplug.durian:durian-core:${VER_DURIAN}"
compile "com.diffplug.durian:durian-io:${VER_DURIAN}"

testCompile project(':testlib')
testCompile "junit:junit:${VER_JUNIT}"
testCompile "org.assertj:assertj-core:${VER_ASSERTJ}"
testCompile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
testImplementation project(':testlib')
testImplementation "junit:junit:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
}

tasks.eclipse.dependsOn(pluginUnderTestMetadata)
Expand Down
22 changes: 11 additions & 11 deletions plugin-maven/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
dependencies { classpath "com.github.spullara.mustache.java:compiler:${VER_MUSTACHE}" }
}
plugins {
id 'cz.malohlava' version '1.0.3' // https://github.com/mmalohlava/gradle-visteg
id 'cz.malohlava.visteg' version '1.0.5' // https://github.com/mmalohlava/gradle-visteg
}

// to generate taskGraph.pdf
Expand Down Expand Up @@ -72,15 +72,15 @@ dependencies {
compileOnly "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
compileOnly "org.eclipse.aether:aether-util:${VER_ECLIPSE_AETHER}"

testCompile project(":testlib")
testCompile "junit:junit:${VER_JUNIT}"
testCompile "org.assertj:assertj-core:${VER_ASSERTJ}"
testCompile "org.mockito:mockito-core:${VER_MOCKITO}"
testCompile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
testCompile "com.github.spullara.mustache.java:compiler:${VER_MUSTACHE}"
testCompile "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
testCompile "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
testCompile "org.codehaus.plexus:plexus-resources:${VER_PLEXUS_RESOURCES}"
testImplementation project(":testlib")
testImplementation "junit:junit:${VER_JUNIT}"
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
testImplementation "org.mockito:mockito-core:${VER_MOCKITO}"
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
testImplementation "com.github.spullara.mustache.java:compiler:${VER_MUSTACHE}"
testImplementation "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
testImplementation "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
testImplementation "org.codehaus.plexus:plexus-resources:${VER_PLEXUS_RESOURCES}"
}

task cleanMavenProjectDir(type: Delete) { delete MAVEN_PROJECT_DIR }
Expand Down Expand Up @@ -173,7 +173,7 @@ task runMavenBuild(type: Exec, dependsOn: [
commandLine mvnw("clean install -B -Dmaven.repo.local=${LOCAL_MAVEN_REPO_DIR}")
}

jar.deleteAllActions()
jar.setActions Arrays.asList()
jar.dependsOn(runMavenBuild)
jar.doLast {
Files.copy(
Expand Down
1 change: 1 addition & 0 deletions testlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
compile "com.diffplug.durian:durian-core:${VER_DURIAN}"
compile "com.diffplug.durian:durian-io:${VER_DURIAN}"
compile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
compile "com.diffplug.durian:durian-collect:${VER_DURIAN}"
compile "junit:junit:${VER_JUNIT}"
compile "org.assertj:assertj-core:${VER_ASSERTJ}"
compile gradleTestKit()
Expand Down