/*
* final PluginRegistry piRegistry; piRegistry = new
* PluginRegistryModel(piList.getDescriptorUrlList());
*/
final Jar jarTask = new Jar();
jarTask.setProject(getProject());
jarTask.setTaskName(getTaskName());
jarTask.setDestFile(tmpFile);
jarTask.setCompress(false);
final Manifest mf = piList.getManifest();
if (mf != null) {
jarTask.addConfiguredManifest(mf);
}
final URL[] systemPlugins = systemPluginList.getPluginList();
final ArrayList<PluginJar> pluginJars = new ArrayList<PluginJar>();
for (URL url : systemPlugins) {
final BuildPluginJar piJar = new BuildPluginJar(url);
if (!piJar.getDescriptor().isSystemPlugin()) {
log("Non-system plugin " + piJar.getDescriptor().getId()
+ " in plugin-list will be ignored",
Project.MSG_WARN);
} else {
pluginJars.add(piJar);
}
}
final URL[] pluginList = piList.getPluginList();
for (URL url : pluginList) {
final BuildPluginJar piJar = new BuildPluginJar(url);
if (piJar.getDescriptor().isSystemPlugin()) {
log("System plugin " + piJar.getDescriptor().getId()
+ " in plugin-list will be ignored",
Project.MSG_WARN);
} else {
pluginJars.add(piJar);
}
}
testPluginPrerequisites(pluginJars);
final List<PluginJar> sortedPluginJars = sortPlugins(pluginJars);
for (Iterator<PluginJar> i = sortedPluginJars.iterator(); i
.hasNext();) {
final BuildPluginJar piJar = (BuildPluginJar) i.next();
if (!piJar.getDescriptor().isSystemPlugin()) {
// pluginJars.add(piJar);
final File f = new File(piJar.getPluginUrl().getPath());
final FileSet fs = new FileSet();
fs.setDir(f.getParentFile());
fs.setIncludes(f.getName());
jarTask.addFileset(fs);
}
}
/*
* for (Iterator i = piRegistry.getDescriptorIterator();
* i.hasNext(); ) { final PluginDescriptor descr =
* (PluginDescriptor)i.next(); final Runtime rt =
* descr.getRuntime(); if (rt != null) { final Library[] libs =
* rt.getLibraries(); for (int l = 0; l < libs.length; l++) {
* processLibrary(jarTask, libs[l], fileSets, getPluginDir()); } }
*/
// Now create the jar file
jarTask.execute();
// Now zip it
final GZip gzipTask = new GZip();
gzipTask.setProject(getProject());
gzipTask.setTaskName(getTaskName());