Skip to content

Commit

Permalink
chore: fix some gradle warnings and upgrade plugins version
Browse files Browse the repository at this point in the history
  • Loading branch information
juherr committed Feb 5, 2024
1 parent e7b79a9 commit b8b71d1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build-logic/code-quality/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {

dependencies {
implementation("org.sonarqube:org.sonarqube.gradle.plugin:4.4.1.3373")
implementation("com.github.autostyle:autostyle-plugin-gradle:3.2")
implementation("com.github.autostyle:autostyle-plugin-gradle:4.0")
}

tasks.withType<KotlinCompile>().configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.gradle.api.artifacts.result.UnresolvedDependencyResult
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.kotlin.dsl.the
import java.util.*

/**
* Walks over the dependency tree and selects the first non-shaded dependencies.
Expand Down Expand Up @@ -57,7 +58,8 @@ fun Project.firstLayerDependencies(
vararg rest: Configuration,
): Configuration {
val optionalFeatures = (the<JavaPluginExtension>() as ExtensionAware).the<OptionalFeaturesExtension>()
val usageKind = usage.removePrefix("java-").capitalize()
val usageKind = usage.removePrefix("java-")
.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }

val allDependencies = configurations.create(conf.name + "${usageKind}AllDependencies") {
description = "Resolves the list of all dependencies for $usage in ${conf.name}"
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
org.gradle.parallel=true
systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true
kotlin.code.style=official
# See https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library
# Note: testng.kotlin-library.gradle.kts adds kotlin-stdlib for testImplementation
Expand All @@ -21,3 +20,7 @@ scm.url=https\://github.com/testng-team/testng.git
nexus.profile=org.testng
github.organization=testng-team
github.repository=testng

# Fix Gradle warning with sonarqube plugin v4.x
# See https://community.sonarsource.com/t/sonarscanner-for-gradle-you-can-now-decide-when-to-compile/102069
systemProp.sonar.gradle.skipCompile=true
4 changes: 2 additions & 2 deletions testng-test-osgi/testng-test-osgi-build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ val depDir = layout.buildDirectory.dir("pax-dependencies")

val generateDependenciesProperties by tasks.registering(WriteProperties::class) {
description = "Generates dependencies.properties so pax-exam can use .versionAsInProject()"
setOutputFile(depDir.map { it.file("META-INF/maven/dependencies.properties") })
destinationFile.set(depDir.map { it.file("META-INF/maven/dependencies.properties") })
property("groupId", project.group)
property("artifactId", project.name)
property("version", project.version)
Expand All @@ -49,7 +49,7 @@ val generateDependenciesProperties by tasks.registering(WriteProperties::class)
configurations.testRuntimeClasspath.get().resolvedConfiguration.resolvedArtifacts.forEach {
val prefix = "${it.moduleVersion.id.group}/${it.moduleVersion.id.name}"
property("$prefix/scope", "compile")
property("$prefix/type", it.extension)
property("$prefix/type", it.extension.orEmpty())
property("$prefix/version", it.moduleVersion.id.version)
}
}
Expand Down

0 comments on commit b8b71d1

Please sign in to comment.