Skip to content

Commit

Permalink
Better support for external config file
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Sep 6, 2018
1 parent c0f45b6 commit 2d7c1da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apply plugin: 'com.android.application'

def configProps = new Properties()
configProps.load(new FileInputStream(rootProject.file('config.prop')))
def configPath = project.hasProperty('configPath') ? project.configPath : rootProject.file('config.prop')
configProps.load(new FileInputStream(configPath))

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down
6 changes: 3 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def build_apk(args, flavor):

buildType = 'Release' if args.release else 'Debug'

proc = execv([gradlew, 'app:assemble' + flavor + buildType])
proc = execv([gradlew, 'app:assemble' + flavor + buildType, '-PconfigPath=' + os.path.abspath(args.config)])
if proc.returncode != 0:
error('Build Magisk Manager failed!')

Expand Down Expand Up @@ -322,7 +322,7 @@ def zip_main(args):

# End of zipping

output = os.path.join(config['outdir'], 'Magisk-v{}.zip'.format(config['version']) if config['prettyName'] else
output = os.path.join(config['outdir'], 'Magisk-v{}.zip'.format(config['version']) if config['prettyName'] else
'magisk-release.zip' if args.release else 'magisk-debug.zip')
sign_zip(unsigned, output, args.release)
header('Output: ' + output)
Expand Down Expand Up @@ -366,7 +366,7 @@ def zip_uninstaller(args):

# End of zipping

output = os.path.join(config['outdir'], 'Magisk-uninstaller-{}.zip'.format(datetime.datetime.now().strftime('%Y%m%d'))
output = os.path.join(config['outdir'], 'Magisk-uninstaller-{}.zip'.format(datetime.datetime.now().strftime('%Y%m%d'))
if config['prettyName'] else 'magisk-uninstaller.zip')
sign_zip(unsigned, output, args.release)
header('Output: ' + output)
Expand Down

0 comments on commit 2d7c1da

Please sign in to comment.