nock-nock/fabric.gradle
2019-01-25 11:08:18 -08:00

29 lines
No EOL
756 B
Groovy

apply plugin: 'io.fabric'
ext.getFabricApiKey = {
return System.getenv('FABRIC_APIKEY') ?: "xxxe76c4xxxx97e8cxxxx0135e9d46f5a2xxx"
}
ext.getFabricApiSecret = {
return System.getenv('FABRIC_APISECRET') ?: "xx68f6074dxxxxxc11dxxx97c172e8ebf0"
}
def buildFabricProperties() {
def propertiesFile = file("fabric.properties")
def apiSecret = getFabricApiSecret()
def apiKey = getFabricApiKey()
if (propertiesFile.exists()) {
propertiesFile.delete()
}
def commentMessage = "suppress inspection \"UnusedProperty\" for whole file"
ant.propertyfile(file: "fabric.properties", comment: commentMessage) {
entry(key: "apiSecret", value: apiSecret)
entry(key: "apiKey", value: apiKey)
}
}
afterEvaluate {
buildFabricProperties()
}