Skip to content

Commit babc574

Browse files
authored
Merge pull request #428 from ZacSweers/z/modernizeBuild
Modernize build
2 parents ff5ae55 + 47192ad commit babc574

File tree

15 files changed

+48
-55
lines changed

15 files changed

+48
-55
lines changed

_ext/eclipse-base/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies {
1515
}
1616
compile("org.slf4j:slf4j-api:${VER_SLF4J}")
1717

18-
testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
18+
testImplementation("org.slf4j:slf4j-simple:${VER_SLF4J}")
1919
}
2020

2121
jar {

_ext/eclipse-cdt/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
// Required to by CCorePlugin calling PositionTrackerManager
2727
compile "org.eclipse.platform:org.eclipse.core.filebuffers:${VER_ECLISPE_PLATFORM}"
2828

29-
testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
29+
testImplementation("org.slf4j:slf4j-simple:${VER_SLF4J}")
3030
}
3131

3232

_ext/eclipse-groovy/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies {
3737
compile ("org.eclipse.platform:org.eclipse.jface.text:${VER_ECLISPE_JFACE}") {
3838
exclude group: 'org.eclipse.platform', module: 'org.eclipse.swt'
3939
}
40-
testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
40+
testImplementation("org.slf4j:slf4j-simple:${VER_SLF4J}")
4141
}
4242

4343
//////////

_ext/eclipse-wtp/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ dependencies {
7373
// Required by org.eclipse.wst.xsd.core
7474
compile "org.eclipse.xsd:org.eclipse.xsd:${VER_ECLISPE_XSD}"
7575

76-
testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
76+
testImplementation("org.slf4j:slf4j-simple:${VER_SLF4J}")
7777
}
7878

7979
jar {

_ext/gradle/java-setup.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ dependencies {
7373
compileOnly 'com.google.code.findbugs:annotations:3.0.0'
7474
compileOnly 'com.google.code.findbugs:jsr305:3.0.0'
7575

76-
testCompile 'junit:junit:4.12'
77-
testCompile 'org.assertj:assertj-core:3.5.2'
76+
testImplementation 'junit:junit:4.12'
77+
testImplementation 'org.assertj:assertj-core:3.5.2'
7878
}

build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ buildscript {
88
classpath "com.diffplug.gradle:goomph:${VER_GOOMPH}"
99
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${VER_BINTRAY}"
1010
classpath "com.gradle.publish:plugin-publish-plugin:${VER_PLUGIN_PUBLISH}"
11-
classpath "org.ajoberstar:gradle-git:${VER_GRADLE_GIT}"
11+
classpath "org.ajoberstar:gradle-git-publish:${VER_GRADLE_GIT}"
1212
classpath "ch.raffael.pegdown-doclet:pegdown-doclet:${VER_PEGDOWN_DOCLET}"
1313
classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:${VER_SPOTBUGS_PLUGIN}"
14+
classpath "com.google.guava:guava:27.1-jre" // Force newer version for spotbugs
1415
classpath "com.gradle:build-scan-plugin:${VER_BUILDSCAN_PLUGIN}"
1516
}
1617
}

gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ artifactIdGradle=spotless-plugin-gradle
2222
# Build requirements
2323
VER_JAVA=1.8
2424
VER_SPOTBUGS=3.1.6
25-
VER_SPOTBUGS_PLUGIN=1.6.2
25+
VER_SPOTBUGS_PLUGIN=2.0.0
2626
VER_BINTRAY=1.7.3
2727
VER_PLUGIN_PUBLISH=0.9.7
2828
VER_GOOMPH=3.17.4
29-
VER_GRADLE_GIT=1.7.2
29+
VER_GRADLE_GIT=2.1.1
3030
VER_PEGDOWN_DOCLET=1.3
31-
VER_BUILDSCAN_PLUGIN=1.16
31+
VER_BUILDSCAN_PLUGIN=2.0.2
3232

3333
# Used in multiple places
3434
VER_DURIAN=1.2.0

gradle/wrapper/gradle-wrapper.jar

-4 Bytes
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip

javadoc-publish/build.gradle

