Commit a3b425b8 authored by Matyáš Latner's avatar Matyáš Latner

#23 Devel build type for Android and Desktop versions

parent 0d13cc43
android {
buildToolsVersion "21.1.2"
compileSdkVersion 21
buildTypes {
debug {
applicationIdSuffix rootProject.applicationIdDebugSuffix
}
release {
debuggable false
}
devel.initWith(buildTypes.debug)
devel {
applicationIdSuffix rootProject.applicationIdDevelSuffix
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
......@@ -16,6 +30,9 @@ android {
debug {
res.srcDirs = ['res/debug']
}
devel {
res.srcDirs = ['res/devel']
}
instrumentTest.setRoot('tests')
}
......@@ -26,17 +43,10 @@ android {
applicationId rootProject.applicationIdRelease
}
buildTypes {
debug {
applicationIdSuffix rootProject.applicationIdDebugSuffix
}
release {
debuggable false
}
}
assemble.dependsOn = ['assembleRelease', 'assembleDebug']
applicationVariants.all { variant ->
if (!variant.buildType.name.equals("debug")) {
if (!variant.buildType.name.equals("devel")) {
variant.outputs.each { output ->
def file = output.outputFile
output.outputFile = new File(file.parent, file.name.replace(".apk", "-" + tablexiaVersionName + ".apk").replace("android", appName))
......
......@@ -23,6 +23,8 @@ allprojects {
applicationIdRelease = 'cz.nic.tablexia'
applicationIdDebugSuffix = '.debug'
applicationIdDebug = applicationIdRelease + applicationIdDebugSuffix
applicationIdDevelSuffix = '.devel'
applicationIdDevel = applicationIdRelease + applicationIdDevelSuffix
gdxVersion = '1.5.5'
gdxUtilsVersion = '0.9.1'
......
......@@ -30,7 +30,7 @@ public class TablexiaSettings {
public static final String CURRENT_SCREEN_KEY = "current_screen";
private static final String IDE_BUILD_APPLICATION_ID = "cz.nic.tablexia.debug";
private static final String IDE_BUILD_VERSION_NAME = "IDE-BUILD";
private static final String IDE_BUILD_VERSION_NAME = "DEVEL";
private final BuildType BUILD_TYPE;
private final String VERSION_NAME;
......
......@@ -11,17 +11,23 @@ import cz.nic.tablexia.Tablexia;
public class DesktopLauncher {
public static final String BUILD_VARIANT_MANIFEST_ATTRIBUTE = "Build-Type";
public static final String VERSION_NAME_MANIFEST_ATTRIBUTE = "Version-Name";
public static final String APPLICATION_ID_MANIFEST_ATTRIBUTE = "Application-Id";
public static final String DESKTOP_ICON_PATH = "icon/";
public static final String DESKTOP_ICON_16 = DESKTOP_ICON_PATH + "desktop_icon_16.png";
public static final String DESKTOP_ICON_32 = DESKTOP_ICON_PATH + "desktop_icon_32.png";
public static final String DESKTOP_ICON_128 = DESKTOP_ICON_PATH + "desktop_icon_128.png";
public static final String DESKTOP_ICON_DEBUG_16 = DESKTOP_ICON_PATH + "desktop_icon_debug_16.png";
public static final String DESKTOP_ICON_DEBUG_32 = DESKTOP_ICON_PATH + "desktop_icon_debug_32.png";
public static final String DESKTOP_ICON_DEBUG_128 = DESKTOP_ICON_PATH + "desktop_icon_debug_128.png";
private static final String BUILD_VARIANT_MANIFEST_ATTRIBUTE = "Build-Type";
private static final String VERSION_NAME_MANIFEST_ATTRIBUTE = "Version-Name";
private static final String APPLICATION_ID_MANIFEST_ATTRIBUTE = "Application-Id";
private static final String DESKTOP_BUILDTYPE_DEBUG = "debug";
private static final String DESKTOP_BUILDTYPE_RELEASE = "release";
private static final String DESKTOP_ICON_PATH = "icon/";
private static final String DESKTOP_ICON_16 = DESKTOP_ICON_PATH + "desktop_icon_16.png";
private static final String DESKTOP_ICON_32 = DESKTOP_ICON_PATH + "desktop_icon_32.png";
private static final String DESKTOP_ICON_128 = DESKTOP_ICON_PATH + "desktop_icon_128.png";
private static final String DESKTOP_ICON_DEBUG_16 = DESKTOP_ICON_PATH + "desktop_icon_debug_16.png";
private static final String DESKTOP_ICON_DEBUG_32 = DESKTOP_ICON_PATH + "desktop_icon_debug_32.png";
private static final String DESKTOP_ICON_DEBUG_128 = DESKTOP_ICON_PATH + "desktop_icon_debug_128.png";
private static final String DESKTOP_ICON_DEVEL_16 = DESKTOP_ICON_PATH + "desktop_icon_devel_16.png";
private static final String DESKTOP_ICON_DEVEL_32 = DESKTOP_ICON_PATH + "desktop_icon_devel_32.png";
private static final String DESKTOP_ICON_DEVEL_128 = DESKTOP_ICON_PATH + "desktop_icon_devel_128.png";
public static void main(String[] arg) {
......@@ -34,11 +40,15 @@ public class DesktopLauncher {
config.width = 1280;
config.height = 800;
if (buildType == null || buildType.equals("debug")) {
if (buildType == null) {
config.addIcon(DESKTOP_ICON_DEVEL_16, Files.FileType.Internal);
config.addIcon(DESKTOP_ICON_DEVEL_32, Files.FileType.Internal);
config.addIcon(DESKTOP_ICON_DEVEL_128, Files.FileType.Internal);
} else if (buildType.equals(DESKTOP_BUILDTYPE_DEBUG)) {
config.addIcon(DESKTOP_ICON_DEBUG_16, Files.FileType.Internal);
config.addIcon(DESKTOP_ICON_DEBUG_32, Files.FileType.Internal);
config.addIcon(DESKTOP_ICON_DEBUG_128, Files.FileType.Internal);
} else if (buildType.equals("release")) {
} else if (buildType.equals(DESKTOP_BUILDTYPE_RELEASE)) {
config.addIcon(DESKTOP_ICON_16, Files.FileType.Internal);
config.addIcon(DESKTOP_ICON_32, Files.FileType.Internal);
config.addIcon(DESKTOP_ICON_128, Files.FileType.Internal);
......
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