Skip to content

Commit b37e8c6

Browse files
Add internal repo to test modules, also supply for Windows builds.
1 parent 3b68ea3 commit b37e8c6

4 files changed

Lines changed: 43 additions & 14 deletions

File tree

Jenkinsfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ pipeline {
1414

1515
environment {
1616
GITLAB_URL = credentials('gitlab_url')
17+
MVN_REPO_URL = credentials('objectbox_internal_mvn_repo_http')
18+
MVN_REPO_URL_PUBLISH = credentials('objectbox_internal_mvn_repo')
19+
MVN_REPO_LOGIN = credentials('objectbox_internal_mvn_user')
1720
}
1821

1922
options {
@@ -39,7 +42,9 @@ pipeline {
3942

4043
stage('build-java') {
4144
steps {
42-
sh './test-with-asan.sh -Dextensive-tests=true clean test ' +
45+
sh './test-with-asan.sh -Dextensive-tests=true ' +
46+
'-PinternalObjectBoxRepo=${MVN_REPO_URL} -PinternalObjectBoxRepoUser=${MVN_REPO_LOGIN_USR} -PinternalObjectBoxRepoPassword=${MVN_REPO_LOGIN_PSW} ' +
47+
'clean test ' +
4348
'--tests io.objectbox.FunctionalTestSuite ' +
4449
'--tests io.objectbox.test.proguard.ObfuscatedEntityTest ' +
4550
'--tests io.objectbox.rx.QueryObserverTest ' +
@@ -49,12 +54,11 @@ pipeline {
4954

5055
stage('upload-to-repo') {
5156
when { expression { return BRANCH_NAME != publishBranch } }
52-
environment {
53-
MVN_REPO_URL = credentials('objectbox_internal_mvn_repo')
54-
MVN_REPO_LOGIN = credentials('objectbox_internal_mvn_user')
55-
}
5657
steps {
57-
sh "./gradlew $gradleArgs -PversionPostFix=${versionPostfix} -PpreferredRepo=${MVN_REPO_URL} -PpreferredUsername=${MVN_REPO_LOGIN_USR} -PpreferredPassword=${MVN_REPO_LOGIN_PSW} uploadArchives"
58+
sh "./gradlew $gradleArgs " +
59+
"-PversionPostFix=${versionPostfix} " +
60+
"-PpreferredRepo=${MVN_REPO_URL_PUBLISH} -PpreferredUsername=${MVN_REPO_LOGIN_USR} -PpreferredPassword=${MVN_REPO_LOGIN_PSW} " +
61+
"uploadArchives"
5862
}
5963
}
6064

ci/Jenkinsfile-Windows

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ pipeline {
88

99
environment {
1010
GITLAB_URL = credentials('gitlab_url')
11+
MVN_REPO_URL = credentials('objectbox_internal_mvn_repo_http')
12+
MVN_REPO_LOGIN = credentials('objectbox_internal_mvn_user')
1113
}
1214

1315
options {
@@ -30,7 +32,9 @@ pipeline {
3032

3133
stage('build-java') {
3234
steps {
33-
bat 'gradlew cleanTest build test install'
35+
bat 'gradlew ' +
36+
'-PinternalObjectBoxRepo=${MVN_REPO_URL} -PinternalObjectBoxRepoUser=${MVN_REPO_LOGIN_USR} -PinternalObjectBoxRepoPassword=${MVN_REPO_LOGIN_PSW} ' +
37+
'cleanTest build test'
3438
}
3539
}
3640
}
@@ -43,14 +47,7 @@ pipeline {
4347
archive '**/build/reports/findbugs/*'
4448
}
4549

46-
changed {
47-
slackSend color: COLOR_MAP[currentBuild.currentResult],
48-
message: "Changed to ${currentBuild.currentResult}: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}"
49-
}
50-
5150
failure {
52-
slackSend color: "danger",
53-
message: "Failed: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}"
5451
updateGitlabCommitStatus name: 'build-windows', state: 'failed'
5552
}
5653

tests/objectbox-java-test/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ uploadArchives.enabled = false
55
targetCompatibility = '1.7'
66
sourceCompatibility = '1.7'
77

8+
// Native lib might be deployed only in internal repo
9+
if (project.hasProperty('internalObjectBoxRepo')) {
10+
println("Using internal ObjectBox repository $internalObjectBoxRepo.")
11+
maven {
12+
credentials {
13+
username project.property('internalObjectBoxRepoUser')
14+
password project.property('internalObjectBoxRepoPassword')
15+
}
16+
url internalObjectBoxRepo
17+
}
18+
} else {
19+
println "Warning: internalObjectBoxRepo, internalObjectBoxRepoUser and internalObjectBoxRepoPassword missing from gradle.properties."
20+
}
21+
822
dependencies {
923
compile project(':objectbox-java')
1024
compile 'org.greenrobot:essentials:3.0.0-RC1'

tests/test-proguard/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ uploadArchives.enabled = false
55
sourceCompatibility = 1.7
66
targetCompatibility = 1.7
77

8+
// Native lib might be deployed only in internal repo
9+
if (project.hasProperty('internalObjectBoxRepo')) {
10+
println("Using internal ObjectBox repository $internalObjectBoxRepo.")
11+
maven {
12+
credentials {
13+
username project.property('internalObjectBoxRepoUser')
14+
password project.property('internalObjectBoxRepoPassword')
15+
}
16+
url internalObjectBoxRepo
17+
}
18+
} else {
19+
println "Warning: internalObjectBoxRepo, internalObjectBoxRepoUser and internalObjectBoxRepoPassword missing from gradle.properties."
20+
}
21+
822
dependencies {
923
compile project(':objectbox-java')
1024
compile project(':objectbox-java-api')

0 commit comments

Comments
 (0)