Skip to content

Commit

Permalink
Merge remote-tracking branch 'spotbugs/master' into deploy-maven-cent…
Browse files Browse the repository at this point in the history
…ral-automatically
  • Loading branch information
KengoTODA committed Aug 31, 2017
2 parents 1ea4c96 + 9a2a0fd commit a43f9b7
Show file tree
Hide file tree
Showing 10 changed files with 305 additions and 271 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ env:

# GITHUB_TOKEN value to push changes to GitHub; Currently it is ued to update gh-pages branch of spotbugs/eclipse-latest etc.
- secure: "dFmNTEiYr0XHd2Zoj95j1xqoawNIrN63pgvHwKWf5ngNkncxLukKu1nGvvt9Fbw4/Embgzvz2GRwxWJBu5//yKrUHD9ILBS78Sn8nxpba7wHE6r8k6m+u7dOeN4jEH1fzyzsniSq939S6uB8gvfhhikddh9oZzwZnMq1YVyHQaWzbcaUnom+cwndKfK+YXg5mkt5Z92uXkJjGqd36FPA3GrlGJH7kXgWhVXI7Vds2hHsX/IBG0/2ZDhKNSZ8AiaDU4g2pSBlqA7F/noFW68hpohz9AAjku2COmpK0Ojd/iE0bVclXHYzs2aZq3lvYb3gv0dTEJrcIwPlDKQZWaEV/SxX9nIOqL5Q6XeVigTmnKkivQQ/b0hMPEpeHVvipMETYVzDvFT0qatLX/gUsiLgRPilWu0imFvNY4YAPZK3UPBSL5g+/8DzDPmTMZiOqJTMuMr+r/c7ch8qfjoaibc6LqUSJYLxyfk3NeturoviPLiBBtoadNsLPddtsNE8MZhr9lwRefNXY/VPBUxi7Bpxo7KfZ0BDSTzKeW7AEm/9E4CDmbd25eYGdvfVFeElGt5iTAfwIBYhj/GDkqnjesNCyDeNry/NywnEigkZQ4gzIvkHDkevUFs19nSspBmxiK82doY/j9Q0/TAK30mIdhg8VQwmkq5AYVIcN8kCu8WBhxw="
# GRADLE_PUBLISH_KEY value
- secure: "lZc3FKJlHOKrtYJp2Tc+SDLTye5vip0Hp2jpLj9GwxyP74DgmfzdABeptcvbfb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fdJPYVafH81Ybv+Fd5GQX59Q5GIQs2IYFZ7312wzRswFfy5j1Hn74cnQWInxtbn7SXVaRj5CswEFearua38KDjkrx0GY1pt3ypbjf//kkgPmjRj8PRtPe/SEuZvCWlqBOym8QkZ2mIhiPn+pz6RO+mNRll5bmAaOtHLLkcIziMuFD7fi1YrCtCuY3PKiW0Xt7NHQQlD+y6X3RK2qsV8txPGXZz3F2Cnk9GvJepQv14hbc8OKPtJdJG/2uaLUuDg="
matrix:
- JDK_FOR_TEST=oraclejdk8
# - JDK_FOR_TEST=oraclejdk9
Expand Down Expand Up @@ -94,6 +98,12 @@ deploy:
on:
branch: master
condition: "$JDK_FOR_TEST = oraclejdk8"
- provider: script
skip_cleanup: true
script: ./gradlew publishPlugins -Pgradle.publish.key="$GRADLE_PUBLISH_KEY" -Pgradle.publish.secret="$GRADLE_PUBLISH_SECRET"
on:
tags: true
condition: "$JDK_FOR_TEST = oraclejdk8"
- provider: script
skip_cleanup: true
script: ./gradlew uploadArchives -PossrhUsername="$SONATYPE_USERNAME" -PossrhPassword="$SONATYPE_PASSWORD" -Psigning.keyId="$SIGNING_KEY_ID" -Psigning.password="$SIGNING_PASSWORD" -Psigning.secretKeyRingFile="$TRAVIS_BUILD_DIR/secring.gpg"
Expand Down
4 changes: 3 additions & 1 deletion RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ If you need to update [entry at Eclipse Marketplace](https://marketplace.eclipse

## Release to Gradle Plugin Portal

Add necessary properties to `~/.gradle/gradle.properties` and run `./gradlew publishPlugins`.
No action necessary. When we push tag, the build result on Travis CI will be deployed to Gradle Plugin Portal.

See `deploy` phase in `.travis.yml` for detail.

## Update installation manual

Expand Down
5 changes: 5 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: normal;
}

.rst-content pre > code {
white-space: pre;
display: block;
}
32 changes: 32 additions & 0 deletions docs/gradle.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Using the SpotBugs Gradle Plugin
================================

This chapter describes how to integrate SpotBugs into a build script for Gradle.

Use SpotBugs Gradle Plugin
--------------------------

