Add Appveyor versioning (#299)

* Add Appveyor versioning.

* Improve version format.

* Update version format.
This commit is contained in:
AeonLucid 2019-06-16 16:52:07 +02:00 committed by solohsu
parent c5791951db
commit db0a589b11
3 changed files with 32 additions and 7 deletions

View File

@ -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

View File

@ -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}"

View File

@ -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`