From: Otmar H. <otm...@us...> - 2006-03-28 23:25:53
|
Update of /cvsroot/jython/installer/src/java/org/python/util/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23970/src/java/org/python/util/install Modified Files: OverviewPage.java JarInstaller.java TypePage.java InstallerCommandLine.java Log Message: added finer control over parts to install - in silent mode - in console mode Index: OverviewPage.java =================================================================== RCS file: /cvsroot/jython/installer/src/java/org/python/util/install/OverviewPage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OverviewPage.java 20 Mar 2006 21:56:03 -0000 1.2 --- OverviewPage.java 28 Mar 2006 23:25:48 -0000 1.3 *************** *** 145,157 **** // type ! _typeLabel.setText(Installation.getText(TextKeys.INSTALLATION_TYPE_PROPERTY) + ": "); ! String installationType = FrameInstaller.getInstallationType(); ! if (installationType.equals(Installation.ALL)) { _type.setText(Installation.getText(TextKeys.ALL)); } ! if (installationType.equals(Installation.STANDARD)) { _type.setText(Installation.getText(TextKeys.STANDARD)); } ! if (installationType.equals(Installation.MINIMUM)) { _type.setText(Installation.getText(TextKeys.MINIMUM)); } --- 145,157 ---- // type ! _typeLabel.setText(Installation.getText(TextKeys.INSTALLATION_TYPE) + ": "); ! InstallationType installationType = FrameInstaller.getInstallationType(); ! if (installationType.isAll()) { _type.setText(Installation.getText(TextKeys.ALL)); } ! if (installationType.isStandard()) { _type.setText(Installation.getText(TextKeys.STANDARD)); } ! if (installationType.isMinimum()) { _type.setText(Installation.getText(TextKeys.MINIMUM)); } Index: JarInstaller.java =================================================================== RCS file: /cvsroot/jython/installer/src/java/org/python/util/install/JarInstaller.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JarInstaller.java 18 Feb 2006 22:55:34 -0000 1.2 --- JarInstaller.java 28 Mar 2006 23:25:48 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- import java.io.FileOutputStream; import java.io.IOException; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; *************** *** 18,21 **** --- 19,24 ---- public class JarInstaller { private static final String PATH_SEPARATOR = "/"; + private static final String LIB_NAME_SEP = "Lib" + PATH_SEPARATOR; + private static final String LIB_PAWT_SEP = LIB_NAME_SEP + "pawt" + PATH_SEPARATOR; private static final int BUFFER_SIZE = 1024; *************** *** 38,54 **** * @param installationType */ ! public void inflate(final File targetDirectory, String installationType, File javaHome) { try { List excludeDirs = _jarInfo.getExcludeDirs(); ! if (!Installation.ALL.equals(installationType)) { ! // has to correspond with build.xml excludeDirs.add("src"); } ! if (Installation.MINIMUM.equals(installationType)) { ! // has to correspond with build.Lib.include.properties excludeDirs.add("Demo"); ! excludeDirs.add("Lib" + PATH_SEPARATOR + "email"); ! excludeDirs.add("Lib" + PATH_SEPARATOR + "encodings"); ! excludeDirs.add("Lib" + PATH_SEPARATOR + "test"); } --- 41,65 ---- * @param installationType */ ! public void inflate(final File targetDirectory, InstallationType installationType, File javaHome) { try { + // has to correspond with build.xml + // has to correspond with build.Lib.include.properties List excludeDirs = _jarInfo.getExcludeDirs(); ! List coreLibFiles = new ArrayList(); ! if (!installationType.installSources()) { excludeDirs.add("src"); } ! if (!installationType.installDocumentation()) { ! excludeDirs.add("Doc"); ! } ! if (!installationType.installDemosAndExamples()) { excludeDirs.add("Demo"); ! } ! if (!installationType.installLibraryModules()) { ! excludeDirs.add(LIB_NAME_SEP + "email"); ! excludeDirs.add(LIB_NAME_SEP + "encodings"); ! excludeDirs.add(LIB_NAME_SEP + "test"); ! excludeDirs.add(LIB_NAME_SEP + "jxxload_help"); ! coreLibFiles = getCoreLibFiles(); } *************** *** 66,75 **** String zipEntryName = zipEntry.getName(); boolean exclude = false; Iterator excludeDirsAsIterator = excludeDirs.iterator(); while (excludeDirsAsIterator.hasNext()) { ! if (zipEntryName.startsWith((String) excludeDirsAsIterator.next() + PATH_SEPARATOR)) exclude = true; } if (!exclude) { count++; if (count % threshold == 0) { --- 77,96 ---- String zipEntryName = zipEntry.getName(); boolean exclude = false; + // handle exclusion of directories Iterator excludeDirsAsIterator = excludeDirs.iterator(); while (excludeDirsAsIterator.hasNext()) { ! if (zipEntryName.startsWith((String) excludeDirsAsIterator.next() + PATH_SEPARATOR)) { exclude = true; + } } + // handle exclusion of core Lib files if (!exclude) { + exclude = shouldExcludeFile(installationType, coreLibFiles, zipEntry, zipEntryName); + } + if (exclude) { + if (Installation.isVerbose()) { + ConsoleInstaller.message("excluding " + zipEntryName); + } + } else { count++; if (count % threshold == 0) { *************** *** 120,129 **** } ! private int approximateNumberOfEntries(String installationType) throws IOException { ! int numberOfEntries = _jarInfo.getNumberOfEntries(); ! if (Installation.MINIMUM.equals(installationType)) { ! numberOfEntries = numberOfEntries / 3; ! } else if (Installation.STANDARD.equals(installationType)) { ! numberOfEntries = (numberOfEntries * 3) / 4; } return numberOfEntries; --- 141,157 ---- } ! private int approximateNumberOfEntries(InstallationType installationType) { ! int numberOfEntries = 65; // core (minimum) ! if (installationType.installLibraryModules()) { ! numberOfEntries += 664; ! } ! if (installationType.installDemosAndExamples()) { ! numberOfEntries += 44; ! } ! if (installationType.installDocumentation()) { ! numberOfEntries += 209; ! } ! if (installationType.installSources()) { ! numberOfEntries += 401; } return numberOfEntries; *************** *** 166,168 **** --- 194,245 ---- } + private List getCoreLibFiles() { + List coreLibFiles = new ArrayList(); + coreLibFiles.add("__future__.py"); + coreLibFiles.add("copy.py"); + coreLibFiles.add("dbexts.py"); + coreLibFiles.add("imaplib.py"); + coreLibFiles.add("isql.py"); + coreLibFiles.add("javaos.py"); + coreLibFiles.add("javapath.py"); + coreLibFiles.add("jreload.py"); + coreLibFiles.add("marshal.py"); + coreLibFiles.add("random.py"); + coreLibFiles.add("re.py"); + coreLibFiles.add("site.py"); + coreLibFiles.add("socket.py"); + coreLibFiles.add("sre.py"); + coreLibFiles.add("sre_compile.py"); + coreLibFiles.add("sre_constants.py"); + coreLibFiles.add("sre_parse.py"); + coreLibFiles.add("string.py"); + coreLibFiles.add("zipfile.py"); + coreLibFiles.add("zlib.py"); + return coreLibFiles; + } + + private boolean shouldExcludeFile(InstallationType installationType, List coreLibFiles, ZipEntry zipEntry, + String zipEntryName) { + boolean exclude = false; + if (!installationType.installLibraryModules()) { + // handle files in Lib + if (!zipEntry.isDirectory() && zipEntryName.startsWith(LIB_NAME_SEP)) { + // include all files in /pawt subdirectory + if (!zipEntryName.startsWith(LIB_PAWT_SEP)) { + if (zipEntryName.endsWith(".py")) { // only compare *.py files + exclude = true; + Iterator coreLibFilesAsIterator = coreLibFiles.iterator(); + while (coreLibFilesAsIterator.hasNext()) { + String coreFileName = (String) coreLibFilesAsIterator.next(); + if (zipEntryName.endsWith(PATH_SEPARATOR + coreFileName)) { + exclude = false; + } + } + } + } + } + } + return exclude; + } + } \ No newline at end of file Index: TypePage.java =================================================================== RCS file: /cvsroot/jython/installer/src/java/org/python/util/install/TypePage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TypePage.java 7 Nov 2005 23:40:43 -0000 1.1 --- TypePage.java 28 Mar 2006 23:25:49 -0000 1.2 *************** *** 49,53 **** protected String getTitle() { ! return Installation.getText(TextKeys.INSTALLATION_TYPE_PROPERTY); } --- 49,53 ---- protected String getTitle() { ! return Installation.getText(TextKeys.INSTALLATION_TYPE); } *************** *** 77,88 **** _standardButton.setText(Installation.getText(TextKeys.STANDARD)); _minimumButton.setText(Installation.getText(TextKeys.MINIMUM)); ! String installationType = FrameInstaller.getInstallationType(); ! if (installationType.equals(Installation.ALL)) { _allButton.setSelected(true); } ! if (installationType.equals(Installation.STANDARD)) { _standardButton.setSelected(true); } ! if (installationType.equals(Installation.MINIMUM)) { _minimumButton.setSelected(true); } --- 77,88 ---- _standardButton.setText(Installation.getText(TextKeys.STANDARD)); _minimumButton.setText(Installation.getText(TextKeys.MINIMUM)); ! InstallationType installationType = FrameInstaller.getInstallationType(); ! if (installationType.isAll()) { _allButton.setSelected(true); } ! if (installationType.isStandard()) { _standardButton.setSelected(true); } ! if (installationType.isMinimum()) { _minimumButton.setSelected(true); } *************** *** 97,101 **** private final static class RadioButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { ! FrameInstaller.setInstallationType(e.getActionCommand()); } } --- 97,110 ---- private final static class RadioButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { ! InstallationType installationType = new InstallationType(); ! String actionCommand = e.getActionCommand(); ! if (Installation.ALL.equals(actionCommand)) { ! installationType.setAll(); ! } else if (Installation.STANDARD.equals(actionCommand)) { ! installationType.setStandard(); ! } else if (Installation.MINIMUM.equals(actionCommand)) { ! installationType.setMinimum(); ! } ! FrameInstaller.setInstallationType(installationType); } } Index: InstallerCommandLine.java =================================================================== RCS file: /cvsroot/jython/installer/src/java/org/python/util/install/InstallerCommandLine.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InstallerCommandLine.java 20 Mar 2006 22:45:36 -0000 1.3 --- InstallerCommandLine.java 28 Mar 2006 23:25:49 -0000 1.4 *************** *** 10,14 **** import org.apache.commons.cli.MissingArgumentException; import org.apache.commons.cli.Option; - import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.OptionGroup; import org.apache.commons.cli.Options; --- 10,13 ---- *************** *** 18,48 **** public class InstallerCommandLine { ! ! private static final String IGNORED_IF_NOT_SILENT = "ignored if not in silent mode"; ! private static final String REQUIRED_IF_SILENT = "required if in silent mode"; ! private static final String NEW_LINE = ";\n"; ! ! private static final String HELP_SHORT = "h"; ! private static final String HELP2_SHORT = "?"; ! private static final String HELP_LONG = "help"; ! private static final String HELP_DESC = "print this help/usage."; private static final String CONSOLE_SHORT = "c"; private static final String CONSOLE_LONG = "console"; ! private static final String CONSOLE_DESC = "do a console based installation (with user interaction)."; private static final String SILENT_SHORT = "s"; private static final String SILENT_LONG = "silent"; ! private static final String SILENT_DESC = "do a silent installation (without user interaction)."; private static final String DIRECTORY_SHORT = "d"; private static final String DIRECTORY_LONG = "directory"; ! private static final String DIRECTORY_DESC = "target directory to install to" + NEW_LINE + REQUIRED_IF_SILENT ! + NEW_LINE + IGNORED_IF_NOT_SILENT + "."; ! ! private static final String JRE_SHORT = "j"; ! private static final String JRE_LONG = "jre"; ! private static final String JRE_DESC = "home directory of the runtime jre, or jdk" + NEW_LINE ! + "executables are assumed in the /bin subdirectory" + NEW_LINE + IGNORED_IF_NOT_SILENT + "."; private static final String DIRECTORY_ARG = "dir"; --- 17,37 ---- public class InstallerCommandLine { ! protected static final String INEXCLUDE_LIBRARY_MODULES = "mod"; ! protected static final String INEXCLUDE_DEMOS_AND_EXAMPLES = "demo"; ! protected static final String INEXCLUDE_DOCUMENTATION = "doc"; ! protected static final String INEXCLUDE_SOURCES = "src"; private static final String CONSOLE_SHORT = "c"; private static final String CONSOLE_LONG = "console"; ! private static final String CONSOLE_DESC = "console based installation (user interaction),\n" ! + "any other options will be ignored (except 'verbose')"; private static final String SILENT_SHORT = "s"; private static final String SILENT_LONG = "silent"; ! private static final String SILENT_DESC = "silent installation (without user interaction)"; private static final String DIRECTORY_SHORT = "d"; private static final String DIRECTORY_LONG = "directory"; ! private static final String DIRECTORY_DESC = "target directory to install to\n" + "(required in silent mode)"; private static final String DIRECTORY_ARG = "dir"; *************** *** 51,74 **** private static final String TYPE_ALL = "all"; private static final String TYPE_MINIMUM = "minimum"; private static final String TYPE_SHORT = "t"; private static final String TYPE_LONG = "type"; private static final String TYPE_ARG = TYPE_LONG; ! private static final String TYPE_DESC = "installation type: " + TYPE_ALL + ", " + TYPE_STANDARD + " or " ! + TYPE_MINIMUM + NEW_LINE + IGNORED_IF_NOT_SILENT + "."; private static final String VERBOSE_SHORT = "v"; private static final String VERBOSE_LONG = "verbose"; ! private static final String VERBOSE_DESC = "print more output."; - private static final String HEADER = "\nthe following options are available:"; private static final String SYNTAX = "\n\tjava -jar jython_version.jar"; private static final String SYNTAX_WITHOUT_JAR = "\n\tjava -jar "; ! private static final String FOOTER = "\nno option at all will start the interactive GUI installer."; ! private static final String EXAMPLES = "\n\nexample of a GUI installation:{0}" + "\n\nexample of a console installation:{0} -" + CONSOLE_SHORT + "\n\nexample of a silent installation:{0} -" + SILENT_SHORT + " -" + DIRECTORY_SHORT + " targetDirectory" ! + "\n\nexample of a silent installation with more options:{0} -" + SILENT_SHORT + " -" + DIRECTORY_SHORT ! + " targetDirectory -" + TYPE_SHORT + " " + TYPE_MINIMUM + " -" + JRE_SHORT + " javaHome -" + VERBOSE_SHORT; private String[] _args; --- 40,98 ---- private static final String TYPE_ALL = "all"; private static final String TYPE_MINIMUM = "minimum"; + private static final String TYPE_STANDALONE = "standalone"; + + private static final String INEXCLUDE_ARG = "part(s)"; + private static final String INEXCLUDE_PARTS = "more than one of the following is possible:\n" + "- " + + INEXCLUDE_LIBRARY_MODULES + ": library modules\n" + "- " + INEXCLUDE_DEMOS_AND_EXAMPLES + + ": demos and examples\n" + "- " + INEXCLUDE_DOCUMENTATION + ": documentation\n" + "- " + + INEXCLUDE_SOURCES + ": java source code"; private static final String TYPE_SHORT = "t"; private static final String TYPE_LONG = "type"; private static final String TYPE_ARG = TYPE_LONG; ! private static final String TYPE_DESC = "installation type\n" + "one of the following types is possible\n" ! + "(see also include/exclude parts):\n" + "- " + TYPE_ALL + ": everything (including " + INEXCLUDE_SOURCES ! + ")\n" + "- " + TYPE_STANDARD + ": core, " + INEXCLUDE_LIBRARY_MODULES + ", " ! + INEXCLUDE_DEMOS_AND_EXAMPLES + ", " + INEXCLUDE_DOCUMENTATION + "\n" + "- " + TYPE_MINIMUM + ": core\n" ! + "- " + TYPE_STANDALONE + ": (not yet implemented)"; // TODO:oti implement standalone ! ! private static final String INCLUDE_SHORT = "i"; ! private static final String INCLUDE_LONG = "include"; ! private static final String INCLUDE_DESC = "finer control over parts to install\n" + INEXCLUDE_PARTS; ! ! private static final String EXCLUDE_SHORT = "e"; ! private static final String EXCLUDE_LONG = "exclude"; ! private static final String EXCLUDE_DESC = "finer control over parts not to install\n" + INEXCLUDE_PARTS ! + "\n(excludes override includes)"; ! ! private static final String JRE_SHORT = "j"; ! private static final String JRE_LONG = "jre"; ! private static final String JRE_DESC = "home directory of the runtime jre or jdk\n" ! + "(executables are assumed in the /bin subdirectory)\n" + "select this if you want to run Jython with a\n" ! + "different java version than the installation"; private static final String VERBOSE_SHORT = "v"; private static final String VERBOSE_LONG = "verbose"; ! private static final String VERBOSE_DESC = "print more output during the installation"; ! ! private static final String HELP_SHORT = "h"; ! private static final String HELP2_SHORT = "?"; ! private static final String HELP_LONG = "help"; ! private static final String HELP_DESC = "print this help (overrides any other options)"; private static final String SYNTAX = "\n\tjava -jar jython_version.jar"; + private static final String HEADER = "\nno option at all (or 'verbose') will start the interactive GUI installer;\n" + + "in non gui mode the following options are available:"; private static final String SYNTAX_WITHOUT_JAR = "\n\tjava -jar "; ! private static final String FOOTER = ""; ! private static final String EXAMPLES = "\nexample of a GUI installation:{0} -" + VERBOSE_SHORT + "\n\nexample of a console installation:{0} -" + CONSOLE_SHORT + "\n\nexample of a silent installation:{0} -" + SILENT_SHORT + " -" + DIRECTORY_SHORT + " targetDirectory" ! + "\n\nexamples of a silent installation with more options:{0} -" + SILENT_SHORT + " -" + DIRECTORY_SHORT ! + " targetDirectory -" + TYPE_SHORT + " " + TYPE_MINIMUM + " -" + INCLUDE_SHORT + " " + INEXCLUDE_SOURCES ! + " -" + JRE_SHORT + " javaHome" + "{0} -" + SILENT_SHORT + " -" + DIRECTORY_SHORT + " targetDirectory -" ! + TYPE_SHORT + " " + TYPE_STANDARD + " -" + EXCLUDE_SHORT + " " + INEXCLUDE_DEMOS_AND_EXAMPLES + " " ! + INEXCLUDE_DOCUMENTATION + "\n\t\t -" + INCLUDE_SHORT + " " + INEXCLUDE_SOURCES + " -" + JRE_SHORT ! + " javaHome -" + VERBOSE_SHORT; private String[] _args; *************** *** 100,104 **** _args = args; try { ! _commandLine = _parser.parse(_options, _args, false); // throw for missing or unknown options / arguments } catch (MissingArgumentException mae) { System.err.println(mae.getMessage()); --- 124,128 ---- _args = args; try { ! _commandLine = _parser.parse(_options, args, false); // throw for missing or unknown options / arguments } catch (MissingArgumentException mae) { System.err.println(mae.getMessage()); *************** *** 113,119 **** return false; } ! if (_commandLine.hasOption(TYPE_SHORT)) { // sufficient even if user chose long opt String type = _commandLine.getOptionValue(TYPE_SHORT); ! if (TYPE_ALL.equals(type) || TYPE_STANDARD.equals(type) || TYPE_MINIMUM.equals(type)) { } else { System.err.println("unrecognized argument '" + type + "' to option: " + TYPE_SHORT + " / " + TYPE_LONG); --- 137,144 ---- return false; } ! if (hasTypeOption()) { String type = _commandLine.getOptionValue(TYPE_SHORT); ! if (TYPE_ALL.equals(type) || TYPE_STANDARD.equals(type) || TYPE_MINIMUM.equals(type) ! || TYPE_STANDALONE.equals(type)) { } else { System.err.println("unrecognized argument '" + type + "' to option: " + TYPE_SHORT + " / " + TYPE_LONG); *************** *** 128,131 **** --- 153,174 ---- } } + if (hasIncludeOption()) { + String[] includeParts = _commandLine.getOptionValues(INCLUDE_SHORT); + for (int i = 0; i < includeParts.length; i++) { + if (!isValidInExcludePart(includeParts[i])) { + System.err.println("unrecognized include part '" + includeParts[i] + "'"); + return false; + } + } + } + if (hasExcludeOption()) { + String[] excludeParts = _commandLine.getOptionValues(EXCLUDE_SHORT); + for (int i = 0; i < excludeParts.length; i++) { + if (!isValidInExcludePart(excludeParts[i])) { + System.err.println("unrecognized exclude part '" + excludeParts[i] + "'"); + return false; + } + } + } return true; } *************** *** 156,159 **** --- 199,210 ---- } + public boolean hasIncludeOption() { + return _commandLine.hasOption(INCLUDE_SHORT) || _commandLine.hasOption(INCLUDE_LONG); + } + + public boolean hasExcludeOption() { + return _commandLine.hasOption(EXCLUDE_SHORT) || _commandLine.hasOption(EXCLUDE_LONG); + } + public boolean hasJavaHomeOption() { return _commandLine.hasOption(JRE_SHORT) || _commandLine.hasOption(JRE_LONG); *************** *** 204,223 **** /** ! * @return the installation type usable for the jar installer, defaults to <code>Installation.STANDARD</code> */ ! public String getInstallationType() { ! String type = Installation.STANDARD; ! String typeName = _commandLine.getOptionValue(TYPE_SHORT); ! if (TYPE_STANDARD.equals(typeName)) { ! type = Installation.STANDARD; ! } else if (TYPE_ALL.equals(typeName)) { ! type = Installation.ALL; ! } else if (TYPE_MINIMUM.equals(typeName)) { ! type = Installation.MINIMUM; ! } else { ! typeName = TYPE_STANDARD; // for the message } ! message(Installation.getText(TextKeys.C_USING_TYPE, typeName)); ! return type; } --- 255,312 ---- /** ! * The Installation type is built out of the type, include and exclude option ! * ! * @return the installation type usable for the jar installer */ ! public InstallationType getInstallationType() { ! InstallationType installationType = new InstallationType(); // defaults to standard ! // build a priori values out of the type option ! if (hasTypeOption()) { ! String typeName = _commandLine.getOptionValue(TYPE_SHORT); ! if (TYPE_ALL.equals(typeName)) { ! installationType.setAll(); ! } else if (TYPE_MINIMUM.equals(typeName)) { ! installationType.setMinimum(); ! } else if (TYPE_STANDALONE.equals(typeName)) { ! installationType.setStandalone(); ! } } ! // add parts to include ! if (hasIncludeOption()) { ! String[] includeParts = _commandLine.getOptionValues(INCLUDE_SHORT); ! for (int i = 0; i < includeParts.length; i++) { ! if (INEXCLUDE_DEMOS_AND_EXAMPLES.equals(includeParts[i])) { ! installationType.addDemosAndExamples(); ! } ! if (INEXCLUDE_DOCUMENTATION.equals(includeParts[i])) { ! installationType.addDocumentation(); ! } ! if (INEXCLUDE_LIBRARY_MODULES.equals(includeParts[i])) { ! installationType.addLibraryModules(); ! } ! if (INEXCLUDE_SOURCES.equals(includeParts[i])) { ! installationType.addSources(); ! } ! } ! } ! // remove parts to exclude ! if (hasExcludeOption()) { ! String[] excludeParts = _commandLine.getOptionValues(EXCLUDE_SHORT); ! for (int i = 0; i < excludeParts.length; i++) { ! if (INEXCLUDE_DEMOS_AND_EXAMPLES.equals(excludeParts[i])) { ! installationType.removeDemosAndExamples(); ! } ! if (INEXCLUDE_DOCUMENTATION.equals(excludeParts[i])) { ! installationType.removeDocumentation(); ! } ! if (INEXCLUDE_LIBRARY_MODULES.equals(excludeParts[i])) { ! installationType.removeLibraryModules(); ! } ! if (INEXCLUDE_SOURCES.equals(excludeParts[i])) { ! installationType.removeSources(); ! } ! } ! } ! return installationType; } *************** *** 228,231 **** --- 317,321 ---- private void createOptions() { _options = new Options(); + _options.setSortAsAdded(true); // console or silent mode *************** *** 238,251 **** // target directory ! _options.addOption(OptionBuilder.withArgName(DIRECTORY_ARG).hasArg().withDescription(DIRECTORY_DESC) ! .withLongOpt(DIRECTORY_LONG).create(DIRECTORY_SHORT)); ! ! // runtime jre ! _options.addOption(OptionBuilder.withArgName(DIRECTORY_ARG).hasArg().withDescription(JRE_DESC).withLongOpt( ! JRE_LONG).create(JRE_SHORT)); // installation type ! _options.addOption(OptionBuilder.withArgName(TYPE_ARG).hasArg().withDescription(TYPE_DESC).withLongOpt( ! TYPE_LONG).create(TYPE_SHORT)); // verbose --- 328,358 ---- // target directory ! Option directoryOption = new Option(DIRECTORY_SHORT, DIRECTORY_LONG, true, DIRECTORY_DESC); ! directoryOption.setArgName(DIRECTORY_ARG); ! _options.addOption(directoryOption); // installation type ! Option typeOption = new Option(TYPE_SHORT, TYPE_LONG, true, TYPE_DESC); ! typeOption.setArgName(TYPE_ARG); ! _options.addOption(typeOption); ! ! // additional parts to include ! Option includeOption = new Option(INCLUDE_SHORT, INCLUDE_DESC); ! includeOption.setArgs(4); ! includeOption.setArgName(INEXCLUDE_ARG); ! includeOption.setLongOpt(INCLUDE_LONG); ! _options.addOption(includeOption); ! ! // parts to exclude ! Option excludeOption = new Option(EXCLUDE_SHORT, EXCLUDE_DESC); ! excludeOption.setArgs(4); ! excludeOption.setArgName(INEXCLUDE_ARG); ! excludeOption.setLongOpt(EXCLUDE_LONG); ! _options.addOption(excludeOption); ! ! // runtime jre ! Option jreOption = new Option(JRE_SHORT, JRE_LONG, true, JRE_DESC); ! jreOption.setArgName(DIRECTORY_ARG); ! _options.addOption(jreOption); // verbose *************** *** 262,267 **** } ! private void message(String message) { ! ConsoleInstaller.message(message); } --- 369,375 ---- } ! private boolean isValidInExcludePart(String part) { ! return INEXCLUDE_DEMOS_AND_EXAMPLES.equals(part) || INEXCLUDE_DOCUMENTATION.equals(part) ! || INEXCLUDE_LIBRARY_MODULES.equals(part) || INEXCLUDE_SOURCES.equals(part); } |