Skip to content

Commit

Permalink
fix versions in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewparmet committed Feb 26, 2025
1 parent ce3eab8 commit ce925b0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
18 changes: 16 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,28 @@ tasks {
}

withType<KotlinCompile> {
kotlinOptions {
compilerOptions {
allWarningsAsErrors = true
}
}
}

// declare dependencies used in integration tests so that dependabot picks them up
val integrationTestingDependencies = configurations.create("integrationTestingDependencies")
dependencies {
integrationTestingDependencies(libs.androidGradlePlugin)
integrationTestingDependencies(libs.protobufGradlePlugin)
}

buildConfig {
useKotlinOutput { topLevelConstants = true }
packageName.set("build.buf.gradle")
buildConfigField("String", "DEFAULT_BUF_VERSION", "\"${libs.bufbuild.get().version}\"")
buildConfigField("String", "DEFAULT_BUF_VERSION", "\"${libs.versions.bufbuild.get()}\"")

sourceSets.getByName("test") {
buildConfigField("String", "PROTOBUF_VERSION", "\"${libs.versions.protoc.get()}\"")
buildConfigField("String", "KOTLIN_VERSION", "\"${libs.versions.kotlin.get()}\"")
buildConfigField("String", "PROTOBUF_GRADLE_PLUGIN_VERSION", "\"${libs.versions.protobufGradlePlugin.get()}\"")
buildConfigField("String", "ANDROID_GRADLE_PLUGIN_VERSION", "\"${libs.versions.androidGradlePlugin.get()}\"")
}
}
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ protoc = "4.29.3"
versioncompare = "1.5.0"

# test
androidGradlePlugin = "7.3.1"
junit = "5.11.4"
protobufGradlePlugin = "0.9.3"
truth = "1.4.4"

[plugins]
Expand All @@ -34,5 +36,7 @@ protoc = { module = "com.google.protobuf:protoc", version.ref = "protoc" }
versioncompare = { module = "io.github.g00fy2:versioncompare", version.ref = "versioncompare" }

# test
androidGradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
protobufGradlePlugin = { module = "com.google.protobuf:protobuf-gradle-plugin", version.ref = "protobufGradlePlugin" }
truth = { module = "com.google.truth:truth", version.ref = "truth" }
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ abstract class AbstractBufIntegrationTest : IntegrationTest {
.withProjectDir(projectDir)
.withPluginClasspath()
.withArguments(
"-PprotobufGradleVersion=0.9.3",
"-PprotobufVersion=3.23.4",
"-PkotlinVersion=1.7.20",
"-PandroidGradleVersion=7.3.0",
"-PprotobufGradleVersion=$PROTOBUF_GRADLE_PLUGIN_VERSION",
"-PprotobufVersion=$PROTOBUF_VERSION",
"-PkotlinVersion=$KOTLIN_VERSION",
"-PandroidGradleVersion=$ANDROID_GRADLE_PLUGIN_VERSION",
"--configuration-cache",
).withDebug(false) // Enable for interactive debugging
.let { WrappedRunner(it) }
Expand Down

0 comments on commit ce925b0

Please sign in to comment.