Please follow instruction found on `official Gradle Plugin page <https://plugins.gradle.org/plugin/com.github.spotbugs>`_.

Tasks introduced by this Gradle Plugin
--------------------------------------

This Gradle Plugin introduces two tasks: `spotbugsMain` and `spotbugsTest`.

`spotbugsMain` task runs SpotBugs for your production Java source files. This task depends on `classes` task.
`spotbugsTest` task runs SpotBugs for your test Java source files. This task depends on `testClasses` task.

SpotBugs Gradle Plugin adds task dependency from `check` to these these tasks, so you can simply run ``./gradlew check`` to run SpotBugs.

Configure Gradle Plugin
-----------------------

Current version of SpotBugs Gradle Plugin uses the same way to configure. Please check the document for `FindBugsExtension <http://gradle.monochromeroad.com/docs/dsl/org.gradle.api.plugins.quality.FindBugsExtension.html>`_.

For instance, to specify the version of SpotBugs, you can configure like below:

.. code-block:: groovy
spotbugs {
toolVersion = '3.1.0-RC5'
}
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Contents
gui
eclipse
ant
gradle
filter
analysisprops
implement-plugin
Expand Down
76 changes: 76 additions & 0 deletions docs/locale/ja/LC_MESSAGES/gradle.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2016-2017, spotbugs community
# This file is distributed under the same license as the spotbugs package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2017.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: spotbugs 3.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-25 02:42+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"

#: ../../gradle.rst:2
msgid "Using the SpotBugs Gradle Plugin"
msgstr ""

#: ../../gradle.rst:4
msgid ""
"This chapter describes how to integrate SpotBugs into a build script for "
"Gradle."
msgstr ""

#: ../../gradle.rst:7
msgid "Use SpotBugs Gradle Plugin"
msgstr ""

#: ../../gradle.rst:9
msgid ""
"Please follow instruction found on `official Gradle Plugin page "
"<https://plugins.gradle.org/plugin/com.github.spotbugs>`_."
msgstr ""

#: ../../gradle.rst:12
msgid "Tasks introduced by this Gradle Plugin"
msgstr ""

#: ../../gradle.rst:14
msgid "This Gradle Plugin introduces two tasks: `spotbugsMain and `spotbugsTest."
msgstr ""

#: ../../gradle.rst:16
msgid ""
"`spotbugsMain` task runs SpotBugs for your production Java source files. "
"This task depends on `classes` task. `spotbugsTest` task runs SpotBugs "
"for your test Java source files. This task depends on `testClasses` task."
msgstr ""

#: ../../gradle.rst:19
msgid ""
"SpotBugs Gradle Plugin adds task dependency from `check` to these these "
"tasks, so you can simly run ``./gradlew check`` to run SpotBugs."
msgstr ""

#: ../../gradle.rst:22
msgid "Configure Gradle Plugin"
msgstr ""

#: ../../gradle.rst:24
msgid ""
"Current version of SpotBugs Gradle Plugin uses the same way to configure."
" Please check the document for `FindBugsExtension "
"<http://gradle.monochromeroad.com/docs/dsl/org.gradle.api.plugins.quality.FindBugsExtension.html>`_."
msgstr ""

#: ../../gradle.rst:26
msgid ""
"For instance, to specify the version of SpotBugs, you can configure like "
"below:"
msgstr ""
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ public boolean performOk() {

protected void remindAboutFullBuild() {
MessageDialogWithToggle dialog = MessageDialogWithToggle.openInformation(getShell(), "Full SpotBugs build required",
"SpotBugs analysis settings are changed." + "\nReexecute SpotBugs analysis to see updated results.",
"SpotBugs analysis settings have changed. Run SpotBugs analysis again to see updated results.",
"Do not show this warning again", false, null, null);

getPreferenceStore().setValue(FindBugsConstants.DONT_REMIND_ABOUT_FULL_BUILD, dialog.getToggleState());
Expand Down
12 changes: 11 additions & 1 deletion gradlePlugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ pluginBundle {
}
}

def spotBugsVersion = project(':spotbugs').version
task processVersionFile(type: WriteProperties) {
outputFile file('src/main/resources/spotbugs-gradle-plugin.properties')

property 'spotbugs-version', project(':spotbugs').version
property 'spotbugs-version', spotBugsVersion
}
tasks.processResources.dependsOn processVersionFile

tasks.publishPlugins.doFirst {
if (version.endsWith('-SNAPSHOT')) {
throw new StopExecutionException("Skip publishing Gradle plugin because its version is not stable: ${version}")
}
if (spotBugsVersion.endsWith('-SNAPSHOT')) {
throw new StopExecutionException("Skip publishing Gradle plugin because SpotBugs version is not stable: ${spotBugsVersion}")
}
}
Loading

0 comments on commit a43f9b7

Please sign in to comment.