Closed nzdeveloper009 closed 2 years ago
Please use the forum for dev questions.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
import org.signal.signing.ApkSignerUtil
import java.security.MessageDigest
apply plugin: 'com.android.application' apply plugin: 'com.google.protobuf' apply plugin: 'androidx.navigation.safeargs' apply plugin: 'witness' apply from: 'translations.gradle' apply from: 'witness-verifications.gradle'
repositories { maven { url "https://raw.github.com/signalapp/maven/master/photoview/releases/" content { includeGroupByRegex "com\.github\.chrisbanes." } } maven { url "https://raw.github.com/signalapp/maven/master/circular-progress-button/releases/" content { includeGroupByRegex "com\.github\.dmytrodanylyk\.circular-progress-button\." } } maven { url "https://raw.github.com/signalapp/maven/master/sqlcipher/release/" content { includeGroupByRegex "org\.signal." } } maven { // textdrawable url 'https://dl.bintray.com/amulyakhare/maven' content { includeGroupByRegex "com\.amulyakhare." } } google() mavenCentral() jcenter() mavenLocal() }
protobuf { protoc { artifact = 'com.google.protobuf:protoc:3.10.0' } generateProtoTasks { all().each { task -> task.builtins { java { option "lite" } } } } }
def canonicalVersionCode = 804 def canonicalVersionName = "5.5.5"
def postFixSize = 100 def abiPostFix = ['universal' : 0, 'armeabi-v7a' : 1, 'arm64-v8a' : 2, 'x86' : 3, 'x86_64' : 4]
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties') ]
android { buildToolsVersion BUILD_TOOL_VERSION compileSdkVersion COMPILE_SDK
}
dependencies { lintChecks project(':lintchecks')
}
dependencyVerification { configuration = '(play|website)(Prod|Staging)(Debug|Release)RuntimeClasspath' }
def assembleWebsiteDescriptor = { variant, file -> if (file.exists()) { MessageDigest md = MessageDigest.getInstance("SHA-256"); file.eachByte 4096, {bytes, size -> md.update(bytes, 0, size); }
}
def signProductionRelease = { variant -> variant.outputs.collect { output -> String apkName = output.outputFile.name File inputFile = new File(output.outputFile.path) File outputFile = new File(output.outputFile.parent, apkName.replace('-unsigned', ''))
}
task signProductionPlayRelease { doLast { signProductionRelease(android.applicationVariants.find { (it.name == 'playProdRelease') }) } }
task signProductionInternalRelease { doLast { signProductionRelease(android.applicationVariants.find { (it.name == 'internalProdRelease') }) } }
task signProductionWebsiteRelease { doLast { def variant = android.applicationVariants.find { (it.name == 'websiteProdRelease') } File signedRelease = signProductionRelease(variant).find { it.name.contains('universal') } assembleWebsiteDescriptor(variant, signedRelease) } }
def getLastCommitTimestamp() { new ByteArrayOutputStream().withStream { os -> def result = exec { executable = 'git' args = ['log', '-1', '--pretty=format:%ct'] standardOutput = os }
}
def getGitHash() { def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'rev-parse', '--short', 'HEAD' standardOutput = stdout } return stdout.toString().trim() }
tasks.withType(Test) { testLogging { events "failed" exceptionFormat "full" showCauses true showExceptions true showStackTraces true } }
def loadKeystoreProperties(filename) { def keystorePropertiesFile = file("${project.rootDir}/${filename}") if (keystorePropertiesFile.exists()) { def keystoreProperties = new Properties() keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) return keystoreProperties; } else { return null; } }