Skip to content

Commit dced8fa

Browse files
authored
Merge pull request #430 from diffplug/feature/buildCleanup
Feature/build cleanup
2 parents d5f8251 + 59d3ce4 commit dced8fa

File tree

11 files changed

+57
-43
lines changed

11 files changed

+57
-43
lines changed

build.gradle

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,28 @@ buildscript {
55
}
66
}
77
dependencies {
8-
classpath "com.diffplug.gradle:goomph:${VER_GOOMPH}"
9-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${VER_BINTRAY}"
10-
classpath "com.gradle.publish:plugin-publish-plugin:${VER_PLUGIN_PUBLISH}"
11-
classpath "org.ajoberstar:gradle-git-publish:${VER_GRADLE_GIT}"
12-
classpath "ch.raffael.pegdown-doclet:pegdown-doclet:${VER_PEGDOWN_DOCLET}"
138
classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:${VER_SPOTBUGS_PLUGIN}"
149
classpath "com.google.guava:guava:27.1-jre" // Force newer version for spotbugs
15-
classpath "com.gradle:build-scan-plugin:${VER_BUILDSCAN_PLUGIN}"
1610
}
1711
}
1812

19-
apply plugin: 'com.gradle.build-scan'
13+
plugins {
14+
// dependencyUpdates https://github.com/ben-manes/gradle-versions-plugin/releases
15+
id 'com.github.ben-manes.versions' version '0.22.0'
16+
// https://github.com/diffplug/goomph/blob/master/CHANGES.md
17+
id 'com.diffplug.gradle.eclipse.resourcefilters' version '3.18.0'
18+
// https://plugins.gradle.org/plugin/com.gradle.plugin-publish
19+
id 'com.gradle.plugin-publish' version '0.10.1' apply false
20+
// https://plugins.gradle.org/plugin/com.gradle.build-scan
21+
id 'com.gradle.build-scan' version '2.4'
22+
// https://github.com/bintray/gradle-bintray-plugin/releases
23+
id 'com.jfrog.bintray' version '1.8.4' apply false
24+
// https://github.com/mnlipp/jdrupes-mdoclet/releases
25+
id 'org.jdrupes.mdoclet' version '1.0.5' apply false
26+
// https://github.com/ajoberstar/gradle-git-publish/releases
27+
id 'org.ajoberstar.git-publish' version '2.1.1' apply false
28+
}
29+
2030
buildScan {
2131
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
2232
apply from: 'gradle/build-scans.gradle'

gradle.properties

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ artifactIdGradle=spotless-plugin-gradle
2323
VER_JAVA=1.8
2424
VER_SPOTBUGS=3.1.6
2525
VER_SPOTBUGS_PLUGIN=2.0.0
26-
VER_BINTRAY=1.7.3
27-
VER_PLUGIN_PUBLISH=0.9.7
28-
VER_GOOMPH=3.17.4
29-
VER_GRADLE_GIT=2.1.1
30-
VER_PEGDOWN_DOCLET=1.3
31-
VER_BUILDSCAN_PLUGIN=2.0.2
3226

3327
# Used in multiple places
3428
VER_DURIAN=1.2.0

gradle/java-publish.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def javadocInfo = '<h2>' + makeLink("https://github.com/${org}/${name}", "${grou
2323
' by ' + makeLink('https://www.diffplug.com', 'DiffPlug') + '</h2>'
2424

2525
String version_str = ext.version.endsWith('-SNAPSHOT') ? 'snapshot' : ext.version
26-
apply plugin: 'ch.raffael.pegdown-doclet'
26+
apply plugin: 'org.jdrupes.mdoclet'
2727
javadoc {
2828
// Where it's possible to name parameters and methods clearly enough
2929
// that javadoc is not necessary, why make the code bigger?

lib-extra/build.gradle

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1+
plugins {
2+
id 'java-library'
3+
}
4+
15
ext.artifactId = project.artifactIdLibExtra
26
ext.version = project.versionLib
37
apply from: rootProject.file('gradle/java-setup.gradle')
48
apply from: rootProject.file('gradle/java-publish.gradle')
59

610
dependencies {
7-
compile project(':lib')
11+
api project(':lib')
812
// misc useful utilities
9-
compile "com.diffplug.durian:durian-core:${VER_DURIAN}"
10-
compile "com.diffplug.durian:durian-collect:${VER_DURIAN}"
13+
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
14+
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
1115
// needed by GitAttributesLineEndings
12-
compile "org.eclipse.jgit:org.eclipse.jgit:5.3.2.201906051522-r"
13-
compile "com.googlecode.concurrent-trees:concurrent-trees:2.6.1"
16+
implementation "org.eclipse.jgit:org.eclipse.jgit:5.3.2.201906051522-r"
17+
implementation "com.googlecode.concurrent-trees:concurrent-trees:2.6.1"
1418
// used for xml parsing in EclipseFormatter
15-
compile "org.codehaus.groovy:groovy-xml:2.4.7"
19+
implementation "org.codehaus.groovy:groovy-xml:2.4.7"
1620

1721
// testing
1822
testImplementation project(':testlib')

lib/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
plugins {
2+
id 'java-library'
3+
}
14
ext.artifactId = project.artifactIdLib
25
ext.version = project.versionLib
36
apply from: rootProject.file('gradle/java-setup.gradle')

plugin-gradle/build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@ ext.version = project.versionGradle
33
apply from: rootProject.file('gradle/java-setup.gradle')
44
apply from: rootProject.file('gradle/java-publish.gradle')
55

6+
apply plugin: 'java-library'
67
apply plugin: 'com.gradle.plugin-publish'
78
apply plugin: 'java-gradle-plugin'
89

910
dependencies {
1011
if (!project.versionGradle.endsWith('-SNAPSHOT') && project.versionLib.endsWith('-SNAPSHOT')) {
1112
// gradle = release, lib = snapshot, therefore gradle should depend on the last stable lib
12-
compile "com.diffplug.spotless:spotless-lib:${project.stableLib}"
13-
compile "com.diffplug.spotless:spotless-lib-extra:${project.stableLib}"
13+
api "com.diffplug.spotless:spotless-lib:${project.stableLib}"
14+
api "com.diffplug.spotless:spotless-lib-extra:${project.stableLib}"
1415
} else {
15-
compile project(':lib')
16-
compile project(':lib-extra')
16+
api project(':lib')
17+
api project(':lib-extra')
1718
}
18-
compile "com.diffplug.durian:durian-core:${VER_DURIAN}"
19-
compile "com.diffplug.durian:durian-io:${VER_DURIAN}"
19+
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
20+
implementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
21+
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
2022

2123
testImplementation project(':testlib')
2224
testImplementation "junit:junit:${VER_JUNIT}"

plugin-maven/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,14 @@ dependencies {
7272
compileOnly "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"
7373
compileOnly "org.eclipse.aether:aether-util:${VER_ECLIPSE_AETHER}"
7474

75+
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
76+
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
77+
7578
testImplementation project(":testlib")
7679
testImplementation "junit:junit:${VER_JUNIT}"
7780
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
7881
testImplementation "org.mockito:mockito-core:${VER_MOCKITO}"
82+
testImplementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
7983
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
8084
testImplementation "com.github.spullara.mustache.java:compiler:${VER_MUSTACHE}"
8185
testImplementation "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
@@ -146,7 +150,6 @@ task createPomXml(dependsOn: installLocalDependencies) {
146150
mavenApiVersion : VER_MAVEN_API,
147151
eclipseAetherVersion : VER_ECLIPSE_AETHER,
148152
spotlessLibVersion : project.versionLib,
149-
plexusResourcesVersion : VER_PLEXUS_RESOURCES,
150153
additionalDependencies : additionalDependencies
151154
]
152155

plugin-maven/src/main/java/com/diffplug/spotless/maven/ArtifactResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public ArtifactResolver(RepositorySystem repositorySystem, RepositorySystemSessi
5757
this.log = Objects.requireNonNull(log);
5858
}
5959

60-
/** Use {@link ArtifactResolver#resolve(boolean, Collection)) instead.} */
60+
/** Use {@link ArtifactResolver#resolve(boolean, Collection)} instead. */
6161
@Deprecated
6262
public Set<File> resolve(String mavenCoordinate) {
6363
return resolve(true, Arrays.asList(mavenCoordinate));

plugin-maven/src/test/resources/pom-build.xml.mustache

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<maven.api.version>{{mavenApiVersion}}</maven.api.version>
2424
<eclipse.aether.version>{{eclipseAetherVersion}}</eclipse.aether.version>
2525
<spotless.lib.version>{{spotlessLibVersion}}</spotless.lib.version>
26-
<plexus.resources.version>{{plexusResourcesVersion}}</plexus.resources.version>
2726
</properties>
2827

2928
<dependencies>
@@ -51,11 +50,6 @@
5150
<version>${eclipse.aether.version}</version>
5251
<scope>provided</scope>
5352
</dependency>
54-
<dependency>
55-
<groupId>org.codehaus.plexus</groupId>
56-
<artifactId>plexus-resources</artifactId>
57-
<version>${plexus.resources.version}</version>
58-
</dependency>
5953

6054
<dependency>
6155
<groupId>com.diffplug.spotless</groupId>

testlib/build.gradle

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
plugins {
2+
id 'java-library'
3+
}
14
ext.artifactId = project.artifactIdTestLib
25
ext.version = project.versionLib
36
apply from: rootProject.file('gradle/java-setup.gradle')
47

58
dependencies {
6-
compile project(':lib')
7-
compile "com.diffplug.durian:durian-core:${VER_DURIAN}"
8-
compile "com.diffplug.durian:durian-io:${VER_DURIAN}"
9-
compile "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
10-
compile "com.diffplug.durian:durian-collect:${VER_DURIAN}"
11-
compile "junit:junit:${VER_JUNIT}"
12-
compile "org.assertj:assertj-core:${VER_ASSERTJ}"
13-
compile gradleTestKit()
9+
api project(':lib')
10+
api "com.diffplug.durian:durian-core:${VER_DURIAN}"
11+
api "com.diffplug.durian:durian-testlib:${VER_DURIAN}"
12+
api "junit:junit:${VER_JUNIT}"
13+
api "org.assertj:assertj-core:${VER_ASSERTJ}"
14+
15+
implementation "com.diffplug.durian:durian-io:${VER_DURIAN}"
16+
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
17+
implementation gradleTestKit()
1418
}
1519

1620
// we'll hold the testlib to a low standard (prize brevity)

testlib/src/main/java/com/diffplug/spotless/ResourceHarness.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class ResourceHarness {
4646
* On OS X, the temp folder is a symlink,
4747
* and some of gradle's stuff breaks symlinks.
4848
* By only accessing it through the {@link #rootFolder()}
49-
* and {@link #newFile()} apis, we can guarantee there
49+
* and {@link #newFile(String)} apis, we can guarantee there
5050
* will be no symlink problems.
5151
*/
5252
@Rule

0 commit comments

Comments
 (0)