Skip to content
Snippets Groups Projects
Commit ba799fb8 authored by Luboš Horáček's avatar Luboš Horáček
Browse files

Merge branch 'devel' of gitlab.labs.nic.cz:mlatner/tablexia-libgdx into devel

Conflicts:
	core/src/cz/nic/tablexia/TablexiaSettings.java
parents 96f7d1ab de08f975
No related branches found
No related tags found
No related merge requests found
......@@ -193,11 +193,40 @@ task processAssets(dependsOn: [':util:checksum:runChecksum', ':util:checksum:run
def getVersionNameFromGit() {
def stdout = new ByteArrayOutputStream()
String branchName = getBranchNameFromGit()
// get last tag in current branch
exec {
commandLine 'git', 'describe', '--tags', '--always'
commandLine 'git', 'describe', '--abbrev=0', '--tags', '--first-parent'
standardOutput = stdout
}
return stdout.toString().trim()
String result = stdout.toString().trim();
// for non release branches add number of commits and branch name
if (!"master".equals(branchName)) {
stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--tags', '--no-walk', '--max-count=1', '--first-parent'
standardOutput = stdout
}
String revision = stdout.toString().trim()
stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', "${revision}..HEAD", '--count', '--first-parent'
standardOutput = stdout
}
String numberOfCommits = stdout.toString().trim()
if ("devel".equals(branchName)) {
// add only number of commits for devel branch
result = "${result}-${numberOfCommits}"
} else {
// add branch name and number of commits
result = "${result}-${branchName}-${numberOfCommits}"
}
}
return result
}
def getVersionCodeFromGit() {
......@@ -209,6 +238,15 @@ def getVersionCodeFromGit() {
return stdout.toString().trim().toInteger()
}
def getBranchNameFromGit() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'symbolic-ref', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim().toLowerCase()
}
def getMapConvertedToString(Map map) {
String result = "";
map.each { key, value ->
......
......@@ -30,12 +30,12 @@ public class TablexiaSettings {
public static final String DEV_VERSION_TYPE = "-DEV-";
private final BuildType BUILD_TYPE;
private final String VERSION_NAME = TablexiaBuildConfig.VERSION_NAME;
private final BuildType BUILD_TYPE;
private final String VERSION_NAME = TablexiaBuildConfig.VERSION_NAME;
private Preferences preferences;
private LocaleDefinition systemLocale;
private LocaleDefinition selectedLocale;
private Preferences preferences;
private LocaleDefinition systemLocale;
private LocaleDefinition selectedLocale;
public enum BuildType {
......
......@@ -6,7 +6,6 @@ import com.badlogic.gdx.utils.reflect.ClassReflection;
import com.badlogic.gdx.utils.reflect.ReflectionException;
import com.google.common.base.Splitter;
import java.io.File;
import java.util.Map;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
......@@ -30,7 +29,7 @@ public class Utility {
}
public static String transformLocalAssetsPath(String localAssetsPath) {
return localAssetsPath.replace(File.separatorChar, '.');
return localAssetsPath.replace('/', '.');
}
public static int[][] createColorMap(TextureRegion clickmap) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment