mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 16:17:39 +00:00
Minor gradle script changes
This commit is contained in:
parent
c2e6622016
commit
f6a2b1c882
25
build.gradle
25
build.gradle
@ -2,12 +2,6 @@ import java.nio.file.Paths
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
def props = new Properties()
|
||||
def configPath = project.hasProperty('configPath') ?
|
||||
new File(project.configPath) : rootProject.file('config.prop')
|
||||
if (configPath.exists())
|
||||
configPath.withInputStream { is -> props.load(is) }
|
||||
|
||||
buildscript {
|
||||
ext.vKotlin = '1.3.72'
|
||||
ext.vNav = '2.3.0'
|
||||
@ -33,6 +27,13 @@ task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
String.metaClass.toFile = { new File(this) }
|
||||
def configFile = rootProject.findProperty('configPath')?.toFile() ?: rootProject.file('config.prop')
|
||||
if (!configFile.exists())
|
||||
throw new GradleException("Please setup config.prop")
|
||||
|
||||
def props = new Properties()
|
||||
configFile.withInputStream { is -> props.load(is) }
|
||||
ext.props = props
|
||||
|
||||
subprojects {
|
||||
@ -98,17 +99,19 @@ subprojects {
|
||||
android {
|
||||
signingConfigs {
|
||||
config {
|
||||
storeFile new File(props['keyStore'])
|
||||
storePassword props['keyStorePass']
|
||||
keyAlias props['keyAlias']
|
||||
keyPassword props['keyPass']
|
||||
if (props.containsKey('keyStore')) {
|
||||
storeFile new File(props['keyStore'])
|
||||
storePassword props['keyStorePass']
|
||||
keyAlias props['keyAlias']
|
||||
keyPassword props['keyPass']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
// If keystore exists, sign the APK with custom signature
|
||||
if (signingConfigs.config.storeFile.exists())
|
||||
if (signingConfigs.config.storeFile?.exists())
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
release {
|
||||
|
Loading…
x
Reference in New Issue
Block a user