Skip to content

Commit f3d5570

Browse files
committed
Fix CI setups
1 parent 6ad8fd7 commit f3d5570

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

gradle-conventions/src/main/kotlin/util/other/localProperties.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import org.gradle.kotlin.dsl.provideDelegate
1010
import java.util.Properties
1111
import java.util.concurrent.atomic.AtomicReference
1212
import kotlin.io.path.Path
13+
import kotlin.io.path.exists
1314
import kotlin.io.path.inputStream
1415

1516
private val ref = AtomicReference<Properties>()
@@ -19,7 +20,13 @@ fun Project.localProperties(): Properties {
1920
ref.compareAndSet(null, Properties().apply {
2021
val globalRootDir: String by extra
2122

22-
load(Path(globalRootDir, "local.properties").inputStream())
23+
val filepath = Path(globalRootDir, "local.properties")
24+
25+
if (!filepath.exists()) {
26+
return@apply
27+
}
28+
29+
load(filepath.inputStream())
2330
})
2431
}
2532

tests/protobuf-conformance/build.gradle.kts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ tasks.register<JavaExec>("runConformanceTest") {
112112
mainClass.set("kotlinx.rpc.protoc.gen.test.RunConformanceTestKt")
113113

114114
val protoscope = localProperties().getProperty("protoscope_path")
115-
?: throw GradleException("protoscope_path property is not set. Run ./setup_protoscope.sh")
116115

117116
environment("PROTOSCOPE_PATH", protoscope)
118117

@@ -130,15 +129,8 @@ tasks.register<JavaExec>("runConformanceTest") {
130129
)
131130

132131
doFirst {
133-
if (!File(protoscope).exists()) {
134-
throw GradleException(
135-
"""
136-
Protoscope is not found. Use the following command to install it:
137-
138-
$ brew install go
139-
$ go install github.com/protocolbuffers/protoscope/cmd/protoscope...@latest
140-
""".trimIndent()
141-
)
132+
if (protoscope == null || !File(protoscope).exists()) {
133+
throw GradleException("protoscope_path property is not set. Run ./setup_protoscope.sh")
142134
}
143135
}
144136
}

0 commit comments

Comments
 (0)