diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..24ea3868 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8', '11' ] + name: Java ${{ matrix.Java }} build + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: adopt + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Build with Gradle + run: ./gradlew build + - name: Cleanup Gradle Cache + # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. + # Restoring these files from a GitHub Actions cache might cause problems for future builds. + run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/.github/workflows/gradle-java8.yml b/.github/workflows/gradle-java8.yml deleted file mode 100644 index bb495fcb..00000000 --- a/.github/workflows/gradle-java8.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Java 8 - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - 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: Build with Gradle - run: ./gradlew build diff --git a/build.gradle b/build.gradle index 2988c172..a197cb64 100644 --- a/build.gradle +++ b/build.gradle @@ -23,9 +23,13 @@ plugins { } ext { + javaApi = "https://docs.oracle.com/javase/8/docs/api/" + if (JavaVersion.current() >= JavaVersion.VERSION_11) { + javaApi = "https://docs.oracle.com/en/java/javase/11/docs/api" + } javadocLinks = [ - "https://docs.oracle.com/javase/8/docs/api/", - "https://docs.spring.io/spring/docs/${springFrameworkVersion}/javadoc-api/" + javaApi, + "https://docs.spring.io/spring-framework/docs/${springFrameworkVersion}/javadoc-api/" ] as String[] } @@ -199,7 +203,7 @@ configure(staticAnalysisProjects) { apply plugin: "jacoco" checkstyle { - configFile = file("${project.rootDir}/src/checkstyle/checkstyle.xml") + configDirectory = rootProject.file("src/checkstyle") toolVersion = "${checkstyleVersion}" showViolations = true } diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index e91b2566..4cb0cc2e 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -21,12 +21,12 @@ - + - +