Skip to content

Commit 906e231

Browse files
Fail better and improve messages for internal repo.
1 parent 5ca4528 commit 906e231

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

build.gradle

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,34 +100,41 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
100100

101101
if (preferredRepo == 'local') {
102102
repository url: repositories.mavenLocal().url
103-
} else if (preferredRepo != null
103+
println "Uploading archives to mavenLocal()."
104+
} else if (preferredRepo != null
104105
&& project.hasProperty('preferredUsername')
105106
&& project.hasProperty('preferredPassword')) {
106107
configuration = configurations.deployerJars
108+
107109
// replace placeholders
108110
def repositoryUrl = preferredRepo
109111
.replace('__groupId__', project.group)
110112
.replace('__artifactId__', project.archivesBaseName)
111113
repository(url: repositoryUrl) {
112114
authentication(userName: preferredUsername, password: preferredPassword)
113115
}
114-
} else if (project.hasProperty('sonatypeUsername')
116+
117+
println "Uploading archives to $repositoryUrl."
118+
} else if (project.hasProperty('sonatypeUsername')
115119
&& project.hasProperty('sonatypePassword')) {
116120
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
121+
117122
def isSnapshot = version.endsWith('-SNAPSHOT')
118-
def sonatypeRepositoryUrl = isSnapshot ?
119-
"https://oss.sonatype.org/content/repositories/snapshots/"
123+
def sonatypeRepositoryUrl = isSnapshot
124+
? "https://oss.sonatype.org/content/repositories/snapshots/"
120125
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
121126
repository(url: sonatypeRepositoryUrl) {
122127
authentication(userName: sonatypeUsername, password: sonatypePassword)
123128
}
129+
130+
println "Uploading archives to $sonatypeRepositoryUrl."
124131
} else {
125-
println "Deployment settings missing/incomplete for ${project.name}."
132+
println "WARNING: preferredRepo NOT set, can not upload archives."
126133
}
127134

128135
pom.project {
129136
packaging 'jar'
130-
url 'http://objectbox.io'
137+
url 'https://objectbox.io'
131138

132139
scm {
133140
url 'https://github.com/objectbox/objectbox-java'
@@ -149,7 +156,7 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
149156

150157
organization {
151158
name 'ObjectBox Ltd.'
152-
url 'http://objectbox.io'
159+
url 'https://objectbox.io'
153160
}
154161
}
155162
}

tests/objectbox-java-test/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ targetCompatibility = JavaVersion.VERSION_1_8
88
repositories {
99
// Native lib might be deployed only in internal repo
1010
if (project.hasProperty('internalObjectBoxRepo')) {
11-
println("Using internal ObjectBox repository $internalObjectBoxRepo.")
11+
println "internalObjectBoxRepo=$internalObjectBoxRepo added to repositories."
1212
maven {
1313
credentials {
14-
username project.property('internalObjectBoxRepoUser')
15-
password project.property('internalObjectBoxRepoPassword')
14+
username internalObjectBoxRepoUser
15+
password internalObjectBoxRepoPassword
1616
}
1717
url internalObjectBoxRepo
1818
}
1919
} else {
20-
println "Warning: internalObjectBoxRepo, internalObjectBoxRepoUser and internalObjectBoxRepoPassword missing from gradle.properties."
20+
println "WARNING: Property internalObjectBoxRepo not set."
2121
}
2222
}
2323

tests/test-proguard/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ targetCompatibility = JavaVersion.VERSION_1_8
88
repositories {
99
// Native lib might be deployed only in internal repo
1010
if (project.hasProperty('internalObjectBoxRepo')) {
11-
println("Using internal ObjectBox repository $internalObjectBoxRepo.")
11+
println "internalObjectBoxRepo=$internalObjectBoxRepo added to repositories."
1212
maven {
1313
credentials {
14-
username project.property('internalObjectBoxRepoUser')
15-
password project.property('internalObjectBoxRepoPassword')
14+
username internalObjectBoxRepoUser
15+
password internalObjectBoxRepoPassword
1616
}
1717
url internalObjectBoxRepo
1818
}
1919
} else {
20-
println "Warning: internalObjectBoxRepo, internalObjectBoxRepoUser and internalObjectBoxRepoPassword missing from gradle.properties."
20+
println "WARNING: Property internalObjectBoxRepo not set."
2121
}
2222
}
2323

0 commit comments

Comments
 (0)