Merge pull request #972 from dbhowell/gradle-use-dependencies-list
Use dependencies.list file instead of npm for build.gradle
This commit is contained in:
commit
8d3b4aca95
|
@ -31,17 +31,14 @@ import org.apache.tools.ant.filters.ReplaceTokens
|
||||||
// We download various C++ open-source dependencies into downloads.
|
// We download various C++ open-source dependencies into downloads.
|
||||||
// We then copy both the downloaded code and our custom makefiles and headers into third-party-ndk.
|
// 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.
|
// After that we build native code from src/main/jni with module path pointing at third-party-ndk.
|
||||||
def npmExecutable = 'npm';
|
|
||||||
|
|
||||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
||||||
npmExecutable = 'npm.cmd'
|
ext.coreVersion = getDependenciesVersion("REALM_CORE_VERSION").trim()
|
||||||
}
|
ext.syncVersion = getDependenciesVersion("REALM_SYNC_VERSION").trim()
|
||||||
ext.coreVersion = "$npmExecutable --silent run get-core-version".execute().text.trim()
|
def currentVersion = getDependenciesVersion("VERSION").trim()
|
||||||
ext.syncVersion = "$npmExecutable --silent run get-sync-version".execute().text.trim()
|
|
||||||
println "Realm Core Version: $ext.coreVersion"
|
println "Realm Core Version: $ext.coreVersion"
|
||||||
println "Realm Sync Version: $ext.syncVersion"
|
println "Realm Sync Version: $ext.syncVersion"
|
||||||
|
|
||||||
def currentVersion = "$npmExecutable --silent run get-version".execute().text.trim()
|
|
||||||
def downloadsDir = new File("$projectDir/downloads")
|
def downloadsDir = new File("$projectDir/downloads")
|
||||||
def jscDownloadDir = new File("$projectDir/src/main/jni/jsc")
|
def jscDownloadDir = new File("$projectDir/src/main/jni/jsc")
|
||||||
def coreDownloadDir = new File("$projectDir/src/main/jni")
|
def coreDownloadDir = new File("$projectDir/src/main/jni")
|
||||||
|
@ -95,6 +92,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() {
|
def getNdkBuildName() {
|
||||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
return "ndk-build.cmd"
|
return "ndk-build.cmd"
|
||||||
|
|
Loading…
Reference in New Issue