Skip to content

Commit

Permalink
Adds missing new options
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Sep 20, 2016
1 parent a3e2c1e commit 181a009
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,9 @@ private void printState() {
log.debug("versionInfo.companyName = " + versionInfo.companyName);
log.debug("versionInfo.internalName = " + versionInfo.internalName);
log.debug("versionInfo.originalFilename = " + versionInfo.originalFilename);
log.debug("versionInfo.language = " + versionInfo.language);
log.debug("versionInfo.languageIndex = " + versionInfo.languageIndex);
log.debug("versionInfo.trademarks = " + versionInfo.trademarks);
} else {
log.debug("versionInfo = null");
}
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/com/akathist/maven/plugins/launch4j/VersionInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,25 @@
*/
package com.akathist.maven.plugins.launch4j;

import net.sf.launch4j.config.LanguageID;

import java.util.HashMap;
import java.util.Map;

/**
* Information that appears in the Windows Explorer.
*/
public class VersionInfo {

private static Map<String, LanguageID> LANGUAGE_TO_LANGUAGE_ID;

static {
LANGUAGE_TO_LANGUAGE_ID = new HashMap<>();
for (LanguageID languageID : LanguageID.values()) {
LANGUAGE_TO_LANGUAGE_ID.put(languageID.name(), languageID);
}
}

/**
* Version number in x.x.x.x format.
*/
Expand Down Expand Up @@ -73,6 +87,21 @@ public class VersionInfo {
*/
String originalFilename;

/**
* Language to be used during installation
*/
String language;

/**
* Trademarks of author
*/
String trademarks;

/**
* Index of language to be used during installation
*/
int languageIndex;

net.sf.launch4j.config.VersionInfo toL4j() {
net.sf.launch4j.config.VersionInfo ret = new net.sf.launch4j.config.VersionInfo();

Expand All @@ -86,10 +115,24 @@ net.sf.launch4j.config.VersionInfo toL4j() {
ret.setCompanyName(companyName);
ret.setInternalName(internalName);
ret.setOriginalFilename(originalFilename);
ret.setLanguage(LANGUAGE_TO_LANGUAGE_ID.get(language));
if (isLanguageIndex()) {
ret.setLanguageIndex(languageIndex);
}
ret.setTrademarks(trademarks);

return ret;
}

private boolean isLanguageIndex() {
for (LanguageID languageID : LanguageID.values()) {
if (languageID.getIndex() == languageIndex) {
return true;
}
}
return false;
}

@Override
public String toString() {
return "VersionInfo{" +
Expand All @@ -103,6 +146,9 @@ public String toString() {
", companyName='" + companyName + '\'' +
", internalName='" + internalName + '\'' +
", originalFilename='" + originalFilename + '\'' +
", language='" + language + '\'' +
", trademarks='" + trademarks + '\'' +
", languageIndex=" + languageIndex +
'}';
}
}

0 comments on commit 181a009

Please sign in to comment.