Skip to content

Commit db83eb6

Browse files
Merge branch 'dev-latest' into sync
2 parents 42a67b3 + 3f889f0 commit db83eb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+481
-704
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pipeline {
5454
"--tests io.objectbox.FunctionalTestSuite " +
5555
"--tests io.objectbox.test.proguard.ObfuscatedEntityTest " +
5656
"--tests io.objectbox.rx.QueryObserverTest " +
57-
"assemble"
57+
"spotbugsMain assemble"
5858
}
5959
}
6060

@@ -92,7 +92,7 @@ pipeline {
9292
always {
9393
junit '**/build/test-results/**/TEST-*.xml'
9494
archiveArtifacts artifacts: 'tests/*/hs_err_pid*.log', allowEmptyArchive: true // Only on JVM crash.
95-
// currently unused: archiveArtifacts '**/build/reports/findbugs/*'
95+
recordIssues(tool: spotBugs(pattern: '**/build/reports/spotbugs/*.xml', useRankAsPriority: true))
9696

9797
googlechatnotification url: 'id:gchat_java', message: "${currentBuild.currentResult}: ${currentBuild.fullDisplayName}\n${env.BUILD_URL}",
9898
notifyFailure: 'true', notifyUnstable: 'true', notifyBackToNormal: 'true'

build.gradle

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Just too many sub projects, so each can reference rootProject.version
2-
version = ob_version
3-
41
buildscript {
52
ext {
63
// Typically, only edit those two:
@@ -11,32 +8,40 @@ buildscript {
118
def versionPostFixValue = project.findProperty('versionPostFix')
129
def versionPostFix = versionPostFixValue ? "-$versionPostFixValue" : ''
1310
ob_version = objectboxVersionNumber + (objectboxVersionRelease? "" : "$versionPostFix-SNAPSHOT")
14-
println "ObjectBox Java version $ob_version"
15-
16-
ob_expected_version = project.hasProperty('expectedVersion') ? project.property('expectedVersion') : 'UNDEFINED'
1711

18-
// Core version for tests
12+
// Native library version for tests
1913
// Be careful to diverge here; easy to forget and hard to find JNI problems
20-
ob_native_version = objectboxVersionNumber + (objectboxVersionRelease? "": "-dev-SNAPSHOT")
21-
14+
def nativeVersion = objectboxVersionNumber + (objectboxVersionRelease? "": "-dev-SNAPSHOT")
2215
def osName = System.getProperty("os.name").toLowerCase()
23-
objectboxPlatform = osName.contains('linux') ? 'linux'
16+
def objectboxPlatform = osName.contains('linux') ? 'linux'
2417
: osName.contains("windows")? 'windows'
2518
: osName.contains("mac")? 'macos'
2619
: 'unsupported'
20+
ob_native_dep = "io.objectbox:objectbox-$objectboxPlatform:$nativeVersion"
2721

28-
objectboxNativeDependency = "io.objectbox:objectbox-$objectboxPlatform:$ob_native_version"
29-
println "ObjectBox native dependency: $objectboxNativeDependency"
22+
junit_version = '4.13'
23+
24+
println "version=$ob_version"
25+
println "objectboxNativeDependency=$ob_native_dep"
3026
}
31-
ext.junit_version = '4.13'
3227

3328
repositories {
3429
mavenCentral()
3530
jcenter()
31+
maven {
32+
url "https://plugins.gradle.org/m2/"
33+
}
34+
}
35+
36+
dependencies {
37+
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.5"
3638
}
3739
}
3840

3941
allprojects {
42+
group = 'io.objectbox'
43+
version = ob_version
44+
4045
repositories {
4146
mavenCentral()
4247
jcenter()
@@ -95,34 +100,41 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
95100

96101
if (preferredRepo == 'local') {
97102
repository url: repositories.mavenLocal().url
98-
} else if (preferredRepo != null
103+
println "Uploading archives to mavenLocal()."
104+
} else if (preferredRepo != null
99105
&& project.hasProperty('preferredUsername')
100106
&& project.hasProperty('preferredPassword')) {
101107
configuration = configurations.deployerJars
108+
102109
// replace placeholders
103110
def repositoryUrl = preferredRepo
104111
.replace('__groupId__', project.group)
105112
.replace('__artifactId__', project.archivesBaseName)
106113
repository(url: repositoryUrl) {
107114
authentication(userName: preferredUsername, password: preferredPassword)
108115
}
109-
} else if (project.hasProperty('sonatypeUsername')
116+
117+
println "Uploading archives to $repositoryUrl."
118+
} else if (project.hasProperty('sonatypeUsername')
110119
&& project.hasProperty('sonatypePassword')) {
111120
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
121+
112122
def isSnapshot = version.endsWith('-SNAPSHOT')
113-
def sonatypeRepositoryUrl = isSnapshot ?
114-
"https://oss.sonatype.org/content/repositories/snapshots/"
123+
def sonatypeRepositoryUrl = isSnapshot
124+
? "https://oss.sonatype.org/content/repositories/snapshots/"
115125
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
116126
repository(url: sonatypeRepositoryUrl) {
117127
authentication(userName: sonatypeUsername, password: sonatypePassword)
118128
}
129+
130+
println "Uploading archives to $sonatypeRepositoryUrl."
119131
} else {
120-
println "Deployment settings missing/incomplete for ${project.name}."
132+
println "WARNING: preferredRepo NOT set, can not upload archives."
121133
}
122134

123135
pom.project {
124136
packaging 'jar'
125-
url 'http://objectbox.io'
137+
url 'https://objectbox.io'
126138

127139
scm {
128140
url 'https://github.com/objectbox/objectbox-java'
@@ -144,7 +156,7 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
144156

145157
organization {
146158
name 'ObjectBox Ltd.'
147-
url 'http://objectbox.io'
159+
url 'https://objectbox.io'
148160
}
149161
}
150162
}
@@ -153,36 +165,6 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
153165
}
154166
}
155167

156-
// this task is also used by the composite build ('objectbox-deploy'), check before making changes
157-
task installAll {
158-
group 'deploy'
159-
dependsOn ':objectbox-java-api:install'
160-
dependsOn ':objectbox-java:install'
161-
dependsOn ':objectbox-kotlin:install'
162-
dependsOn ':objectbox-rxjava:install'
163-
doLast {
164-
println("Installed version $version")
165-
}
166-
}
167-
168-
// this task is also used by the composite build ('objectbox-deploy'), check before making changes
169-
task deployAll {
170-
group 'deploy'
171-
dependsOn ':objectbox-java-api:uploadArchives'
172-
dependsOn ':objectbox-java:uploadArchives'
173-
dependsOn ':objectbox-kotlin:uploadArchives'
174-
dependsOn ':objectbox-rxjava:uploadArchives'
175-
}
176-
177-
// this task is also used by the composite build ('objectbox-deploy'), check before making changes
178-
task verifyVersion {
179-
group 'verify'
180-
dependsOn ':objectbox-java:verifyVersion'
181-
doLast {
182-
assert ob_expected_version == version
183-
}
184-
}
185-
186168
wrapper {
187169
distributionType = Wrapper.DistributionType.ALL
188170
}

gradle/wrapper/gradle-wrapper.jar

3.01 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
154154
else
155155
eval `echo args$i`="\"$arg\""
156156
fi
157-
i=$((i+1))
157+
i=`expr $i + 1`
158158
done
159159
case $i in
160-
(0) set -- ;;
161-
(1) set -- "$args0" ;;
162-
(2) set -- "$args0" "$args1" ;;
163-
(3) set -- "$args0" "$args1" "$args2" ;;
164-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
160+
0) set -- ;;
161+
1) set -- "$args0" ;;
162+
2) set -- "$args0" "$args1" ;;
163+
3) set -- "$args0" "$args1" "$args2" ;;
164+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170170
esac
171171
fi
172172

