Commit 0b6ee040 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch 'devel' into V3.6.3

parents f2299776 01ad72b7
......@@ -15,47 +15,68 @@
before_script:
- ./gradlew unlockIOSKeyChain
- git submodule update --init --recursive
stages:
- build
- unitTest
- iTest-desktop
pre-release:
# Development build
# Runs for every commit
# Connects to development server
dev_debug:
stage: build
except:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
expire_in: 2 weeks
paths:
- android/build/outputs/apk/*debug*.apk
- android/build/outputs/apk/*iTest*.apk
- ios/build/robovm/*debug*.ipa
- ios/build/robovm/*iTest*.ipa
- desktop/build/libs/*debug*.jar
# Release debug build
# Runs only on tags
# Connects to development server
release-debug:
stage: build
only:
- master
- devel
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_ASSETS_OPTIMIZE=true
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
paths:
- android/build/outputs/apk/*debug*.apk
- android/build/outputs/apk/*iTest*.apk
- ios/build/robovm/*debug*.ipa
- ios/build/robovm/*iTest*.ipa
- desktop/build/libs/*debug*.jar
- desktop/build/libs/*iTest*.jar
- desktop/build/libs/*debug*.deb
- desktop/build/outputs/*debug*.exe
- desktop/build/outputApp/*debug*.app
debug:
# Actual release build
# Runs only on tags
# Connects to production server
# -PTABLEXIA_RELEASE_BUILD=true - Tells Tablexia to use production server
release:
stage: build
except:
- pre-release
- release
only:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_ASSETS_OPTIMIZE=true
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_RELEASE_BUILD=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
expire_in: 2 weeks
paths:
- android/build/outputs/apk/*debug*.apk
- android/build/outputs/apk/*iTest*.apk
- ios/build/robovm/*debug*.ipa
- ios/build/robovm/*iTest*.ipa
- desktop/build/libs/*debug*.jar
paths:
- android/build/outputs/apk/*release*.apk
- ios/build/robovm/*release*.ipa
- desktop/build/libs/*release*.deb
- desktop/build/outputs/*release*.exe
unitTest:
stage: unitTest
script:
- ./gradlew test -x prepareAssets -x prepareGraphicAssets -x prepareSoundAssets -x prepareJsonAssets -x processAssets -x runChecksum
iTest-desktop:
stage: iTest-desktop
script:
......@@ -65,18 +86,4 @@ iTest-desktop:
expire_in: 3 days
paths:
- desktop/build/libs/iTest_results/*.log
- desktop/build/libs/iTest_results/*error.png
release:
stage: build
only:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
paths:
- android/build/outputs/apk/*release*.apk
- ios/build/robovm/*release*.ipa
- desktop/build/libs/*release*.jar
- desktop/build/libs/*release*.deb
- desktop/build/outputs/*release*.exe
- desktop/build/outputApp/*release*.app
- desktop/build/libs/iTest_results/*error.png
\ No newline at end of file
......@@ -72,13 +72,13 @@ allprojects {
masterBranch = 'master'
applicationBaseId = 'cz.nic.tablexia'
tablexiaAppName = getTablexiaAppName()
assetsDebugURLPart = onMaster() ? '' : 'debug/'
assetsDebugURLPart = isReleaseBuild() ? '' : 'debug/'
assetsDownloadUrl = project.hasProperty("TABLEXIA_ASSETS_DOWNLOAD_URL") ? ("${TABLEXIA_ASSETS_DOWNLOAD_URL}/${assetsDebugURLPart}") : "<NO_URL_CONFIGURED>/"
assetsUploadURL = (project.hasProperty("TABLEXIA_ASSETS_UPLOAD_USER") && project.hasProperty("TABLEXIA_ASSETS_UPLOAD_URL")) ? "${TABLEXIA_ASSETS_UPLOAD_USER}@${TABLEXIA_ASSETS_UPLOAD_URL}/${assetsDebugURLPart}" : "<NO_URL_CONFIGURED>/"
serverFallbackHost = "<NO_SERVER_HOST>"
serverHost = onMaster() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_PRODUCTION", serverFallbackHost) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_DEBUG", serverFallbackHost)
serverSecretFallback = "";
serverSecret = onMaster() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_SECRET_PRODUCTION", serverSecretFallback) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_SECRET_DEBUG", serverSecretFallback);
serverHost = isReleaseBuild() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_PRODUCTION", serverFallbackHost) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_DEBUG", serverFallbackHost)
serverSecretFallback = ""
serverSecret = isReleaseBuild() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_SECRET_PRODUCTION", serverSecretFallback) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_SECRET_DEBUG", serverSecretFallback);
tablexiaVersionName = getVersionNameFromGit(TABLEXIA_GIT_PATH)
tablexiaVersionCode = getVersionCodeFromGit(TABLEXIA_GIT_PATH)
tablexiaModelVersionName = getVersionNameFromGit(MODEL_GIT_PATH)
......@@ -94,7 +94,7 @@ allprojects {
//Fallback value if sentry DSN is not defined (gradle parameter SENTRY_DSN_DEBUG or SENTRY_DSN_RELEASE)
sentryDSNFallbackValue = "None"
sentryDSN = onMaster() ? getPropertyValueOrFallbackValue("TABLEXIA_SENTRY_DSN_RELEASE", sentryDSNFallbackValue) : getPropertyValueOrFallbackValue("TABLEXIA_SENTRY_DSN_DEBUG", sentryDSNFallbackValue)
sentryDSN = isReleaseBuild() ? getPropertyValueOrFallbackValue("TABLEXIA_SENTRY_DSN_RELEASE", sentryDSNFallbackValue) : getPropertyValueOrFallbackValue("TABLEXIA_SENTRY_DSN_DEBUG", sentryDSNFallbackValue)
gdxVersion = '1.9.6'
gdxUtilsVersion = '0.13.2'
......@@ -213,7 +213,7 @@ task prepareHdAssets(dependsOn: prepareAssets) {
outputs.dir("${buildDir}/${assetsDirName}/${assetsHdDirName}/${assetsSourceDirName}/")
doLast {
if (project.hasProperty('TABLEXIA_HD_ASSETS') && Boolean.valueOf(TABLEXIA_HD_ASSETS).booleanValue()) {
if (project.hasProperty('TABLEXIA_HD_ASSETS') && Boolean.valueOf(project.property('TABLEXIA_HD_ASSETS')).booleanValue()) {
new File("${assetsDir}/${assetsSourceDirName}/").eachDir() { langDir ->
langDir.eachDir() { sectionDir ->
......@@ -358,7 +358,7 @@ task prepareHdGraphicAssets(dependsOn: prepareHdAssets) {
outputs.dir("${assetsDir.absolutePath}/${assetsDestinationDirName}/")
doLast {
if (project.hasProperty('TABLEXIA_HD_ASSETS') && Boolean.valueOf(TABLEXIA_HD_ASSETS).booleanValue()) {
if (project.hasProperty('TABLEXIA_HD_ASSETS') && Boolean.valueOf(project.property('TABLEXIA_HD_ASSETS')).booleanValue()) {
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.pot = false;
settings.maxWidth = 2048;
......@@ -433,7 +433,7 @@ task prepareHdGraphicAssets(dependsOn: prepareHdAssets) {
task zipHdAssets(dependsOn: prepareHdGraphicAssets) {
doLast {
if (project.hasProperty('TABLEXIA_HD_ASSETS') && Boolean.valueOf(TABLEXIA_HD_ASSETS).booleanValue()) {
if (project.hasProperty('TABLEXIA_HD_ASSETS') && Boolean.valueOf(project.property('TABLEXIA_HD_ASSETS')).booleanValue()) {
new File(project(":core").projectDir.absolutePath + "/${assetsDirName}/").eachDir() { dir ->
if (!dir.name.equals('common')) {
......@@ -452,7 +452,7 @@ task zipHdAssets(dependsOn: prepareHdGraphicAssets) {
task processAssets(dependsOn: [':util:checksum:runChecksum', ':util:checksum:runAssetsArchivesChecksum']) {
doLast {
if (project.hasProperty('TABLEXIA_ASSETS_UPLOAD_USER') && project.hasProperty('TABLEXIA_ASSETS_UPLOAD_URL') && project.hasProperty('TABLEXIA_ASSETS_UPLOAD') && Boolean.valueOf(TABLEXIA_ASSETS_UPLOAD).booleanValue()) {
if (project.hasProperty('TABLEXIA_ASSETS_UPLOAD_USER') && project.hasProperty('TABLEXIA_ASSETS_UPLOAD_URL') && project.hasProperty('TABLEXIA_ASSETS_UPLOAD') && Boolean.valueOf(project.property('TABLEXIA_ASSETS_UPLOAD')).booleanValue()) {
def data = new URL(project.assetsDownloadUrl).getText()
rootProject.ext.assetsPackDir.eachFile() { file ->
String fileName = file.getName()
......@@ -487,8 +487,8 @@ task prepareHdPack(dependsOn: [':util:checksum:runHdChecksum', ':util:checksum:r
project.hasProperty('TABLEXIA_ASSETS_UPLOAD_USER') &&
project.hasProperty('TABLEXIA_ASSETS_UPLOAD_URL') &&
project.hasProperty('TABLEXIA_ASSETS_UPLOAD') &&
Boolean.valueOf(TABLEXIA_ASSETS_UPLOAD).booleanValue() &&
Boolean.valueOf(TABLEXIA_HD_ASSETS).booleanValue()) {
Boolean.valueOf(project.property('TABLEXIA_ASSETS_UPLOAD')).booleanValue() &&
Boolean.valueOf(project.property('TABLEXIA_HD_ASSETS')).booleanValue()) {
def data = new URL(project.assetsDownloadUrl).getText()
rootProject.ext.assetsHdPackDir.eachFile() { file ->
......@@ -532,7 +532,7 @@ def getPropertyValueOrFallbackValue(String key, String fallbackValue) {
}
def getTablexiaAppName() {
if (onMaster()) {
if (isReleaseBuild()) {
return "${project.appName}"
} else {
return "${project.appName} (${getBranchNameFromGit()})"
......@@ -540,7 +540,7 @@ def getTablexiaAppName() {
}
def getTablexiaAppId() {
if (onMaster()) {
if (isReleaseBuild()) {
return ""
} else {
return ".${getBranchNameFromGit().trim().replaceAll('-', '').replaceAll('\\.', '').toLowerCase()}"
......@@ -559,7 +559,7 @@ def getVersionNameFromGit(String relativePath) {
String result = stdout.toString().trim();
// for non release branches add number of commits and branch name
if (!onMaster()) {
if (!isReleaseBuild()) {
stdout = new ByteArrayOutputStream()
exec {
workingDir relativePath
......@@ -596,8 +596,8 @@ def getBranchNameFromGit() {
return branchString.contains("/") ? branchString.substring(branchString.lastIndexOf("/") + 1) : branchString
}
boolean onMaster() {
return project.masterBranch.equals(getBranchNameFromGit());
boolean isReleaseBuild() {
return project.hasProperty('TABLEXIA_RELEASE_BUILD') && Boolean.valueOf(project.property('TABLEXIA_RELEASE_BUILD')).booleanValue()
}
def getMapConvertedToString(Map map) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment