Skip to content

Commit cae7427

Browse files
Gradle: turn off daemon for Windows build, clean up.
1 parent 2ec9490 commit cae7427

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

Jenkinsfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
def COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
2-
31
// dev branch only: every 30 minutes at night (1:00 - 5:00)
42
String cronSchedule = BRANCH_NAME == 'dev' ? '*/30 1-5 * * *' : ''
53
String buildsToKeep = '500'
@@ -42,6 +40,7 @@ pipeline {
4240
stage('init') {
4341
steps {
4442
sh 'chmod +x gradlew'
43+
sh 'chmod +x ci/test-with-asan.sh'
4544
sh './gradlew -version'
4645

4746
// "|| true" for an OK exit code if no file is found
@@ -51,8 +50,7 @@ pipeline {
5150

5251
stage('build-java') {
5352
steps {
54-
sh "./test-with-asan.sh -Dextensive-tests=true $MVN_REPO_ARGS " +
55-
"clean test " +
53+
sh "./ci/test-with-asan.sh $gradleArgs $MVN_REPO_ARGS -Dextensive-tests=true clean test " +
5654
"--tests io.objectbox.FunctionalTestSuite " +
5755
"--tests io.objectbox.test.proguard.ObfuscatedEntityTest " +
5856
"--tests io.objectbox.rx.QueryObserverTest " +

ci/Jenkinsfile-Windows

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
def COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
2-
31
String buildsToKeep = '500'
42

3+
String gradleArgs = '-Dorg.gradle.daemon=false --stacktrace'
4+
55
// https://jenkins.io/doc/book/pipeline/syntax/
66
pipeline {
77
agent { label 'windows' }
@@ -10,6 +10,9 @@ pipeline {
1010
GITLAB_URL = credentials('gitlab_url')
1111
MVN_REPO_URL = credentials('objectbox_internal_mvn_repo_http')
1212
MVN_REPO_LOGIN = credentials('objectbox_internal_mvn_user')
13+
MVN_REPO_ARGS = "-PinternalObjectBoxRepo=$MVN_REPO_URL " +
14+
"-PinternalObjectBoxRepoUser=$MVN_REPO_LOGIN_USR " +
15+
"-PinternalObjectBoxRepoPassword=$MVN_REPO_LOGIN_PSW"
1316
}
1417

1518
options {
@@ -34,9 +37,7 @@ pipeline {
3437

3538
stage('build-java') {
3639
steps {
37-
bat "gradlew " +
38-
"-PinternalObjectBoxRepo=${MVN_REPO_URL} -PinternalObjectBoxRepoUser=${MVN_REPO_LOGIN_USR} -PinternalObjectBoxRepoPassword=${MVN_REPO_LOGIN_PSW} " +
39-
"cleanTest build test"
40+
bat "gradlew $gradleArgs $MVN_REPO_ARGS cleanTest build test"
4041
}
4142
}
4243
}

test-with-asan.sh renamed to ci/test-with-asan.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ else
2525
args=$@
2626
fi
2727
echo "Starting Gradle for target(s) \"$args\"..."
28+
pwd
2829

29-
user=$(whoami)
30-
if [[ ${user} == "jenkinsXXX-DISABLED-TO-TEST" ]]; then
31-
echo "WARNING!! USING GRADLE DAEMON ON JENKINS (VS. ASAN)"
32-
LD_PRELOAD=${ASAN_LIB_SO} ./gradlew --stacktrace ${args}
33-
else
34-
echo "Starting Gradle without daemon"
35-
LD_PRELOAD=${ASAN_LIB_SO} ./gradlew -Dorg.gradle.daemon=false --stacktrace ${args}
36-
fi
30+
LD_PRELOAD=${ASAN_LIB_SO} ./gradlew ${args}

0 commit comments

Comments
 (0)