Skip to content

Commit

Permalink
Extract convention plugins for Java and Scala language settings
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Apr 13, 2023
1 parent b025cdc commit db1d21a
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 38 deletions.
9 changes: 0 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ allprojects {
}

subprojects { project ->
tasks.withType(JavaCompile) {
options.compilerArgs += '-Xlint:unchecked'
options.deprecation = true
options.encoding = 'UTF-8'
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = ['-Wunused']
}

tasks.withType(AbstractTestTask) {
testLogging {
showStandardStreams = isCiBuild
Expand Down
14 changes: 14 additions & 0 deletions buildSrc/src/main/kotlin/project-convention-java.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
java
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(JavaCompile::class) {
options.compilerArgs.add("-Xlint:deprecation")
options.compilerArgs.add("-Xlint:unchecked")
options.encoding = "UTF-8"
}
7 changes: 7 additions & 0 deletions buildSrc/src/main/kotlin/project-convention-scala.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
scala
}

tasks.withType(ScalaCompile::class) {
scalaCompileOptions.additionalParameters = listOf("-Wunused")
}
4 changes: 0 additions & 4 deletions test-dependent-projects/build.gradle.kts

This file was deleted.

8 changes: 2 additions & 6 deletions webauthn-server-attestation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
plugins {
`java-library`
scala
id("info.solidsoft.pitest")
`project-convention-java`
`project-convention-scala`
`project-convention-lombok`
`project-convention-code-formatting`
`project-convention-archives`
Expand All @@ -10,11 +11,6 @@ plugins {

description = "Yubico WebAuthn attestation subsystem"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

sourceSets {
create("integrationTest") {
compileClasspath += sourceSets.main.get().output
Expand Down
8 changes: 2 additions & 6 deletions webauthn-server-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins {
`java-library`
scala
id("info.solidsoft.pitest")
id("me.champeau.jmh") version "0.6.8"
`project-convention-java`
`project-convention-scala`
`project-convention-lombok`
`project-convention-code-formatting`
`project-convention-archives`
Expand All @@ -11,11 +12,6 @@ plugins {

description = "Yubico WebAuthn server core API"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
api(platform(rootProject))

Expand Down
4 changes: 2 additions & 2 deletions webauthn-server-demo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
java
war
application
scala
`project-convention-java`
`project-convention-scala`
`project-convention-lombok`
`project-convention-code-formatting`
}
Expand Down
7 changes: 2 additions & 5 deletions yubico-util-scala/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
plugins {
scala
`project-convention-java`
`project-convention-scala`
`project-convention-code-formatting`
}

description = "Yubico internal Scala utilities"

java {
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
implementation(platform(rootProject))
implementation(platform(project(":test-platform")))
Expand Down
8 changes: 2 additions & 6 deletions yubico-util/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
plugins {
`java-library`
scala
id("info.solidsoft.pitest")
id("me.champeau.jmh") version "0.6.8"
`project-convention-java`
`project-convention-scala`
`project-convention-lombok`
`project-convention-code-formatting`
`project-convention-archives`
Expand All @@ -11,11 +12,6 @@ plugins {

description = "Yubico internal utilities"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
api(platform(rootProject))

Expand Down

0 comments on commit db1d21a

Please sign in to comment.