Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
Rename launcher and fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
abelgomez committed Mar 23, 2016
1 parent 71c831b commit efb4a4c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
eclipse.preferences.version=1
org.apache.ivyde.eclipse.standaloneretrieve=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><setuplist><setup name\="dependencies" resolveInWorkspace\="false"><ivyxml path\="ivy.xml"/><retrieve confs\="*" pattern\="lib/[type]s/[artifact]-[revision].[ext]" sync\="false" types\="*"/></setup></setuplist>
org.apache.ivyde.eclipse.standaloneretrieve=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><setuplist><setup name\="dependencies" resolveInWorkspace\="true"><ivysettings ivyUserDir\="" loadondemand\="false" path\=""/><ivyxml path\="ivy.xml"/><retrieve confs\="*" pattern\="lib/[type]s/[artifact]-[revision].[ext]" sync\="false" types\="*"/></setup></setuplist>
11 changes: 6 additions & 5 deletions es.sistedes.handle.generator/dist/build.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar" name="Create Runnable Jar for Project es.sistedes.handle.generator">
<property name="dir.buildfile" value="."/>
<property name="dir.workspace" value="${dir.buildfile}/../.."/>
<property name="dir.project" value="${dir.buildfile}/.."/>
<property name="dir.jarfile" value="${dir.buildfile}"/>
<target name="create_run_jar">
<jar destfile="${dir.jarfile}/generator.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="es.sistedes.handle.generator.Generator"/>
<attribute name="Main-Class" value="es.sistedes.handle.generator.CliLauncher"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.workspace}/es.sistedes.handle.generator/bin"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/es.sistedes.handle.generator/lib/commons-cli-1.3.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.workspace}/es.sistedes.handle.generator/lib/commons-lang3-3.4.jar"/>
<fileset dir="${dir.project}/bin"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.project}/lib/commons-cli-1.3.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.project}/lib/commons-lang3-3.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.project}/lib/commons-io-2.4.jar"/>
</jar>
</target>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.commons.cli.ParseException;
import org.apache.commons.io.IOUtils;

public class Generator {
public class CliLauncher {

private static final String PREFIX = "p";
private static final String PREFIX_LONG = "prefix";
Expand Down Expand Up @@ -53,7 +53,7 @@ public static void main(String[] args) {
}

/**
* Runs the {@link Generator}
* Runs the {@link CliLauncher}
*
* @param args
* @throws Exception
Expand All @@ -76,15 +76,15 @@ private static void run(String[] args) throws Exception {
FileInputStream input = null;
if (commandLine.hasOption(INPUT)) {
input = new FileInputStream(new File(commandLine.getOptionValue(INPUT)));
conversor.changeInput(input);
}

FileOutputStream output = null;
if (commandLine.hasOption(OUTPUT)) {
output = new FileOutputStream(new File(commandLine.getOptionValue(OUTPUT)));
conversor.changeOutput(output);
}

conversor.changeOutput(output);
conversor.changeInput(input);
conversor.putOption(ConversorOptions.USE_GUID, commandLine.hasOption(USE_GUID));
conversor.putOption(ConversorOptions.ADD_DELETE, commandLine.hasOption(ADD_DELETE));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private Boolean useGuid() {
*/
private static void configureCommands(Properties commands) {
try {
commands.load(Generator.class.getResourceAsStream("commands.properties"));
commands.load(CliLauncher.class.getResourceAsStream("commands.properties"));
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit efb4a4c

Please sign in to comment.