From 53ba86ed4450641d87585533d0887144f7aee2c8 Mon Sep 17 00:00:00 2001 From: Damien Rembert Date: Mon, 26 Dec 2022 02:56:38 +0000 Subject: [PATCH 01/14] add basic vscode settings --- .vscode/settings.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..263bc6a2e3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.configuration.updateBuildConfiguration": "automatic", + "java.format.settings.url": "docs_devel/docs/assets/eclipse-formatting.xml", + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "modificationsIfAvailable", + "editor.formatOnPaste": true, +} \ No newline at end of file From 575f8c69d1ef961eabdba61e74199711c825774a Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Mon, 26 Dec 2022 03:03:43 +0000 Subject: [PATCH 02/14] copy basic sonar setup --- .github/workflows/sonarcloud.yml | 47 ++++++++++++++++++++++++++++++++ build.gradle | 13 +++++++-- gradle.properties | 1 + 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/sonarcloud.yml create mode 100644 gradle.properties diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 0000000000..6e04518357 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,47 @@ +name: SonarCloud +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: # Allows you to run this workflow manually from the Actions tab +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew jar --info + - name: Test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew test jacocoTestReport --info -Pheadless + - name: Analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew sonarqube --info \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2821c8be27..6c66645e57 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,7 @@ plugins { id 'com.diffplug.spotless' version '6.0.0' id 'com.github.ben-manes.versions' version '0.39.0' id 'ru.vyarus.mkdocs' version '3.0.0' + id "org.sonarqube" version "3.5.0.2730" } apply from: 'gradle/utils.gradle' @@ -860,8 +861,8 @@ spotbugs { tasks.findAll { it.name =~ /^spotbugs.*/ }.each { it.reports { - xml.enabled = envIsCi - html.enabled = !envIsCi + xml.enabled = true + html.enabled = true } } @@ -1125,6 +1126,14 @@ mkdocs { sourcesDir = 'docs_devel' } +sonarqube { + properties { + property "sonar.projectKey", "damien-rembert_omegat" + property "sonar.organization", "damien-rembert-all" + property "sonar.host.url", "https://sonarcloud.io" + } +} + // Allow setting the max heap size for the run task from the command line, e.g. // `gradle -PrunMaxHeapSize=1024M run` run.maxHeapSize = findProperty('runMaxHeapSize') diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000000..609a9ced23 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx4096m \ No newline at end of file From d57635b2b2610db321bf5f79847709907079be0a Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Mon, 26 Dec 2022 16:44:36 +0000 Subject: [PATCH 03/14] add paths for reports for sonar and up spotbugs --- build.gradle | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 6c66645e57..be6b884c6a 100644 --- a/build.gradle +++ b/build.gradle @@ -856,13 +856,13 @@ allprojects { } spotbugs { - reportLevel = 'high' + // reportLevel = 'high' } tasks.findAll { it.name =~ /^spotbugs.*/ }.each { it.reports { xml.enabled = true - html.enabled = true + // html.enabled = true } } @@ -1131,6 +1131,9 @@ sonarqube { property "sonar.projectKey", "damien-rembert_omegat" property "sonar.organization", "damien-rembert-all" property "sonar.host.url", "https://sonarcloud.io" + property "sonar.java.spotbugs.reportPaths", "build/reports/spotbugs/*.xmll" + property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/*.xml" + property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml" } } From 3565ecb2187b50b8cb28782f96584d7a76f35c54 Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Mon, 26 Dec 2022 16:45:02 +0000 Subject: [PATCH 04/14] add MacOS system file --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 53580add08..1fb36411aa 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ local.properties # emacs backup files *~ + +# MacOS system files +.DS_Store \ No newline at end of file From b89649eee76a665a7a72bceec181c09ce29c2c4d Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Mon, 26 Dec 2022 16:49:48 +0000 Subject: [PATCH 05/14] remove build and use check --- .github/workflows/sonarcloud.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 6e04518357..c8485676cf 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -30,16 +30,11 @@ jobs: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - - name: Build + - name: Test and Test Coverage env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew jar --info - - name: Test - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew test jacocoTestReport --info -Pheadless + run: ./gradlew check jacocoTestReport --info -Pheadless - name: Analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any From d697797151c484a8908ebaf7fe30dbc6660012ac Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Mon, 26 Dec 2022 17:03:57 +0000 Subject: [PATCH 06/14] use test as check fails with spotbugs --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index c8485676cf..feb9f424be 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -34,7 +34,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew check jacocoTestReport --info -Pheadless + run: ./gradlew test jacocoTestReport --info -Pheadless - name: Analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any From 7ebd20e1af2bf422726d3f393f7e2896ba340100 Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Mon, 26 Dec 2022 17:11:46 +0000 Subject: [PATCH 07/14] correct sonar details --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index be6b884c6a..1ece30b545 100644 --- a/build.gradle +++ b/build.gradle @@ -1128,8 +1128,8 @@ mkdocs { sonarqube { properties { - property "sonar.projectKey", "damien-rembert_omegat" - property "sonar.organization", "damien-rembert-all" + property "sonar.projectKey", "omegat-sonar_omegat" + property "sonar.organization", "omegat-sonar" property "sonar.host.url", "https://sonarcloud.io" property "sonar.java.spotbugs.reportPaths", "build/reports/spotbugs/*.xmll" property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/*.xml" From 259550d46bf54f070ff79df2aacec68715aa5826 Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Tue, 27 Dec 2022 11:14:38 +0000 Subject: [PATCH 08/14] restore envIsCi property and use it --- .github/workflows/sonarcloud.yml | 4 ++-- build.gradle | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index feb9f424be..dfc0b95b15 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -34,9 +34,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew test jacocoTestReport --info -Pheadless + run: ./gradlew test jacocoTestReport --info -Pheadless=true -PenvIsCi=true - name: Analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew sonarqube --info \ No newline at end of file + run: ./gradlew sonarqube -PenvIsCi=true --info \ No newline at end of file diff --git a/build.gradle b/build.gradle index 1ece30b545..d8a44a87ac 100644 --- a/build.gradle +++ b/build.gradle @@ -861,8 +861,8 @@ spotbugs { tasks.findAll { it.name =~ /^spotbugs.*/ }.each { it.reports { - xml.enabled = true - // html.enabled = true + xml.enabled = envIsCi + html.enabled = !envIsCi } } @@ -1134,6 +1134,7 @@ sonarqube { property "sonar.java.spotbugs.reportPaths", "build/reports/spotbugs/*.xmll" property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/*.xml" property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml" + property "sonar.java.source", "8" } } From ef68551f654e802b83ca8c95b8d04296fd965c52 Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Tue, 27 Dec 2022 11:16:37 +0000 Subject: [PATCH 09/14] remove unused variables --- .github/workflows/sonarcloud.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index dfc0b95b15..3f7e61d07c 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -31,9 +31,6 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - name: Test and Test Coverage - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: ./gradlew test jacocoTestReport --info -Pheadless=true -PenvIsCi=true - name: Analyze env: From 156f1e9b2cdc376c616a0bfc0a10676599b62ed5 Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Tue, 27 Dec 2022 11:22:43 +0000 Subject: [PATCH 10/14] remove headless mode for tests in GH Action --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 3f7e61d07c..1357eb8b53 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -31,7 +31,7 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - name: Test and Test Coverage - run: ./gradlew test jacocoTestReport --info -Pheadless=true -PenvIsCi=true + run: ./gradlew test jacocoTestReport --info -PenvIsCi=true - name: Analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any From 123e97dd552f32c878b3b223cb277708f9c0da81 Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Wed, 28 Dec 2022 01:10:11 +0000 Subject: [PATCH 11/14] bump JUnit to latest --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d2fbe11081..f24ecc12ce 100644 --- a/build.gradle +++ b/build.gradle @@ -198,7 +198,9 @@ dependencies { } // Test dependencies - testImplementation 'junit:junit:4.13.2' + testImplementation("org.junit.jupiter:junit-jupiter:5.9.1") + testImplementation("junit:junit:4.13.2") + testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.9.1") testImplementation 'org.xmlunit:xmlunit-legacy:2.8.3' testImplementation("org.languagetool:languagetool-server:${languageToolVersion}") { exclude group: 'org.slf4j' From 8bfdfa728591471084e465a55b2a16321d9663ac Mon Sep 17 00:00:00 2001 From: damien-rembert Date: Wed, 28 Dec 2022 01:12:45 +0000 Subject: [PATCH 12/14] restore JUnit 4 --- build.gradle | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index f24ecc12ce..d2fbe11081 100644 --- a/build.gradle +++ b/build.gradle @@ -198,9 +198,7 @@ dependencies { } // Test dependencies - testImplementation("org.junit.jupiter:junit-jupiter:5.9.1") - testImplementation("junit:junit:4.13.2") - testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.9.1") + testImplementation 'junit:junit:4.13.2' testImplementation 'org.xmlunit:xmlunit-legacy:2.8.3' testImplementation("org.languagetool:languagetool-server:${languageToolVersion}") { exclude group: 'org.slf4j' From a266e3b2004434448ff0da0acd3f75290aad381b Mon Sep 17 00:00:00 2001 From: Damien R Date: Sat, 25 Feb 2023 16:15:54 +0000 Subject: [PATCH 13/14] Create dependabot.yml --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..a35c2aa153 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gradle" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From 979fd71b4639a7952881b45927757da8ffb6cb84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 16:16:20 +0000 Subject: [PATCH 14/14] chore(deps): bump com.sun.xml.bind:jaxb-xjc from 2.3.4 to 4.0.2 Bumps com.sun.xml.bind:jaxb-xjc from 2.3.4 to 4.0.2. --- updated-dependencies: - dependency-name: com.sun.xml.bind:jaxb-xjc dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c545145b79..dae27c2da6 100644 --- a/build.gradle +++ b/build.gradle @@ -222,7 +222,7 @@ dependencies { testRuntimeOnly "org.languagetool:language-pl:${languageToolVersion}" // JAXB codegen only - jaxb 'com.sun.xml.bind:jaxb-xjc:2.3.4' + jaxb 'com.sun.xml.bind:jaxb-xjc:4.0.2' testIntegrationImplementation sourceSets.main.output, sourceSets.test.output }