diff --git a/appveyor.yml b/appveyor.yml index 12f8182b..7dad0777 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,5 @@ +version: '0.4.4.5_alpha({build})' + environment: ANDROID_HOME: C:\android-sdk-windows @@ -20,6 +22,9 @@ build_script: artifacts: - path: 'edxp-core\release\**\*.zip' +pull_requests: + do_not_increment_build_number: true + only_commits: files: - dalvikdx/ @@ -34,6 +39,4 @@ only_commits: - build.gradle - settings.gradle - gradle.properties - - appveyor.yml - -version: '0.4.4.5_alpha (4450) {build}' + - appveyor.yml \ No newline at end of file diff --git a/edxp-core/build.gradle b/edxp-core/build.gradle index 6e9f38d0..9bd56027 100644 --- a/edxp-core/build.gradle +++ b/edxp-core/build.gradle @@ -3,10 +3,24 @@ import org.gradle.internal.os.OperatingSystem apply plugin: 'com.android.library' -version "v0.4.4.5_alpha" +// Values set here will be overriden by AppVeyor, feel free to modify during development. +def buildVersionName = 'v1.0.0' +def buildVersionCode = 1 + +if (System.env.APPVEYOR_BUILD_VERSION != null) { + buildVersionName = "v${System.getenv('appveyor_build_version')}" +} + +if (System.env.APPVEYOR_BUILD_NUMBER != null) { + // Split is necessary because PRs set the build number to "1234-something". + def parts = System.env.APPVEYOR_BUILD_NUMBER.split('-') + buildVersionCode = Integer.valueOf(parts[0]) +} + +version buildVersionName ext { - versionCode = "4450" + versionCode = buildVersionCode module_name = "EdXposed" jar_dest_dir = "${projectDir}/template_override/system/framework/" is_windows = OperatingSystem.current().isWindows() @@ -130,7 +144,7 @@ afterEvaluate { into templateRootPath rename "module.prop.tpl", "module.prop" expand(moduleId: "$magiskModuleId", backend: "$backendCapped", - versionName: "$version" + "($backend)", + versionName: "$version" + " ($backend)", versionCode: "$versionCode", authorList: "$authorList") filter(FixCrLfFilter.class, eol: FixCrLfFilter.CrLf.newInstance("lf")) } @@ -146,6 +160,14 @@ afterEvaluate { from "${projectDir}/template_override" into zipPathMagiskRelease } + copy { + from "${projectDir}/template_override/common/util_functions.sh" + into "${zipPathMagiskRelease}/common" + filter { line -> line + .replaceAll('%VERSION%', "$version") + .replaceAll('%VERSION_CODE%', "$versionCode") + .replaceAll('%BACKEND%', "$backendCapped") } + } copy { from 'template_override/riru_module.prop' into "$zipPathMagiskRelease/data/misc/riru/modules/${riruModuleId}" diff --git a/edxp-core/template_override/common/util_functions.sh b/edxp-core/template_override/common/util_functions.sh index 00ca706c..770ffd5d 100644 --- a/edxp-core/template_override/common/util_functions.sh +++ b/edxp-core/template_override/common/util_functions.sh @@ -1,6 +1,6 @@ #!/system/bin/sh -EDXP_VERSION="0.4.4.5_alpha (4450)" +EDXP_VERSION="%VERSION% (%BACKEND%)" ANDROID_SDK=`getprop ro.build.version.sdk` BUILD_DESC=`getprop ro.build.description` PRODUCT=`getprop ro.build.product`