Skip to content

Commit 077a60d

Browse files
authored
build: run git submodule before protoc (#534)
Signed-off-by: Niels Pardon <[email protected]>
1 parent ec6e41f commit 077a60d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

build.gradle.kts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,13 @@ dependencies {
2525
compileOnly(libs.immutables.annotations)
2626
}
2727

28-
val submodulesUpdate by
29-
tasks.registering(Exec::class) {
30-
group = "Build Setup"
31-
description = "Updates (and inits) substrait git submodule"
32-
commandLine = listOf("git", "submodule", "update", "--init", "--recursive")
33-
}
34-
3528
allprojects {
3629
repositories { mavenCentral() }
3730

3831
tasks.configureEach<Test> {
3932
useJUnitPlatform()
4033
testLogging { exceptionFormat = TestExceptionFormat.FULL }
4134
}
42-
tasks.withType<JavaCompile> { dependsOn(submodulesUpdate) }
4335

4436
group = "io.substrait"
4537
version = "${version}"

core/build.gradle.kts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,15 @@ tasks.named<AntlrTask>("generateGrammarSource") {
278278
layout.buildDirectory.dir("generated/sources/antlr/main/java/io/substrait/type").get().asFile
279279
}
280280

281-
protobuf { protoc { artifact = "com.google.protobuf:protoc:" + libs.protoc.get().getVersion() } }
281+
val submodulesUpdate by
282+
tasks.registering(Exec::class) {
283+
group = "Build Setup"
284+
description = "Updates (and inits) substrait git submodule"
285+
commandLine = listOf("git", "submodule", "update", "--init", "--recursive")
286+
workingDir = rootProject.projectDir
287+
}
288+
289+
protobuf {
290+
generateProtoTasks { all().configureEach { dependsOn(submodulesUpdate) } }
291+
protoc { artifact = "com.google.protobuf:protoc:" + libs.protoc.get().getVersion() }
292+
}

0 commit comments

Comments
 (0)