diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..425da01 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,17 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Check with Gradle + run: ./gradlew check --info diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..da87e8d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Check with Gradle + run: ./gradlew check --info -Pversion=${{ github.event.release.tag_name }} + - name: Publish with Gradle to Gradle Plugins portal + run: ./gradlew publishPlugins --info -Pversion=${{ github.event.release.tag_name }} + env: + GRADLE_PORTAL_KEY: ${{ secrets.GRADLE_PORTAL_KEY }} + GRADLE_PORTAL_SECRET: ${{ secrets.GRADLE_PORTAL_SECRET }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5b8f445..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: groovy -after_success: - - test $TRAVIS_PULL_REQUEST == "false" && test "$TRAVIS_TAG" != "" && test $TRAVIS_REPO_SLUG == "augi/gradle-wartremover" && ./gradlew bintrayUpload publishPlugins -Pversion="$TRAVIS_TAG" --info diff --git a/README.md b/README.md index a0acd6a..dca2656 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# Gradle WartRemover Plugin - -[![Build Status](https://travis-ci.org/augi/gradle-wartremover.svg)](https://travis-ci.org/augi/gradle-wartremover) [ ![Download](https://api.bintray.com/packages/augi/maven/gradle-wartremover/images/download.svg) ](https://bintray.com/augi/maven/gradle-wartremover/_latestVersion) +# Gradle WartRemover Plugin [![Build](https://github.com/augi/gradle-wartremover/actions/workflows/build.yml/badge.svg)](https://github.com/augi/gradle-wartremover/actions/workflows/build.yml) Gradle plugin to apply [WartRemover](http://www.wartremover.org), the Scala linting tool. @@ -12,18 +10,12 @@ If you want to have different settings for tests then you can use the `test` blo If you don't use `test` block then all the settings is applied to all the Scala code. Usage -==================== - - buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'cz.augi:gradle-wartremover:putCurrentVersionHere' - } - } +===== +The plugin is published to [Gradle Plugins portal](https://plugins.gradle.org/plugin/cz.augi.gradle.wartremover) - apply plugin: 'wartremover' + plugins { + id 'cz.augi.gradle.wartremover' version 'putCurrentVersionHere' + } wartremover { errorWarts.add('Product') // set of warts to use - violation causes error; default is empty set @@ -37,9 +29,3 @@ Usage classPaths.add(new File("path/to/yourTestWarts").toURI().toURL().toString()) // set of files or directories to be added to the classpath if using custom warts; default settings from the block above } } - -The plugin can be also applied using [the new Gradle syntax](https://plugins.gradle.org/plugin/cz.augi.gradle.wartremover): - - plugins { - id 'cz.augi.gradle.wartremover' version 'putCurrentVersionHere' - } diff --git a/build.gradle b/build.gradle index 90cef08..fcda71e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,27 +1,15 @@ -buildscript { - repositories { - jcenter() - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' - classpath 'com.gradle.publish:plugin-publish-plugin:0.13.0' - } +plugins { + id 'java-gradle-plugin' + id 'com.gradle.plugin-publish' version '0.13.0' } +apply plugin: 'groovy' + group 'cz.augi' version = version == 'unspecified' ? 'DEVELOPER-SNAPSHOT' : version -apply plugin: 'groovy' -apply plugin: 'java' -apply plugin: 'maven' -apply plugin: 'com.jfrog.bintray' -apply plugin: "com.gradle.plugin-publish" - repositories { - jcenter() + mavenCentral() } dependencies { @@ -37,36 +25,6 @@ dependencies { sourceCompatibility = JavaVersion.VERSION_1_8 -task sourcesJar(type: Jar) { - from sourceSets.main.allSource - archiveClassifier = 'sources' -} - -artifacts { - archives sourcesJar -} - -bintray { - user = System.getenv('BINTRAY_USER') - key = System.getenv('BINTRAY_KEY') - configurations = ['archives'] - publish = true - pkg { - repo = 'maven' - name = 'gradle-wartremover' - desc = 'Gradle plugin to apply WartRemover (Scala linting tool)' - licenses = ['MIT'] - vcsUrl = 'https://github.com/augi/gradle-wartremover.git' - websiteUrl = 'https://github.com/augi/gradle-wartremover' - issueTrackerUrl = 'https://github.com/augi/gradle-wartremover/issues' - labels = ['gradle', 'scala', 'wartremover'] - version { - name = project.version - vcsTag = project.version - } - } -} - project.ext.set('gradle.publish.key', System.getenv('GRADLE_PORTAL_KEY')) project.ext.set('gradle.publish.secret', System.getenv('GRADLE_PORTAL_SECRET')) pluginBundle {