+13-22
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
1-
def cred = {
2-
if (System.env[it] != null) {
3-
return System.env[it]
4-
} else if (project.hasProperty(it)) {
5-
return project[it]
6-
} else {
7-
return 'unknown_' + it
8-
}
9-
}
10-
11-
apply plugin: 'org.ajoberstar.github-pages'
12-
githubPages {
1+
// https://github.com/ajoberstar/gradle-git-publish
2+
apply plugin: 'org.ajoberstar.git-publish'
3+
gitPublish {
134
repoUri = 'https://github.com/diffplug/spotless'
14-
deleteExistingFiles = false
15-
pages {
5+
branch = 'gh-pages'
6+
preserve { include '**/*' }
7+
contents {
168
from 'build/javadoc/'
179
into 'javadoc/'
1810
}
19-
credentials {
20-
username = cred('gh_token')
21-
password = ''
22-
}
11+
12+
// Credentials
13+
// GRGIT_USER environment variable or org.ajoberstar.grgit.auth.username system property.
2314
}
24-
tasks.prepareGhPages.dependsOn(":lib:javadoc")
25-
tasks.prepareGhPages.dependsOn(":lib-extra:javadoc")
26-
tasks.prepareGhPages.dependsOn(":plugin-gradle:javadoc")
27-
tasks.prepareGhPages.dependsOn(":plugin-maven:javadoc")
15+
tasks.gitPublishCopy.dependsOn(":lib:javadoc")
16+
tasks.gitPublishCopy.dependsOn(":lib-extra:javadoc")
17+
tasks.gitPublishCopy.dependsOn(":plugin-gradle:javadoc")
18+
tasks.gitPublishCopy.dependsOn(":plugin-maven:javadoc")

lib-extra/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ dependencies {
1515
compile "org.codehaus.groovy:groovy-xml:2.4.7"
1616

1717
// testing
18-
testCompile project(':testlib')
19-
testCompile "junit:junit:${VER_JUNIT}"
20-
testCompile "org.assertj:assertj-core:${VER_ASSERTJ}"
21-
testCompile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
18+
testImplementation project(':testlib')
19+
testImplementation "junit:junit:${VER_JUNIT}"
20+
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
21+
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
2222
}
2323

2424
// we'll hold the core lib to a high standard

lib/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ apply from: rootProject.file('gradle/java-publish.gradle')
66
dependencies {
77
// zero runtime reqs is a hard requirements for spotless-lib
88
// if you need a dep, put it in lib-extra
9-
testCompile "junit:junit:${VER_JUNIT}"
10-
testCompile "org.assertj:assertj-core:${VER_ASSERTJ}"
11-
testCompile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
9+
testImplementation "junit:junit:${VER_JUNIT}"
10+
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
11+
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
1212
}
1313

1414
// we'll hold the core lib to a high standard

plugin-gradle/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ dependencies {
1818
compile "com.diffplug.durian:durian-core:${VER_DURIAN}"
1919
compile "com.diffplug.durian:durian-io:${VER_DURIAN}"
2020

21-
testCompile project(':testlib')
22-
testCompile "junit:junit:${VER_JUNIT}"
23-
testCompile "org.assertj:assertj-core:${VER_ASSERTJ}"
24-
testCompile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
21+
testImplementation project(':testlib')
22+
testImplementation "junit:junit:${VER_JUNIT}"
23+
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
24+
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
2525
}
2626

2727
tasks.eclipse.dependsOn(pluginUnderTestMetadata)

plugin-maven/build.gradle

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
dependencies { classpath "com.github.spullara.mustache.java:compiler:${VER_MUSTACHE}" }
44
}
55
plugins {
6-
id 'cz.malohlava' version '1.0.3' // https://github.com/mmalohlava/gradle-visteg
6+
id 'cz.malohlava.visteg' version '1.0.5' // https://github.com/mmalohlava/gradle-visteg
77
}
88

99
// to generate taskGraph.pdf
@@ -72,15 +72,15 @@ dependencies {
7272
compileOnly "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
7373
compileOnly "org.eclipse.aether:aether-util:${VER_ECLIPSE_AETHER}"
7474

75-
testCompile project(":testlib")
76-
testCompile "junit:junit:${VER_JUNIT}"
77-
testCompile "org.assertj:assertj-core:${VER_ASSERTJ}"
78-
testCompile "org.mockito:mockito-core:${VER_MOCKITO}"
79-
testCompile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
80-
testCompile "com.github.spullara.mustache.java:compiler:${VER_MUSTACHE}"
81-
testCompile "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
82-
testCompile "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
83-
testCompile "org.codehaus.plexus:plexus-resources:${VER_PLEXUS_RESOURCES}"
75+
testImplementation project(":testlib")
76+
testImplementation "junit:junit:${VER_JUNIT}"
77+
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
78+
testImplementation "org.mockito:mockito-core:${VER_MOCKITO}"
79+
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
80+
testImplementation "com.github.spullara.mustache.java:compiler:${VER_MUSTACHE}"
81+
testImplementation "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
82+
testImplementation "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
83+
testImplementation "org.codehaus.plexus:plexus-resources:${VER_PLEXUS_RESOURCES}"
8484
}
8585

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

176-
jar.deleteAllActions()
176+
jar.setActions Arrays.asList()
177177
jar.dependsOn(runMavenBuild)
178178
jar.doLast {
179179
Files.copy(

testlib/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dependencies {
77
compile "com.diffplug.durian:durian-core:${VER_DURIAN}"
88
compile "com.diffplug.durian:durian-io:${VER_DURIAN}"
99
compile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
10+
compile "com.diffplug.durian:durian-collect:${VER_DURIAN}"
1011
compile "junit:junit:${VER_JUNIT}"
1112
compile "org.assertj:assertj-core:${VER_ASSERTJ}"
1213
compile gradleTestKit()

0 commit comments

Comments
 (0)