Skip to content

Commit cf7602c

Browse files
authored
Merge pull request #508 from diffplug/feat/remove-build-cruft
Cleanup the build
2 parents a715a30 + feaf747 commit cf7602c

File tree

12 files changed

+43
-107
lines changed

12 files changed

+43
-107
lines changed

.ci/ci.sh

-14
This file was deleted.

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ before_install:
88
- bash -c "$(curl -fsSL https://raw.githubusercontent.com/ZacSweers/check-gradle-checksums/c8dc2ae0756a8041e240cdc6fa6c38c256dfeab0/check-gradle-checksums.sh)"
99
install: true
1010
script:
11-
- ./.ci/ci.sh
11+
- ./gradlew build --build-cache && ./gradlew npmTest --build-cache
1212
before_cache:
1313
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
14-
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
1514
- rm -fr plugin-maven/build/localMavenRepository/com/diffplug/spotless/
1615
cache:
1716
directories:
18-
- $HOME/.gradle/caches/
17+
- $HOME/.gradle/caches/modules-2/
1918
- $HOME/.gradle/wrapper/
2019
- $HOME/.m2/
2120
- plugin-maven/build/localMavenRepository/

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1212
## [Unreleased]
1313
### Changed
1414
* All `CHANGES.md` are now in keepachangelog format. ([#507](https://github.com/diffplug/spotless/pull/507))
15+
* We now use [javadoc.io](https://javadoc.io/) instead of github pages. ([#508](https://github.com/diffplug/spotless/pull/508))
16+
* We no longer publish `-SNAPSHOT` for every build to `master`, since we have good [JitPack integration](https://github.com/diffplug/spotless/blob/master/CONTRIBUTING.md#gradle---any-commit-in-a-public-github-repo-this-one-or-any-fork). ([#508](https://github.com/diffplug/spotless/pull/508))
1517

1618
## [1.27.0] - 2020-01-01
1719
* Ignored `KtLintStepTest`, because [gradle/gradle#11752](https://github.com/gradle/gradle/issues/11752) is causing too many CI failures. ([#499](https://github.com/diffplug/spotless/pull/499))

build.gradle

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ plugins {
99
id 'com.jfrog.bintray' version '1.8.4' apply false
1010
// https://github.com/mnlipp/jdrupes-mdoclet/releases
1111
id 'org.jdrupes.mdoclet' version '1.0.5' apply false
12-
// https://github.com/ajoberstar/gradle-git-publish/releases
13-
id 'org.ajoberstar.git-publish' version '2.1.1' apply false
1412
// https://github.com/spotbugs/spotbugs/releases
1513
id "com.github.spotbugs" version "2.0.0" apply false
1614
}

gradle.properties

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name=spotless
22
description=Spotless - keep your code spotless with Gradle
33
org=diffplug
44

5-
org.gradle.parallel=false
6-
75
group=com.diffplug.spotless
86

97
versionLib=1.28.0-SNAPSHOT

gradle/java-publish.gradle

+7-33
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ javadoc {
3737
options.linksOffline('https://docs.oracle.com/javase/8/docs/api/', '../gradle/javadoc/java8')
3838
options.linksOffline('https://docs.gradle.org/2.14/javadoc/', '../gradle/javadoc/gradle')
3939

40-
// put the javadoc into a central location
41-
destinationDir rootProject.file("javadoc-publish/build/javadoc/${project.ext.artifactId}/${version_str}")
4240
// links to javadoc from the other versions
43-
options.linksOffline("https://diffplug.github.io/spotles/javadoc/${project.artifactIdLib}/${version_str}/", "../gradle/javadoc/${project.artifactIdLib}")
44-
options.linksOffline("https://diffplug.github.io/spotles/javadoc/${project.artifactIdLibExtra}/${version_str}/", "../gradle/javadoc/${project.artifactIdLibExtra}")
41+
options.linksOffline("https://diffplug.github.io/spotless/javadoc/${project.artifactIdLib}/${version_str}/", "../gradle/javadoc/${project.artifactIdLib}")
42+
options.linksOffline("https://diffplug.github.io/spotless/javadoc/${project.artifactIdLibExtra}/${version_str}/", "../gradle/javadoc/${project.artifactIdLibExtra}")
4543
}
4644

4745
task javadocJar(type: Jar, dependsOn: javadoc) {
@@ -52,18 +50,6 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
5250
////////////////
5351
// PUBLISHING //
5452
////////////////
55-
ext.isSnapshot = ext.version.endsWith('-SNAPSHOT')
56-
// pulls the credentials from either the environment variable or gradle.properties
57-
def cred = {
58-
if (System.env[it] != null) {
59-
return System.env[it]
60-
} else if (project.hasProperty(it)) {
61-
return project[it]
62-
} else {
63-
return 'unknown_' + it
64-
}
65-
}
66-
6753
final MAVEN_PLUGIN_ARTIFACT_NAME = 'spotless-maven-plugin'
6854

6955
model {
@@ -121,26 +107,14 @@ model {
121107
}
122108
}
123109
}
124-
if (project.ext.isSnapshot) {
125-
// upload snapshots to oss.sonatype.org
126-
repositories {
127-
maven {
128-
url = 'https://oss.sonatype.org/content/repositories/snapshots'
129-
credentials {
130-
username = cred('nexus_user')
131-
password = cred('nexus_pass')
132-
}
133-
}
134-
}
135-
}
136110
}
137111
}
138112

139-
if (!ext.isSnapshot) {
113+
if (!version.endsWith('-SNAPSHOT')) {
140114
// upload releases to bintray and then mavenCentral
141115
bintray {
142-
user = cred('bintray_user')
143-
key = cred('bintray_pass')
116+
user = System.env['bintray_user']
117+
key = System.env['bintray_pass']
144118
publications = [
145119
'pluginMaven'
146120
]
@@ -152,8 +126,8 @@ if (!ext.isSnapshot) {
152126
version {
153127
name = project.ext.version
154128
mavenCentralSync {
155-
user = cred('nexus_user')
156-
password = cred('nexus_pass')
129+
user = System.env['nexus_user']
130+
password = System.env['nexus_pass']
157131
}
158132
}
159133
}

javadoc-publish/build.gradle

-18
This file was deleted.

plugin-gradle/CHANGES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
227227
* BREAKING CHANGE: `customReplace` and `customReplaceRegex` renamed to just `replace` and `replaceRegex`.
228228
* BREAKING CHANGE: Plugin portal ID is still `com.diffplug.gradle.spotless`, but maven coordinate has changed to `com.diffplug.spotless:spotless-plugin-gradle`.
229229
* HUGE SPEEDUP: Now supports incremental build / up-to-date-checking.
230-
+ If you are using `custom` or `customLazy`, you might want to take a look at [this javadoc](https://diffplug.github.io/spotless/javadoc/snapshot/spotless-gradle-plugin/snapshot/com/diffplug/gradle/spotless/FormatExtension.html#bumpThisNumberIfACustomStepChanges-int-).
230+
+ If you are using `custom` or `customLazy`, you might want to take a look at [this javadoc](https://javadoc.io/static/com.diffplug.spotless/spotless-plugin-gradle/3.27.0/com/diffplug/gradle/spotless/FormatExtension.html#bumpThisNumberIfACustomStepChanges-int-).
231231
* BREAKING CHANGE: `freshmark` no longer includes all project properties by default. All properties must now be added manually:
232232

233233
```gradle

plugin-gradle/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
output = [
55
link(shield('Gradle plugin', 'plugins.gradle.org', 'com.diffplug.gradle.spotless', 'blue'), 'https://plugins.gradle.org/plugin/com.diffplug.gradle.spotless'),
66
link(shield('Maven central', 'mavencentral', 'com.diffplug.gradle.spotless:spotless', 'blue'), 'https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.diffplug.spotless%22%20AND%20a%3A%22spotless-plugin-gradle%22'),
7-
link(shield('Javadoc', 'javadoc', '{{stableGradle}}', 'blue'), 'https://{{org}}.github.io/{{name}}/javadoc/spotless-plugin-gradle/{{stableGradle}}/'),
7+
link(shield('Javadoc', 'javadoc', '{{stableGradle}}', 'blue'), 'https://javadoc.io/doc/com.diffplug.spotless/spotless-plugin-gradle/{{stableGradle}}/index.html'),
88
'',
99
link(shield('Changelog', 'changelog', '{{versionGradle}}', 'brightgreen'), 'CHANGES.md'),
1010
link(image('Travis CI', 'https://travis-ci.org/{{org}}/{{name}}.svg?branch=master'), 'https://travis-ci.org/{{org}}/{{name}}'),
@@ -14,7 +14,7 @@ output = [
1414
-->
1515
[![Gradle plugin](https://img.shields.io/badge/plugins.gradle.org-com.diffplug.gradle.spotless-blue.svg)](https://plugins.gradle.org/plugin/com.diffplug.gradle.spotless)
1616
[![Maven central](https://img.shields.io/badge/mavencentral-com.diffplug.gradle.spotless%3Aspotless-blue.svg)](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.diffplug.spotless%22%20AND%20a%3A%22spotless-plugin-gradle%22)
17-
[![Javadoc](https://img.shields.io/badge/javadoc-3.27.0-blue.svg)](https://diffplug.github.io/spotless/javadoc/spotless-plugin-gradle/3.27.0/)
17+
[![Javadoc](https://img.shields.io/badge/javadoc-3.27.0-blue.svg)](https://javadoc.io/doc/com.diffplug.spotless/spotless-plugin-gradle/3.27.0/index.html)
1818

1919
[![Changelog](https://img.shields.io/badge/changelog-3.28.0--SNAPSHOT-brightgreen.svg)](CHANGES.md)
2020
[![Travis CI](https://travis-ci.org/diffplug/spotless.svg?branch=master)](https://travis-ci.org/diffplug/spotless)
@@ -23,7 +23,7 @@ output = [
2323
<!---freshmark /shields -->
2424

2525
<!---freshmark javadoc
26-
output = prefixDelimiterReplace(input, 'https://{{org}}.github.io/{{name}}/javadoc/spotless-plugin-gradle/', '/', stableGradle)
26+
output = prefixDelimiterReplace(input, 'https://javadoc.io/static/com.diffplug.spotless/spotless-plugin-gradle/', '/', stableGradle)
2727
-->
2828

2929
Spotless is a general-purpose formatting plugin used by [2,700 projects on GitHub (Jan 2020)](https://github.com/search?l=gradle&q=spotless&type=Code). It is completely à la carte, but also includes powerful "batteries-included" if you opt-in.
@@ -75,7 +75,7 @@ spotless {
7575
}
7676
```
7777

78-
Spotless can check and apply formatting to any plain-text file, using simple rules ([javadoc](https://diffplug.github.io/spotless/javadoc/spotless-plugin-gradle/3.27.0/com/diffplug/gradle/spotless/FormatExtension.html)) like those above. It also supports more powerful formatters:
78+
Spotless can check and apply formatting to any plain-text file, using simple rules ([javadoc](https://javadoc.io/static/com.diffplug.spotless/spotless-plugin-gradle/3.27.0/com/diffplug/gradle/spotless/FormatExtension.html)) like those above. It also supports more powerful formatters:
7979

8080
* Eclipse's [CDT](#eclipse-cdt) C/C++ code formatter
8181
* Eclipse's java code formatter (including style and import ordering)
@@ -607,7 +607,7 @@ spotless {
607607
}
608608
```
609609

610-
If you use `custom` or `customLazy`, you might want to take a look at [this javadoc](https://diffplug.github.io/spotless/javadoc/spotless-plugin-gradle/3.27.0/com/diffplug/gradle/spotless/FormatExtension.html#bumpThisNumberIfACustomStepChanges-int-) for a big performance win.
610+
If you use `custom` or `customLazy`, you might want to take a look at [this javadoc](https://javadoc.io/static/com.diffplug.spotless/spotless-plugin-gradle/3.27.0/com/diffplug/gradle/spotless/FormatExtension.html#bumpThisNumberIfACustomStepChanges-int-) for a big performance win.
611611

612612
See [`JavaExtension.java`](src/main/java/com/diffplug/gradle/spotless/JavaExtension.java) if you'd like to see how a language-specific set of custom rules is implemented. We'd love PR's which add support for other languages.
613613

plugin-gradle/build.gradle

+24-26
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,32 @@ task npmTest(type: Test) { useJUnit { includeCategories 'com.diffplug.spotless.c
5151
// GRADLE PLUGIN PORTAL //
5252
//////////////////////////
5353
version = project.ext.version
54-
pluginBundle {
55-
// These settings are set for the whole plugin bundle
56-
website = "https://github.com/diffplug/spotless"
57-
vcsUrl = "https://github.com/diffplug/spotless"
58-
description = project.description
54+
if (version.endsWith('-SNAPSHOT')) {
55+
publishPlugins.enabled = false
56+
} else {
57+
pluginBundle {
58+
// These settings are set for the whole plugin bundle
59+
website = "https://github.com/diffplug/spotless"
60+
vcsUrl = "https://github.com/diffplug/spotless"
61+
description = project.description
5962

60-
plugins {
61-
spotlessPlugin {
62-
id = 'com.diffplug.gradle.spotless'
63-
displayName = 'Spotless formatting plugin'
64-
tags = [
65-
'format',
66-
'style',
67-
'license',
68-
'header'
69-
]
63+
plugins {
64+
spotlessPlugin {
65+
id = 'com.diffplug.gradle.spotless'
66+
displayName = 'Spotless formatting plugin'
67+
tags = [
68+
'format',
69+
'style',
70+
'license',
71+
'header'
72+
]
73+
}
7074
}
71-
}
7275

73-
mavenCoordinates {
74-
groupId = project.group
75-
artifactId = project.artifactIdGradle
76-
version = project.ext.version
76+
mavenCoordinates {
77+
groupId = project.group
78+
artifactId = project.artifactIdGradle
79+
version = project.ext.version
80+
}
7781
}
7882
}
79-
80-
// the gradle plugin portal isn't really compatible with SNAPSHOT versions
81-
// https://discuss.gradle.org/t/uploading-snapshot-versions-to-the-plugin-portal/11347
82-
if (ext.isSnapshot) {
83-
publishPlugins.enabled = false
84-
}

plugin-maven/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!---freshmark shields
44
output = [
55
link(shield('Maven central', 'mavencentral', '{{group}}:{{artifactIdMaven}}', 'blue'), 'https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22{{group}}%22%20AND%20a%3A%22{{artifactIdMaven}}%22'),
6-
link(shield('Javadoc', 'javadoc', '{{stableMaven}}', 'blue'), 'https://{{org}}.github.io/{{name}}/javadoc/{{artifactIdMaven}}/{{stableMaven}}/'),
6+
link(shield('Javadoc', 'javadoc', '{{stableMaven}}', 'blue'), 'https://javadoc.io/doc/com.diffplug.spotless/spotless-maven-plugin/{{stableMaven}}/index.html'),
77
'',
88
link(shield('Changelog', 'changelog', '{{stableMaven}}', 'brightgreen'), 'CHANGES.md'),
99
link(image('Travis CI', 'https://travis-ci.org/{{org}}/{{name}}.svg?branch=master'), 'https://travis-ci.org/{{org}}/{{name}}'),
@@ -12,7 +12,7 @@ output = [
1212
].join('\n');
1313
-->
1414
[![Maven central](https://img.shields.io/badge/mavencentral-com.diffplug.spotless%3Aspotless--maven--plugin-blue.svg)](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.diffplug.spotless%22%20AND%20a%3A%22spotless-maven-plugin%22)
15-
[![Javadoc](https://img.shields.io/badge/javadoc-1.27.0-blue.svg)](https://diffplug.github.io/spotless/javadoc/spotless-maven-plugin/1.27.0/)
15+
[![Javadoc](https://img.shields.io/badge/javadoc-1.27.0-blue.svg)](https://javadoc.io/doc/com.diffplug.spotless/spotless-maven-plugin/1.27.0/index.html)
1616

1717
[![Changelog](https://img.shields.io/badge/changelog-1.27.0-brightgreen.svg)](CHANGES.md)
1818
[![Travis CI](https://travis-ci.org/diffplug/spotless.svg?branch=master)](https://travis-ci.org/diffplug/spotless)

settings.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ if (System.env['CI'] != null) {
2727
}
2828

2929
include 'ide' // easy dev setup
30-
include 'javadoc-publish' // publish javadoc for the various libs
3130

3231
include 'lib' // reusable library with no dependencies
3332
include 'testlib' // library for sharing test infrastructure between the projects below

0 commit comments

Comments
 (0)