Skip to content

Commit

Permalink
Merge branch 'hotfix/2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
alex1702 committed Nov 20, 2016
2 parents 30d8918 + 5f6f6f0 commit 0503547
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ built-jar.properties
dist/javadoc
/nbproject/private/
.externalToolBuilders
.idea
.idea
version.properties
30 changes: 29 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
apply plugin: 'java'
apply plugin: 'application'
apply from: "${project.rootDir}/gradle/eclipse.gradle"
import java.nio.file.Files

sourceCompatibility = 1.8
targetCompatibility = 1.8
mainClassName = 'mSearch.Main'
version = '2.0.1'
version = '2.0.2'

compileJava {
options.encoding = "UTF-8"
Expand Down Expand Up @@ -36,6 +37,33 @@ dependencies {
compile 'org.tukaani:xz:1.5'
}

ext {
propsFile = file('src/main/resources/version.properties').absoluteFile
if(!propsFile.exists()) {
Files.createFile(propsFile.toPath())
}
}

def loadVersionProperties() {
Properties props = new Properties()
props.load(propsFile.newDataInputStream())
return props
}

task updateVersion << {
Properties props = loadVersionProperties()
def oldVersion = props.getProperty('VERSION')
if(!oldVersion.equals(project.version)) {
logger.lifecycle "==msearch======================"
logger.lifecycle "Version: $project.version"
logger.lifecycle "==msearch======================"
props.setProperty('VERSION', project.version)
props.store(propsFile.newWriter(), null)
}
}

processResources.dependsOn updateVersion

distributions {
main {
baseName = 'MSearch'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mSearch/daten/ListeFilme.java
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ public synchronized void writeMetaData() {
metaDaten[ListeFilme.FILMLISTE_DATUM_GMT_NR] = getJetzt_ddMMyyyy_HHmm_gmt();
metaDaten[ListeFilme.FILMLISTE_ID_NR] = createChecksum(metaDaten[ListeFilme.FILMLISTE_DATUM_GMT_NR]);
metaDaten[ListeFilme.FILMLISTE_VERSION_NR] = Const.VERSION_FILMLISTE;
metaDaten[ListeFilme.FILMLISTE_PRGRAMM_NR] = Const.PROGRAMMNAME + Functions.getProgVersionString() + " - Compiled: " + Functions.getCompileDate();
metaDaten[ListeFilme.FILMLISTE_PRGRAMM_NR] = Const.PROGRAMMNAME + Functions.getProgVersionString(); // + " - Compiled: " + Functions.getCompileDate();
}

/**
Expand Down
17 changes: 12 additions & 5 deletions src/main/java/mSearch/tool/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static String getPathJar() {
}

public static String getProgVersionString() {
return " [Rel: " + getBuildNr() + "]";
return " [Vers.: " + getBuildNr() + "]";
}

public static String[] getJavaVersion() {
Expand All @@ -148,7 +148,9 @@ public static String getCompileDate() {
try {
ResourceBundle.clearCache();
rb = ResourceBundle.getBundle("version");
msg = rb.getString(propToken);
if (rb.containsKey(propToken)) {
msg = rb.getString(propToken);
}
} catch (Exception e) {
Log.errorLog(807293847, e);
}
Expand All @@ -157,12 +159,17 @@ public static String getCompileDate() {

public static String getBuildNr() {
final ResourceBundle rb;
String propToken = "BUILD";
String msg = "";
String TOKEN_BUILD = "BUILD";
String TOKEN_VERSION = "VERSION";
String msg = "0-0";
try {
ResourceBundle.clearCache();
rb = ResourceBundle.getBundle("version");
msg = rb.getString(propToken);
if (rb.containsKey(TOKEN_BUILD)) {
msg = rb.getString(TOKEN_BUILD);
} else if (rb.containsKey(TOKEN_VERSION)) {
msg = rb.getString(TOKEN_VERSION);
}
} catch (Exception e) {
Log.errorLog(134679898, e);
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/mSearch/tool/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ public static synchronized void versionMsg(String progName) {
sysLog("");
//Version
sysLog(progName + Functions.getProgVersionString());
sysLog("Compiled: " + Functions.getCompileDate());
String compile = Functions.getCompileDate();
if (!compile.isEmpty()) {
sysLog("Compiled: " + compile);
}
sysLog("");
sysLog(LILNE);
sysLog("");
Expand Down

0 comments on commit 0503547

Please sign in to comment.