File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
gradle-conventions/src/main/kotlin/util/other
tests/protobuf-conformance Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import org.gradle.kotlin.dsl.provideDelegate
1010import java.util.Properties
1111import java.util.concurrent.atomic.AtomicReference
1212import kotlin.io.path.Path
13+ import kotlin.io.path.exists
1314import kotlin.io.path.inputStream
1415
1516private 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
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments