/** * Sets the destination directory to the base directory if it is not set explicitly. */ private void checkDest() { if (destDir == null) { destDir = baseDir; log("destdir defaulting to basedir", Project.MSG_DEBUG); } }
/** * Sets the destination directory to the base directory if it is not set explicitly. */ private void checkDest() { if (destDir == null) { destDir = baseDir; log("destdir defaulting to basedir", Project.MSG_DEBUG); } }
protected void handleError(String msg) { if (failOnError) { throw new BuildException(msg, getLocation()); } log(msg, Project.MSG_WARN); }
protected void handleError(String msg) { if (failOnError) { throw new BuildException(msg, getLocation()); } log(msg, Project.MSG_WARN); }
/** * Work with an instance of a <option> element already configured by Ant. * * @param option the configured Option */ public void addConfiguredOption(Option option) { if (!option.shouldUse()) { log("Skipping option '" + option.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } options.add(option); }
/** * Work with an instance of a <parameter> element already configured by Ant. * * @param parameter the configured Parameter */ public void addConfiguredParameter(Parameter parameter) { if (!parameter.shouldUse()) { log("Skipping parameter '" + parameter.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } parameters.add(parameter); }
/** * Work with an instance of a <option> element already configured by Ant. * * @param option the configured Option */ public void addConfiguredOption(Option option) { if (!option.shouldUse()) { log("Skipping option '" + option.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } options.add(option); }
/** * Work with an instance of a <parameter> element already configured by Ant. * * @param parameter the configured Parameter */ public void addConfiguredParameter(Parameter parameter) { if (!parameter.shouldUse()) { log("Skipping parameter '" + parameter.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } parameters.add(parameter); }
/** * Add a nested {@code <step>} element. * * @param step the configured Step object represented as {@code <step>}. */ public void addConfiguredStep(Step step) { if (!step.shouldUse()) { log("Skipping step '" + step.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } if (step.getName() == null) { handleError("Steps must have their 'name' attribute set"); } steps.add(step); }
/** * Add a nested {@code <step>} element. * * @param step the configured Step object represented as {@code <step>}. */ public void addConfiguredStep(Step step) { if (!step.shouldUse()) { log("Skipping step '" + step.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } if (step.getName() == null) { handleError("Steps must have their 'name' attribute set"); } steps.add(step); }
/** * Add a nested <pipeline> element. * * @param pipeline the configured Resources object represented as <pipeline>. */ public void addConfiguredPipeline(UseableResources pipeline) { if (!pipeline.shouldUse()) { log("Skipping pipeline as it is configured to be unused.", Project.MSG_DEBUG); return; } if (pipeline.size() == 0) { return; } if (pipeline.size() > 1) { handleError("The pipeline element must be specified with at most one nested resource."); } setPipeline((Resource) pipeline.iterator().next()); }
/** * Add a nested {@code <saxonConfig>} element. * * @param saxonConfig the configured Resources object represented as {@code <saxonConfig>} */ public void addConfiguredSaxonConfig(UseableResources saxonConfig) { if (!saxonConfig.shouldUse()) { log("Skipping saxonConfig as it is configured to be unused.", Project.MSG_DEBUG); return; } if (saxonConfig.size() == 0) { return; } if (saxonConfig.size() > 1) { handleError("The saxonConfig element must be specified with at most one nested resource."); } setSaxonConfigFile((Resource) saxonConfig.iterator().next()); }
/** * Add a nested {@code <profile>} element. * * @param profile the configured Resources object represented as {@code <profile>} */ public void addConfiguredProfile(UseableResources profile) { if (!profile.shouldUse()) { log("Skipping profile as it is configured to be unused.", Project.MSG_DEBUG); return; } if (profile.size() == 0) { return; } if (profile.size() > 1) { handleError("The profile element must be specified with at most one nested resource."); } setProfileFile((Resource) profile.iterator().next()); }
/** * Add a nested {@code <config>} element. * * @param config the configured Resources object represented as {@code <config>} */ public void addConfiguredConfig(UseableResources config) { if (!config.shouldUse()) { log("Skipping config as it is configured to be unused.", Project.MSG_DEBUG); return; } if (config.size() == 0) { return; } if (config.size() > 1) { handleError("The config element must be specified with at most one nested resource."); } setConfigFile((Resource) config.iterator().next()); }
/** * Use an {@code <option>} element. * * @param option the Option */ public void useOption(Option option) { if (!option.shouldUse()) { log("Skipping option '" + option.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } try { userArgs.addOption(option.getName(), option.getValue()); } catch (Exception e) { handleError(e); } }
/** * Use an {@code <option>} element. * * @param option the Option */ public void useOption(Option option) { if (!option.shouldUse()) { log("Skipping option '" + option.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } try { userArgs.addOption(option.getName(), option.getValue()); } catch (Exception e) { handleError(e); } }
/** * Use a {@code <parameter>} element. * * @param parameter the Parameter */ public void useParameter(Parameter parameter) { if (!parameter.shouldUse()) { log("Skipping parameter '" + parameter.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } try { userArgs.addParam(parameter.getPort(), parameter.getName(), parameter.getValue()); } catch (Exception e) { handleError(e); } }
/** * Use a {@code <parameter>} element. * * @param parameter the Parameter */ public void useParameter(Parameter parameter) { if (!parameter.shouldUse()) { log("Skipping parameter '" + parameter.getName() + "' as it is configured to be unused.", Project.MSG_DEBUG); return; } try { userArgs.addParam(parameter.getPort(), parameter.getName(), parameter.getValue()); } catch (Exception e) { handleError(e); } }