Skip to content

Commit f8ff6c0

Browse files
Automatically update idl submodule on build #435 (#436)
* Add IDLs directory to gitignore #435 To leave the files on one place, the files coming from the submodule repository should only stay on the submodule repository and not to be included in the Java client repository. Because of this, the IDLs folder should be ignored completely. * Added initDlsSubmodule and updateDlsSubmodule task to gradle #435 In order to keep the master branch of the Dls repo up-to-date with the Java Client, the building process has to have an updated list of thrift files. * Added git to Dockerfile #435 In order to support updating submodules, the Git package has to be added to the JDK8 Alpine build image. Co-authored-by: Maxim Fateev <[email protected]>
1 parent 06174b4 commit f8ff6c0

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ target
99
/out
1010
dummy
1111
$buildDir
12+
src/main/idls/*

build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,19 @@ license {
6969
exclude 'com/uber/cadence/*.java' // generated code
7070
}
7171

72+
task initDlsSubmodule(type: Exec) {
73+
description = 'Initializes src/main/idls submodule'
74+
commandLine 'git', 'submodule', 'init'
75+
}
76+
77+
task updateDlsSubmodule(type: Exec) {
78+
dependsOn initDlsSubmodule
79+
description = 'Updates src/main/idls submodule'
80+
commandLine 'git', 'submodule', 'update'
81+
}
82+
7283
compileThrift {
84+
dependsOn updateDlsSubmodule
7385
sourceItems "src/main/idls/thrift/cadence.thrift","src/main/idls/thrift/shared.thrift"
7486

7587
nowarn true

docker/buildkite/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ ENV APACHE_THRIFT_VERSION=0.9.3
55

66
# Install dependencies using apk
77
RUN apk update && apk add --virtual wget ca-certificates wget && apk add --virtual build-dependencies build-base gcc
8+
# Git is needed in order to update the dls submodule
9+
RUN apk add --virtual git
810

911
# Compile source
1012
RUN set -ex ;\

0 commit comments

Comments
 (0)