Skip to content

Commit ced27c2

Browse files
Merge branch 'easy-deploy' into dev
2 parents 2bcfa22 + 0d08100 commit ced27c2

3 files changed

Lines changed: 52 additions & 2 deletions

File tree

build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
version = '1.4.2-SNAPSHOT'
33

44
buildscript {
5+
ext.ob_expected_version = project.hasProperty('expectedVersion') ? project.property('expectedVersion') : 'UNDEFINED'
56
ext {
67
isLinux = System.getProperty("os.name").contains("Linux")
78
is64 = System.getProperty("sun.arch.data.model") == "64"
@@ -125,6 +126,34 @@ configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) {
125126
}
126127
}
127128

129+
// this task is also used by the composite build ('objectbox-deploy'), check before making changes
130+
task installAll {
131+
group 'deploy'
132+
dependsOn ':objectbox-java-api:install'
133+
dependsOn ':objectbox-java:install'
134+
dependsOn ':objectbox-kotlin:install'
135+
doLast {
136+
println("Installed version $version")
137+
}
138+
}
139+
140+
// this task is also used by the composite build ('objectbox-deploy'), check before making changes
141+
task deployAll {
142+
group 'deploy'
143+
dependsOn ':objectbox-java-api:uploadArchives'
144+
dependsOn ':objectbox-java:uploadArchives'
145+
dependsOn ':objectbox-kotlin:uploadArchives'
146+
}
147+
148+
// this task is also used by the composite build ('objectbox-deploy'), check before making changes
149+
task verifyVersion {
150+
group 'verify'
151+
dependsOn ':objectbox-java:verifyVersion'
152+
doLast {
153+
assert ob_expected_version == version
154+
}
155+
}
156+
128157
task wrapper(type: Wrapper) {
129158
group 'build setup'
130159
gradleVersion = '4.4.1'

objectbox-java/build.gradle

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,24 @@ uploadArchives {
8383
}
8484
}
8585
}
86-
}
86+
}
87+
88+
// this task is also used by the composite build ('objectbox-deploy'), check before making changes
89+
task verifyVersion {
90+
group 'verify'
91+
doLast {
92+
// verify version in Boxstore.java
93+
File storeFile = file('src/main/java/io/objectbox/BoxStore.java')
94+
def versionLine = storeFile.filterLine { line ->
95+
line.contains("String VERSION =")
96+
}.toString()
97+
98+
if (versionLine == null || versionLine.empty) {
99+
throw new GradleException('Could not find VERSION in ObjectStore.cpp')
100+
}
101+
102+
// matches snippet like '12.34.56'
103+
def boxStoreVersion = versionLine.find("\\d+\\.\\d+\\.\\d+")
104+
assert ob_expected_version == boxStoreVersion
105+
}
106+
}

objectbox-java/src/main/java/io/objectbox/BoxStore.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
@ThreadSafe
6262
public class BoxStore implements Closeable {
6363

64+
private static final String VERSION = "1.4.2-2018-01-26";
6465
private static BoxStore defaultStore;
6566

6667
private static Set<String> openFiles = new HashSet<>();
@@ -141,7 +142,7 @@ static native void nativeRegisterCustomType(long store, int entityId, int proper
141142
public static native boolean isObjectBrowserAvailable();
142143

143144
public static String getVersion() {
144-
return "1.4.2-2018-01-26";
145+
return VERSION;
145146
}
146147

147148
private final File directory;

0 commit comments

Comments
 (0)