Skip to content
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

Cleanup the build #508

Merged
merged 8 commits into from
Jan 14, 2020
Merged
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
14 changes: 0 additions & 14 deletions .ci/ci.sh

This file was deleted.

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -8,14 +8,13 @@ before_install:
- bash -c "$(curl -fsSL https://raw.githubusercontent.com/ZacSweers/check-gradle-checksums/c8dc2ae0756a8041e240cdc6fa6c38c256dfeab0/check-gradle-checksums.sh)"
install: true
script:
- ./.ci/ci.sh
- ./gradlew build --build-cache && ./gradlew npmTest --build-cache
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- rm -fr plugin-maven/build/localMavenRepository/com/diffplug/spotless/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/caches/modules-2/
- $HOME/.gradle/wrapper/
- $HOME/.m2/
- plugin-maven/build/localMavenRepository/
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
## [Unreleased]
### Changed
* All `CHANGES.md` are now in keepachangelog format. ([#507](https://github.com/diffplug/spotless/pull/507))
* We now use [javadoc.io](https://javadoc.io/) instead of github pages. ([#508](https://github.com/diffplug/spotless/pull/508))
* 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))

## [1.27.0] - 2020-01-01
* 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))
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -9,8 +9,6 @@ plugins {
id 'com.jfrog.bintray' version '1.8.4' apply false
// https://github.com/mnlipp/jdrupes-mdoclet/releases
id 'org.jdrupes.mdoclet' version '1.0.5' apply false
// https://github.com/ajoberstar/gradle-git-publish/releases
id 'org.ajoberstar.git-publish' version '2.1.1' apply false
// https://github.com/spotbugs/spotbugs/releases
id "com.github.spotbugs" version "2.0.0" apply false
}
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@ name=spotless
description=Spotless - keep your code spotless with Gradle
org=diffplug

org.gradle.parallel=false

group=com.diffplug.spotless

versionLib=1.28.0-SNAPSHOT
40 changes: 7 additions & 33 deletions gradle/java-publish.gradle
Original file line number Diff line number Diff line change
@@ -37,11 +37,9 @@ javadoc {
options.linksOffline('https://docs.oracle.com/javase/8/docs/api/', '../gradle/javadoc/java8')
options.linksOffline('https://docs.gradle.org/2.14/javadoc/', '../gradle/javadoc/gradle')

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

task javadocJar(type: Jar, dependsOn: javadoc) {
@@ -52,18 +50,6 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
////////////////
// PUBLISHING //
////////////////
ext.isSnapshot = ext.version.endsWith('-SNAPSHOT')
// pulls the credentials from either the environment variable or gradle.properties
def cred = {
if (System.env[it] != null) {
return System.env[it]
} else if (project.hasProperty(it)) {
return project[it]
} else {
return 'unknown_' + it
}
}

final MAVEN_PLUGIN_ARTIFACT_NAME = 'spotless-maven-plugin'

model {
@@ -121,26 +107,14 @@ model {
}
}
}
if (project.ext.isSnapshot) {
// upload snapshots to oss.sonatype.org
repositories {
maven {
url = 'https://oss.sonatype.org/content/repositories/snapshots'
credentials {
username = cred('nexus_user')
password = cred('nexus_pass')
}
}
}
}
}
}

