1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-12-24 22:15:33 +00:00

Version now automatically gets set by gradle.

This commit is contained in:
Fabian Schlenz 2016-07-13 06:06:26 +02:00
parent 1d28470563
commit ee16af7d3c
2 changed files with 27 additions and 1 deletions

View File

@ -23,6 +23,19 @@ run {
standardInput = System.in
}
def getVersionName= { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--dirty'
standardOutput = stdout
}
return stdout.toString().trim()
}
ant.propertyfile(file: "$project.rootDir/build/resources/main/build.properties") {
entry(key: "version", value: getVersionName())
}
jar {
manifest {
attributes "Main-Class": "$mainClassName"

View File

@ -17,13 +17,16 @@
package de.fabianonline.telegram_backup;
import java.io.File;
import java.io.IOException;
import java.io.FileInputStream;
import java.util.Properties;
public class Config {
public static final int APP_ID = 32860;
public static final String APP_HASH = "16e4ff955cd0adfc058f95ca564f562d";
public static final String APP_MODEL = "Desktop";
public static final String APP_SYSVER = "1.0";
public static final String APP_APPVER = "1.0.3";
public static final String APP_APPVER;
public static final String APP_LANG = "en";
public static String FILE_BASE = System.getProperty("user.home") + File.separatorChar + ".telegram_backup";
@ -44,5 +47,15 @@ public class Config {
public static int DELAY_AFTER_GET_FILE = 1000;
public static final String SECRET_GMAPS = "AIzaSyBEtUDhCQKEH6i2Mn1GAiQ9M_tLN0vxHIs";
static {
Properties p = new Properties();
try {
p.load(Config.class.getResourceAsStream("/build.properties"));
APP_APPVER = p.getProperty("version");
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}