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
10
10
import java.util.Properties
11
11
import java.util.concurrent.atomic.AtomicReference
12
12
import kotlin.io.path.Path
13
+ import kotlin.io.path.exists
13
14
import kotlin.io.path.inputStream
14
15
15
16
private val ref = AtomicReference <Properties >()
@@ -19,7 +20,13 @@ fun Project.localProperties(): Properties {
19
20
ref.compareAndSet(null , Properties ().apply {
20
21
val globalRootDir: String by extra
21
22
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())
23
30
})
24
31
}
25
32
Original file line number Diff line number Diff line change @@ -112,7 +112,6 @@ tasks.register<JavaExec>("runConformanceTest") {
112
112
mainClass.set(" kotlinx.rpc.protoc.gen.test.RunConformanceTestKt" )
113
113
114
114
val protoscope = localProperties().getProperty(" protoscope_path" )
115
- ? : throw GradleException (" protoscope_path property is not set. Run ./setup_protoscope.sh" )
116
115
117
116
environment(" PROTOSCOPE_PATH" , protoscope)
118
117
@@ -130,15 +129,8 @@ tasks.register<JavaExec>("runConformanceTest") {
130
129
)
131
130
132
131
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" )
142
134
}
143
135
}
144
136
}
You can’t perform that action at this time.
0 commit comments