Skip to content

Commit

Permalink
Fix scalafix errors
Browse files Browse the repository at this point in the history
The `ignoreSourceSets` config is needed to fix errors like this:

```
Execution failed for task ':yubico-util:configSemanticDBMain'.
> Failed to calculate the value of task ':yubico-util:configSemanticDBMain' property 'scalaVersion'.
> Unable to detect the Scala version for the 'main' source set. Please ensure it declares dependency to scala-library or consider adding it to 'ignoreSourceSets'
```

The change to `project-convention-code-formatting-internal.gradle` is needed to fix this error:

```
Execution failed for task ':yubico-util-scala:compileScala'.
> Could not resolve all files for configuration ':yubico-util-scala:detachedConfiguration1'.
   > Could not find org.scalameta:semanticdb-scalac_2.13.13:4.5.5.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/org/scalameta/semanticdb-scalac_2.13.13/4.5.5/semanticdb-scalac_2.13.13-4.5.5.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the re
pository declaration.
     Required by:
         project :yubico-util-scala
```
  • Loading branch information
emlun committed Jun 3, 2024
1 parent f242370 commit 3a67ec4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ dependencies {
// Spotless dropped Java 8 support in version 2.33.0
if (JavaVersion.current().isJava11Compatible) {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
implementation("io.github.cosmicsilence:gradle-scalafix:0.1.15")
implementation("io.github.cosmicsilence:gradle-scalafix:0.2.2")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ spotless {

scalafix {
configFile.set(project.rootProject.file("scalafix.conf"))

// Work around dependency resolution issues in April 2022
semanticdb.autoConfigure.set(true)
semanticdb.version.set("4.5.5")
}

project.dependencies.scalafix("com.github.liancheng:organize-imports_2.13:0.6.0")
Expand Down
4 changes: 4 additions & 0 deletions webauthn-server-attestation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,7 @@ tasks.javadoc.configure {
// Use this instead for local testing
//(options as StandardJavadocDocletOptions).linksOffline("file://${coreJavadoc.destinationDir}", "${coreJavadoc.destinationDir}")
}

scalafix {
ignoreSourceSets.add("main")
}
4 changes: 4 additions & 0 deletions webauthn-server-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ tasks.withType(Jar::class) {
))
}
}

scalafix {
ignoreSourceSets.add("main")
}
4 changes: 4 additions & 0 deletions webauthn-server-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ for (task in listOf(tasks.installDist, tasks.distZip, tasks.distTar)) {
}
}
}

scalafix {
ignoreSourceSets.add("main")
}
4 changes: 4 additions & 0 deletions yubico-util/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ tasks.jar {
))
}
}

scalafix {
ignoreSourceSets.add("main")
}

0 comments on commit 3a67ec4

Please sign in to comment.