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: environment:
ANDROID_HOME: C:\android-sdk-windows ANDROID_HOME: C:\android-sdk-windows
@ -20,6 +22,9 @@ build_script:
artifacts: artifacts:
- path: 'edxp-core\release\**\*.zip' - path: 'edxp-core\release\**\*.zip'
pull_requests:
do_not_increment_build_number: true
only_commits: only_commits:
files: files:
- dalvikdx/ - dalvikdx/
@ -35,5 +40,3 @@ only_commits:
- settings.gradle - settings.gradle
- gradle.properties - gradle.properties
- appveyor.yml - appveyor.yml
version: '0.4.4.5_alpha (4450) {build}'

View File

@ -3,10 +3,24 @@ import org.gradle.internal.os.OperatingSystem
apply plugin: 'com.android.library' 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 { ext {
versionCode = "4450" versionCode = buildVersionCode
module_name = "EdXposed" module_name = "EdXposed"
jar_dest_dir = "${projectDir}/template_override/system/framework/" jar_dest_dir = "${projectDir}/template_override/system/framework/"
is_windows = OperatingSystem.current().isWindows() is_windows = OperatingSystem.current().isWindows()
@ -130,7 +144,7 @@ afterEvaluate {
into templateRootPath into templateRootPath
rename "module.prop.tpl", "module.prop" rename "module.prop.tpl", "module.prop"
expand(moduleId: "$magiskModuleId", backend: "$backendCapped", expand(moduleId: "$magiskModuleId", backend: "$backendCapped",
versionName: "$version" + "($backend)", versionName: "$version" + " ($backend)",
versionCode: "$versionCode", authorList: "$authorList") versionCode: "$versionCode", authorList: "$authorList")
filter(FixCrLfFilter.class, eol: FixCrLfFilter.CrLf.newInstance("lf")) filter(FixCrLfFilter.class, eol: FixCrLfFilter.CrLf.newInstance("lf"))
} }
@ -146,6 +160,14 @@ afterEvaluate {
from "${projectDir}/template_override" from "${projectDir}/template_override"
into zipPathMagiskRelease 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 { copy {
from 'template_override/riru_module.prop' from 'template_override/riru_module.prop'
into "$zipPathMagiskRelease/data/misc/riru/modules/${riruModuleId}" into "$zipPathMagiskRelease/data/misc/riru/modules/${riruModuleId}"

View File

@ -1,6 +1,6 @@
#!/system/bin/sh #!/system/bin/sh
EDXP_VERSION="0.4.4.5_alpha (4450)" EDXP_VERSION="%VERSION% (%BACKEND%)"
ANDROID_SDK=`getprop ro.build.version.sdk` ANDROID_SDK=`getprop ro.build.version.sdk`
BUILD_DESC=`getprop ro.build.description` BUILD_DESC=`getprop ro.build.description`
PRODUCT=`getprop ro.build.product` PRODUCT=`getprop ro.build.product`