diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e191c3..290b1fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,9 @@ jobs: - name: Bump version id: version uses: paulhatch/semantic-version@v5.4.0 + with: + major_pattern: "(MAJOR)" + minor_pattern: "(MINOR)" - name: Create GitHub tag and release uses: softprops/action-gh-release@v2.5.0 diff --git a/README.md b/README.md index f6583aa..fc00a09 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![build](https://github.com/will-molloy/java-template/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/will-molloy/java-template/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/will-molloy/java-template/branch/main/graph/badge.svg)](https://codecov.io/gh/will-molloy/java-template) -template repo for Java (or Kotlin/Scala) Gradle projects +template repo for Java/Kotlin Gradle projects ## Features @@ -13,7 +13,6 @@ template repo for Java (or Kotlin/Scala) Gradle projects - Automatic code formatting via [Spotless](https://github.com/diffplug/spotless) - Java: [`google-java-format`](https://github.com/google/google-java-format) - Kotlin: [`ktfmt`](https://github.com/facebook/ktfmt) - - Scala: [`scalafmt`](https://github.com/scalameta/scalafmt) - Code style analysis via [Checkstyle](https://github.com/checkstyle/checkstyle) - Static analysis via [SpotBugs](https://spotbugs.github.io/) - Unit and integration test support via [JUnit 5](https://junit.org/junit5/) and [TestSets plugin](https://github.com/unbroken-dome/gradle-testsets-plugin) diff --git a/build.gradle.kts b/build.gradle.kts index 28f1d4c..221c984 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,15 +48,9 @@ allprojects { trimTrailingWhitespace() endWithNewline() } - // https://github.com/diffplug/spotless/tree/main/plugin-gradle#scala - scala { - scalafmt().configFile("$rootDir/scalafmt.conf") - trimTrailingWhitespace() - endWithNewline() - } } - // TODO Kotlin/Scala alternative? + // TODO Kotlin alternative? apply(plugin = "checkstyle") configure { toolVersion = rootProject.libs.versions.checkstyle.get() diff --git a/example-kotlin/build.gradle.kts b/example-kotlin/build.gradle.kts index b6351bf..2c458b0 100644 --- a/example-kotlin/build.gradle.kts +++ b/example-kotlin/build.gradle.kts @@ -6,7 +6,7 @@ kotlin { jvmToolchain(25) } -// TODO disabling on Kotlin/Scala atm... too many false positives +// TODO disabling on Kotlin atm... too many false positives spotbugs { ignoreFailures.set(true) } diff --git a/example-scala/build.gradle.kts b/example-scala/build.gradle.kts deleted file mode 100644 index bc5447e..0000000 --- a/example-scala/build.gradle.kts +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - scala -} - -dependencies { - implementation(libs.scala.library) -} - -// TODO disabling on Kotlin/Scala atm... too many false positives -spotbugs { - ignoreFailures.set(true) -} diff --git a/example-scala/src/main/scala/com/willmolloy/HelloScala.scala b/example-scala/src/main/scala/com/willmolloy/HelloScala.scala deleted file mode 100644 index 398272e..0000000 --- a/example-scala/src/main/scala/com/willmolloy/HelloScala.scala +++ /dev/null @@ -1,10 +0,0 @@ -package com.willmolloy - -/** Example main src. */ -object HelloScala { - - def hello(text: String): String = { - require(text.nonEmpty) - s"Hello $text, from Scala!" - } -} diff --git a/example-scala/src/test/scala/com/willmolloy/HelloScalaTest.scala b/example-scala/src/test/scala/com/willmolloy/HelloScalaTest.scala deleted file mode 100644 index 9be32aa..0000000 --- a/example-scala/src/test/scala/com/willmolloy/HelloScalaTest.scala +++ /dev/null @@ -1,13 +0,0 @@ -package com.willmolloy - -import com.google.common.truth.Truth.assertThat -import org.junit.jupiter.api.Test - -/** Unit tests for [[HelloScala]]. */ -final class HelloScalaTest { - - @Test - def test_hello(): Unit = { - assertThat(HelloScala.hello("world")).isEqualTo("Hello world, from Scala!") - } -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5955114..eae2df8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,6 @@ junit = "6.0.2" truth = "1.4.5" mockito = "5.21.0" # langs -scala = "3.7.4" kotlin = "2.3.0" # plugins spotless = "8.1.0" @@ -27,8 +26,6 @@ junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" } truth = { module = "com.google.truth:truth", version.ref = "truth" } mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" } mockito-junit = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" } -# scala -scala-library = { module = "org.scala-lang:scala3-library_3", version.ref = "scala" } [plugins] spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } diff --git a/scalafmt.conf b/scalafmt.conf deleted file mode 100644 index 0a27b31..0000000 --- a/scalafmt.conf +++ /dev/null @@ -1,4 +0,0 @@ -version = "3.8.1" # must match the version used by spotless -runner.dialect = scala3 -maxColumn = 100 -docstrings.style = Asterisk diff --git a/settings.gradle.kts b/settings.gradle.kts index d73ec06..09ecaa5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,3 @@ rootProject.name = "java-template" include("example-java") include("example-kotlin") -include("example-scala")