mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-10 22:36:01 +00:00
Replace npm run get-version
with JSON parser gradle function (#849)
* Replace npm run get-version with JSON parser from groovy
This commit is contained in:
parent
6108e358e2
commit
9eb575252f
@ -66,9 +66,17 @@ String getAppId () {
|
|||||||
|
|
||||||
apply from: 'analytics.gradle'
|
apply from: 'analytics.gradle'
|
||||||
|
|
||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
|
def getNpmVersion() {
|
||||||
|
def inputFile = new File(buildscript.sourceFile.getParent() + "/../package.json")
|
||||||
|
def packageJson = new JsonSlurper().parseText(inputFile.text)
|
||||||
|
return packageJson["version"]
|
||||||
|
}
|
||||||
|
|
||||||
task send(type: SendAnalyticsTask) {
|
task send(type: SendAnalyticsTask) {
|
||||||
applicationId = getAppId()
|
applicationId = getAppId()
|
||||||
version = "npm --silent run get-version".execute(null, projectDir).text.trim()
|
version = getNpmVersion().trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
preBuild.dependsOn send
|
preBuild.dependsOn send
|
||||||
|
Loading…
x
Reference in New Issue
Block a user