if (!ext.isSnapshot) {
if (!version.endsWith('-SNAPSHOT')) {
// upload releases to bintray and then mavenCentral
bintray {
user = cred('bintray_user')
key = cred('bintray_pass')
user = System.env['bintray_user']
key = System.env['bintray_pass']
publications = [
'pluginMaven'
]
@@ -152,8 +126,8 @@ if (!ext.isSnapshot) {
version {
name = project.ext.version
mavenCentralSync {
user = cred('nexus_user')
password = cred('nexus_pass')
user = System.env['nexus_user']
password = System.env['nexus_pass']
}
}
}
18 changes: 0 additions & 18 deletions javadoc-publish/build.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
@@ -227,7 +227,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
* BREAKING CHANGE: `customReplace` and `customReplaceRegex` renamed to just `replace` and `replaceRegex`.
* BREAKING CHANGE: Plugin portal ID is still `com.diffplug.gradle.spotless`, but maven coordinate has changed to `com.diffplug.spotless:spotless-plugin-gradle`.
* HUGE SPEEDUP: Now supports incremental build / up-to-date-checking.
+ 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-).
+ 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-).
* BREAKING CHANGE: `freshmark` no longer includes all project properties by default. All properties must now be added manually:

```gradle
10 changes: 5 additions & 5 deletions plugin-gradle/README.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
output = [
link(shield('Gradle plugin', 'plugins.gradle.org', 'com.diffplug.gradle.spotless', 'blue'), 'https://plugins.gradle.org/plugin/com.diffplug.gradle.spotless'),
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'),
link(shield('Javadoc', 'javadoc', '{{stableGradle}}', 'blue'), 'https://{{org}}.github.io/{{name}}/javadoc/spotless-plugin-gradle/{{stableGradle}}/'),
link(shield('Javadoc', 'javadoc', '{{stableGradle}}', 'blue'), 'https://javadoc.io/doc/com.diffplug.spotless/spotless-plugin-gradle/{{stableGradle}}/index.html'),
'',
link(shield('Changelog', 'changelog', '{{versionGradle}}', 'brightgreen'), 'CHANGES.md'),
link(image('Travis CI', 'https://travis-ci.org/{{org}}/{{name}}.svg?branch=master'), 'https://travis-ci.org/{{org}}/{{name}}'),
@@ -14,7 +14,7 @@ output = [
-->
[![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)
[![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)
[![Javadoc](https://img.shields.io/badge/javadoc-3.27.0-blue.svg)](https://diffplug.github.io/spotless/javadoc/spotless-plugin-gradle/3.27.0/)
[![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)

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

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

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 {
}
```

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:
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:

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

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.
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.

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.

50 changes: 24 additions & 26 deletions plugin-gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -51,34 +51,32 @@ task npmTest(type: Test) { useJUnit { includeCategories 'com.diffplug.spotless.c
// GRADLE PLUGIN PORTAL //
//////////////////////////
version = project.ext.version
pluginBundle {
// These settings are set for the whole plugin bundle
website = "https://github.com/diffplug/spotless"
vcsUrl = "https://github.com/diffplug/spotless"
description = project.description
if (version.endsWith('-SNAPSHOT')) {
publishPlugins.enabled = false
} else {
pluginBundle {
// These settings are set for the whole plugin bundle
website = "https://github.com/diffplug/spotless"
vcsUrl = "https://github.com/diffplug/spotless"
description = project.description

plugins {
spotlessPlugin {
id = 'com.diffplug.gradle.spotless'
displayName = 'Spotless formatting plugin'
tags = [
'format',
'style',
'license',
'header'
]
plugins {
spotlessPlugin {
id = 'com.diffplug.gradle.spotless'
displayName = 'Spotless formatting plugin'
tags = [
'format',
'style',
'license',
'header'
]
}
}
}

mavenCoordinates {
groupId = project.group
artifactId = project.artifactIdGradle
version = project.ext.version
mavenCoordinates {
groupId = project.group
artifactId = project.artifactIdGradle
version = project.ext.version
}
}
}

// the gradle plugin portal isn't really compatible with SNAPSHOT versions
// https://discuss.gradle.org/t/uploading-snapshot-versions-to-the-plugin-portal/11347
if (ext.isSnapshot) {
publishPlugins.enabled = false
}
4 changes: 2 additions & 2 deletions plugin-maven/README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<!---freshmark shields
output = [
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'),
link(shield('Javadoc', 'javadoc', '{{stableMaven}}', 'blue'), 'https://{{org}}.github.io/{{name}}/javadoc/{{artifactIdMaven}}/{{stableMaven}}/'),
link(shield('Javadoc', 'javadoc', '{{stableMaven}}', 'blue'), 'https://javadoc.io/doc/com.diffplug.spotless/spotless-maven-plugin/{{stableMaven}}/index.html'),
'',
link(shield('Changelog', 'changelog', '{{stableMaven}}', 'brightgreen'), 'CHANGES.md'),
link(image('Travis CI', 'https://travis-ci.org/{{org}}/{{name}}.svg?branch=master'), 'https://travis-ci.org/{{org}}/{{name}}'),
@@ -12,7 +12,7 @@ output = [
].join('\n');
-->
[![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)
[![Javadoc](https://img.shields.io/badge/javadoc-1.27.0-blue.svg)](https://diffplug.github.io/spotless/javadoc/spotless-maven-plugin/1.27.0/)
[![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)

[![Changelog](https://img.shields.io/badge/changelog-1.27.0-brightgreen.svg)](CHANGES.md)
[![Travis CI](https://travis-ci.org/diffplug/spotless.svg?branch=master)](https://travis-ci.org/diffplug/spotless)
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ if (System.env['CI'] != null) {
}

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

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