@@ -175,14 +175,9 @@ save () {
175175
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176176
echo " "
177177
}
178-
APP_ARGS=$(save "$@")
178+
APP_ARGS=`save "$@"`
179179

180180
# Collect all arguments for the java command, following the shell quoting and substitution rules
181181
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182182

183-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185-
cd "$(dirname "$0")"
186-
fi
187-
188183
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3336
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

objectbox-java-api/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
apply plugin: 'java'
22

3-
group = 'io.objectbox'
4-
version= rootProject.version
5-
6-
sourceCompatibility = 1.7
3+
sourceCompatibility = JavaVersion.VERSION_1_8
4+
targetCompatibility = JavaVersion.VERSION_1_8
75

86
task javadocJar(type: Jar, dependsOn: javadoc) {
97
classifier = 'javadoc'

objectbox-java-api/src/main/java/io/objectbox/annotation/NotNull.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
*/
3131
@Retention(RetentionPolicy.CLASS)
3232
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
33-
/** TODO public */ @interface NotNull {
33+
/* TODO public */ @interface NotNull {
3434
}

objectbox-java-api/src/main/java/io/objectbox/annotation/OrderBy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
@Retention(RetentionPolicy.CLASS)
3030
@Target(ElementType.FIELD)
31-
/** TODO public */ @interface OrderBy {
31+
/* TODO public */ @interface OrderBy {
3232
/**
3333
* Comma-separated list of properties, e.g. "propertyA, propertyB, propertyC"
3434
* To specify direction, add ASC or DESC after property name, e.g.: "propertyA DESC, propertyB ASC"

objectbox-java/build.gradle

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
apply plugin: 'java'
2-
apply plugin: 'findbugs'
2+
apply plugin: "com.github.spotbugs"
33

4-
group = 'io.objectbox'
5-
version= rootProject.version
6-
7-
sourceCompatibility = '1.7'
8-
9-
tasks.withType(FindBugs) {
10-
reports {
11-
xml.enabled false
12-
html.enabled true
13-
}
14-
ignoreFailures = true
15-
}
4+
sourceCompatibility = JavaVersion.VERSION_1_8
5+
targetCompatibility = JavaVersion.VERSION_1_8
166

177
dependencies {
188
compile fileTree(include: ['*.jar'], dir: 'libs')
@@ -22,6 +12,10 @@ dependencies {
2212
compile 'com.google.code.findbugs:jsr305:3.0.2'
2313
}
2414

15+
spotbugs {
16+
ignoreFailures = true
17+
}
18+
2519
javadoc {
2620
// Hide internal API from javadoc artifact.
2721
exclude("**/io/objectbox/Cursor.java")
@@ -142,23 +136,3 @@ uploadArchives {
142136
}
143137
}
144138
}
145-
146-
// this task is also used by the composite build ('objectbox-deploy'), check before making changes
147-
task verifyVersion {
148-
group 'verify'
149-
doLast {
150-
// verify version in Boxstore.java
151-
File storeFile = file('src/main/java/io/objectbox/BoxStore.java')
152-
def versionLine = storeFile.filterLine { line ->
153-
line.contains("String VERSION =")
154-
}.toString()
155-
156-
if (versionLine == null || versionLine.empty) {
157-
throw new GradleException('Could not find VERSION in ObjectStore.cpp')
158-
}
159-
160-
// matches snippet like '12.34.56'
161-
def boxStoreVersion = versionLine.find("\\d+\\.\\d+\\.\\d+")
162-
assert ob_expected_version == boxStoreVersion
163-
}
164-
}

0 commit comments

Comments
 (0)