Move helper function out of the way

This commit is contained in:
David Howell 2017-04-19 14:01:22 +09:30
parent be06e7d529
commit 7702c3ec67
1 changed files with 15 additions and 15 deletions

View File

@ -32,21 +32,6 @@ import org.apache.tools.ant.filters.ReplaceTokens
// We then copy both the downloaded code and our custom makefiles and headers into third-party-ndk.
// After that we build native code from src/main/jni with module path pointing at third-party-ndk.
def getDependenciesVersion(keyName) {
def inputFile = new File(buildscript.sourceFile.getParent() + "/../../dependencies.list")
def line
inputFile.withReader { reader ->
while ((line = reader.readLine())!=null) {
def (key, value) = line.tokenize('=')
if (keyName == key) {
return value
}
}
throw new GradleException("${keyName} not found in dependencies.list.")
}
}
ext.coreVersion = getDependenciesVersion("REALM_CORE_VERSION").trim()
ext.syncVersion = getDependenciesVersion("REALM_SYNC_VERSION").trim()
def currentVersion = getDependenciesVersion("VERSION").trim()
@ -103,6 +88,21 @@ task prepareRealmCore(dependsOn: downloadRealmCore, type:Copy) {
}
}
def getDependenciesVersion(keyName) {
def inputFile = new File(buildscript.sourceFile.getParent() + "/../../dependencies.list")
def line
inputFile.withReader { reader ->
while ((line = reader.readLine())!=null) {
def (key, value) = line.tokenize('=')
if (keyName == key) {
return value
}
}
throw new GradleException("${keyName} not found in dependencies.list.")
}
}
def getNdkBuildName() {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
return "ndk-build.cmd"