From c262f18b5b4c5471cedfff26bcd9790dfd73bdc4 Mon Sep 17 00:00:00 2001 From: Andre White Date: Thu, 21 Sep 2023 15:58:13 -0600 Subject: [PATCH 1/3] :art: fix syntax (escape *) --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 2f9a83ff..1fa2b3a0 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -33,7 +33,7 @@ lint: - linters: [ALL] paths: - incubating/** - - **/gradlew + - "**/gradlew" runtimes: enabled: - go@1.21.0 From 7338cffd6307d1aee761a9951799667a73cb9063 Mon Sep 17 00:00:00 2001 From: Andre White Date: Thu, 21 Sep 2023 16:47:07 -0600 Subject: [PATCH 2/3] :art: debug CI builds Gradle workflow was using jdk 11. Bumped to 17. --- .github/workflows/gradle.yml | 29 ++++++++---------------- fixle.sh | 44 ------------------------------------ gradle.properties | 5 ++-- 3 files changed, 12 insertions(+), 66 deletions(-) delete mode 100755 fixle.sh diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 5beac4d3..27eddc8a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -13,24 +13,13 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 11 - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Run test and Coverage + uses: gradle/gradle-build-action@v2 + with: gradle-version: wrapper - arguments: build --scan - - name: Run test and Coverage - uses: gradle/gradle-build-action@v2 - with: - gradle-version: wrapper - arguments: reportScoverage aggregateAllTestReports - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - name: codecov-umbrella # optional - verbose: true # optional (default = false) \ No newline at end of file + arguments: reportScoverage aggregateAllTestReports -no-daemon diff --git a/fixle.sh b/fixle.sh deleted file mode 100755 index 3f5be0ef..00000000 --- a/fixle.sh +++ /dev/null @@ -1,44 +0,0 @@ -##################### -# -# Use this with or without the .gitattributes snippet with this Gist -# create a fixle.sh file, paste this in and run it. -# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF) -# This Gist normalizes handling by forcing everything to use Unix style. -##################### - -# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF -# Taken largely from: https://help.github.com/articles/dealing-with-line-endings/ -# With the exception that we are forcing LF instead of converting to windows style. - -#Set LF as your line ending default. -git config --global core.eol lf - -#Set autocrlf to false to stop converting between windows style (CRLF) and Unix style (LF) -git config --global core.autocrlf false - -#Save your current files in Git, so that none of your work is lost. -git add . -u -git commit -m "Saving files before refreshing line endings" - -#Remove the index and force Git to rescan the working directory. -rm .git/index - -#Rewrite the Git index to pick up all the new line endings. -git reset - -#Show the rewritten, normalized files. - -git status - -#Add all your changed files back, and prepare them for a commit. This is your chance to inspect which files, if any, were unchanged. - -git add -u -# It is perfectly safe to see a lot of messages here that read -# "warning: CRLF will be replaced by LF in file." - -#Rewrite the .gitattributes file. -git add .gitattributes - -#Commit the changes to your repository. - -git commit -m "Normalize all the line endings" diff --git a/gradle.properties b/gradle.properties index 9eae84ca..82823c41 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,8 +16,9 @@ # limitations under the License. # -sonar.projectKey=truthencode_ddo-calc -sonar.organization=truthencode +systemProp.sonar.projectKey=truthencode_ddo-calc +systemProp.sonar.organization=truthencode + defaultJavaToolChainVersion=17 # foojay From 247c35bbd9f2fa4008758ac12dcee6970c36e735 Mon Sep 17 00:00:00 2001 From: Andre White Date: Thu, 21 Sep 2023 19:34:31 -0600 Subject: [PATCH 3/3] :green_heart: Sonar specifying legacy junit reports and output location. --- build-logic/src/main/kotlin/code-quality.gradle.kts | 9 +-------- .../kotlin/djaxonomy.test-conventions.gradle.kts | 12 ++++++++++++ build.gradle.kts | 12 ++++++++++++ gradle.properties | 6 ++---- gradle/libs.versions.toml | 13 +++++++------ settings.gradle.kts | 2 ++ 6 files changed, 36 insertions(+), 18 deletions(-) diff --git a/build-logic/src/main/kotlin/code-quality.gradle.kts b/build-logic/src/main/kotlin/code-quality.gradle.kts index afcdba52..51cf9e1d 100644 --- a/build-logic/src/main/kotlin/code-quality.gradle.kts +++ b/build-logic/src/main/kotlin/code-quality.gradle.kts @@ -56,7 +56,7 @@ fun walkBack( fileName: String, recurse: Recursion, proj: Project = project.rootProject, -): java.io.File? { +): File? { val f = proj.file(fileName) return if (f.exists()) { f @@ -143,10 +143,3 @@ configure { } } -sonar { - properties { - property("sonar.projectKey", "truthencode_ddo-calc") - property("sonar.organization", "truthencode") - property("sonar.host.url", "https://sonarcloud.io") - } -} \ No newline at end of file diff --git a/build-logic/src/main/kotlin/djaxonomy.test-conventions.gradle.kts b/build-logic/src/main/kotlin/djaxonomy.test-conventions.gradle.kts index a510683e..727a3531 100644 --- a/build-logic/src/main/kotlin/djaxonomy.test-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/djaxonomy.test-conventions.gradle.kts @@ -28,8 +28,16 @@ plugins { tasks.withType(Test::class.java) { systemProperties["concordion.output.dir"] = "${reporting.baseDir}/tests" + val outputDir = reports.junitXml.outputLocation + jvmArgumentProviders.add(CommandLineArgumentProvider { + mutableListOf( + "-Djunit.platform.reporting.open.xml.enabled=false", // Legacy format for sonar + "-Djunit.platform.reporting.output.dir=${outputDir.get().asFile.absolutePath}" + ) + }) } + val libs = the() val extension = project.extensions.create("KotlinTestKits") @@ -37,6 +45,10 @@ extension.useKotlinTestKit.convention( KotlinTestKits.KoTest, ) +dependencies { + testRuntimeOnly(libs.junit.platform.reporting) +} + fun JvmTestSuite.applyKoTest() { val koTestVersion: String = (findProperty("koTestVersion") ?: embeddedKotlinVersion).toString() diff --git a/build.gradle.kts b/build.gradle.kts index f4dc2c16..d53682b1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,6 +16,7 @@ * limitations under the License. */ import com.mooltiverse.oss.nyx.state.State + import ru.vyarus.gradle.plugin.python.task.PythonTask import java.text.SimpleDateFormat import java.util.* @@ -38,6 +39,7 @@ plugins { id("com.github.ben-manes.versions") version "0.41.0" id("nl.littlerobots.version-catalog-update") version "0.8.1" id("ru.vyarus.mkdocs") + id("org.sonarqube") // id("ru.vyarus.mkdocs") version "3.0.0" apply (false) // id ("be.vbgn.ci-detect") version "0.1.0" @@ -351,4 +353,14 @@ allprojects { // tasks.withType { // mustRunAfter(syncVersionFiles) // } +} + +sonar { + + properties { + property("sonar.projectKey", "truthencode_ddo-calc") + property("sonar.organization", "truthencode") + property("sonar.host.url", "https://sonarcloud.io") +// property() + } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 82823c41..7f098e8f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,8 +16,6 @@ # limitations under the License. # -systemProp.sonar.projectKey=truthencode_ddo-calc -systemProp.sonar.organization=truthencode defaultJavaToolChainVersion=17 @@ -90,7 +88,7 @@ concordionVersion=4.0.1 concordionExtEmbedVersion=1.2.0 concordionExtCollapseOutputVersion=1.0.0 -// flexmark markdown extensions for concordion specs +# flexmark markdown extensions for concordion specs flexmarkVersion=0.64.8 # system properties @@ -102,7 +100,7 @@ sysprop.concordion.output.dir=project.reporting.baseDir/spec # plugin configuration com.github.maiflai.gradle-scalatest.mode=append -// Junit Scalatest runner (Helmethair) +# Junit Scalatest runner (Helmethair) junitScalaTestVersion=0.1.10 # Test Configuration / Version Management diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5f2a9437..11415e33 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -64,6 +64,7 @@ junit-platform-engine = { module = "org.junit.platform:junit-platform-engine", v junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform" } junit-platform-runner = { module = "org.junit.platform:junit-platform-runner", version.ref = "junit-engine" } junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit-engine" } +junit-platform-reporting = { module = "org.junit.platform:junit-platform-reporting", version.ref = "junit-platform" } kotest-assertions-core-jvm = { module = "io.kotest:kotest-assertions-core-jvm", version.ref = "kotest" } kotest-property-jvm = { module = "io.kotest:kotest-property-jvm", version.ref = "kotest" } kotest-runner-junit-jvm = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" } @@ -103,14 +104,14 @@ wix-accord-scalatest-s213 = { module = "com.wix:accord-scalatest_2.13", version. [bundles] concordion = [ - "concordion", - "concordion-collapse-output-extension", - "concordion-embed-extension", + "concordion", + "concordion-collapse-output-extension", + "concordion-embed-extension", ] kotest = [ - "kotest-assertions-core-jvm", - "kotest-property-jvm", - "kotest-runner-junit-jvm", + "kotest-assertions-core-jvm", + "kotest-property-jvm", + "kotest-runner-junit-jvm", ] #scala-logging = ["typesafe-scala-logging-s213", "typesafe-config"] scala-wix = ["wix-accord-core-s213", "wix-accord-scalatest-s213"] diff --git a/settings.gradle.kts b/settings.gradle.kts index 9c638ec2..d7767268 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -48,6 +48,8 @@ pluginManagement { // id("net.thauvin.erik.gradle.semver") version semVerPluginVersion id("ru.vyarus.mkdocs") version "3.0.0" id("io.quarkus") version "3.3.3" + id("org.sonarqube") version "4.3.1.3277" + } repositories {