|
Lines 11-16
Link Here
|
| 11 |
package org.eclipse.pde.internal.build; |
11 |
package org.eclipse.pde.internal.build; |
| 12 |
|
12 |
|
| 13 |
import java.io.File; |
13 |
import java.io.File; |
|
|
14 |
import java.io.IOException; |
| 14 |
import java.util.*; |
15 |
import java.util.*; |
| 15 |
import java.util.jar.JarFile; |
16 |
import java.util.jar.JarFile; |
| 16 |
import org.eclipse.core.runtime.*; |
17 |
import org.eclipse.core.runtime.*; |
|
Lines 20-25
Link Here
|
| 20 |
import org.eclipse.pde.internal.build.builder.BuildDirector; |
21 |
import org.eclipse.pde.internal.build.builder.BuildDirector; |
| 21 |
import org.eclipse.pde.internal.build.builder.ModelBuildScriptGenerator; |
22 |
import org.eclipse.pde.internal.build.builder.ModelBuildScriptGenerator; |
| 22 |
import org.eclipse.pde.internal.build.site.BuildTimeFeature; |
23 |
import org.eclipse.pde.internal.build.site.BuildTimeFeature; |
|
|
24 |
import org.osgi.framework.Bundle; |
| 23 |
|
25 |
|
| 24 |
/** |
26 |
/** |
| 25 |
* Generate an assemble script for a given feature and a given config. It |
27 |
* Generate an assemble script for a given feature and a given config. It |
|
Lines 119-128
Link Here
|
| 119 |
|
121 |
|
| 120 |
generateMainBegin(); |
122 |
generateMainBegin(); |
| 121 |
generateInitializationSteps(); |
123 |
generateInitializationSteps(); |
| 122 |
generateGatherCalls(); |
124 |
if (BuildDirector.p2Gathering) { |
| 123 |
generateProcessingCalls(); |
125 |
generateDirectorCall(); |
| 124 |
generateBrandingCalls(); |
126 |
} else { |
| 125 |
generateP2Steps(); |
127 |
generateGatherCalls(); |
|
|
128 |
generateProcessingCalls(); |
| 129 |
generateBrandingCalls(); |
| 130 |
generateP2Steps(); |
| 131 |
} |
| 126 |
generateArchivingCalls(); |
132 |
generateArchivingCalls(); |
| 127 |
generateMainEnd(); |
133 |
generateMainEnd(); |
| 128 |
|
134 |
|
|
Lines 139-152
Link Here
|
| 139 |
script.println(); |
145 |
script.println(); |
| 140 |
} |
146 |
} |
| 141 |
|
147 |
|
|
|
148 |
protected void generateDirectorCall() { |
| 149 |
script.printAntCallTask(TARGET_RUN_DIRECTOR, true, null); |
| 150 |
} |
| 151 |
|
| 152 |
protected void generateDirectorTarget(boolean assembling) { |
| 153 |
script.printTargetDeclaration(TARGET_RUN_DIRECTOR, null, null, assembling ? PROPERTY_RUN_PACKAGER : null, null); |
| 154 |
Map parameters = new HashMap(); |
| 155 |
parameters.put(PROPERTY_OS, Utils.getPropertyFormat(PROPERTY_OS)); |
| 156 |
parameters.put(PROPERTY_WS, Utils.getPropertyFormat(PROPERTY_WS)); |
| 157 |
parameters.put(PROPERTY_ARCH, Utils.getPropertyFormat(PROPERTY_ARCH)); |
| 158 |
parameters.put(PROPERTY_P2_REPO, Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO)); |
| 159 |
parameters.put(PROPERTY_P2_DIRECTOR_IU, productFile != null ? productFile.getId() : Utils.getPropertyFormat(PROPERTY_P2_ROOT_NAME)); |
| 160 |
parameters.put(PROPERTY_P2_DIRECTOR_VERSION, productFile != null ? productFile.getVersion() : Utils.getPropertyFormat(PROPERTY_P2_ROOT_VERSION)); |
| 161 |
parameters.put(PROPERTY_P2_DIRECTOR_INSTALLPATH, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE)); |
| 162 |
script.printAntTask(Utils.getPropertyFormat(PROPERTY_GENERIC_TARGETS), null, TARGET_RUN_DIRECTOR, null, TRUE, parameters); |
| 163 |
script.println(); |
| 164 |
script.printTargetEnd(); |
| 165 |
} |
| 166 |
|
| 142 |
private void generateProcessingCalls() { |
167 |
private void generateProcessingCalls() { |
| 143 |
script.printAntCallTask(TARGET_JAR_PROCESSING, true, null); |
168 |
script.printAntCallTask(TARGET_JAR_PROCESSING, true, null); |
| 144 |
script.println(); |
169 |
script.println(); |
| 145 |
} |
170 |
} |
| 146 |
|
171 |
|
| 147 |
private void generateArchivingCalls() { |
172 |
private void generateArchivingCalls() { |
| 148 |
if (!BuildDirector.p2Gathering) |
173 |
script.printAntCallTask(TARGET_ASSEMBLE_ARCHIVE, true, null); |
| 149 |
script.printAntCallTask(TARGET_ASSEMBLE_ARCHIVE, true, null); |
|
|
| 150 |
} |
174 |
} |
| 151 |
|
175 |
|
| 152 |
protected void generateMainBegin() { |
176 |
protected void generateMainBegin() { |
|
Lines 175-182
Link Here
|
| 175 |
script.println(); |
199 |
script.println(); |
| 176 |
} |
200 |
} |
| 177 |
|
201 |
|
| 178 |
private void generateArchivingTarget() { |
202 |
protected void generateArchivingTarget(boolean assembling) { |
| 179 |
script.printTargetDeclaration(TARGET_ASSEMBLE_ARCHIVE, null, null, null, null); |
203 |
script.printTargetDeclaration(TARGET_ASSEMBLE_ARCHIVE, null, null, assembling ? PROPERTY_RUN_PACKAGER : null, null); |
| 180 |
Map properties = new HashMap(); |
204 |
Map properties = new HashMap(); |
| 181 |
properties.put(PROPERTY_ROOT_FOLDER, rootFolder); |
205 |
properties.put(PROPERTY_ROOT_FOLDER, rootFolder); |
| 182 |
printCustomAssemblyAntCall(PROPERTY_PRE + "archive", properties); //$NON-NLS-1$ |
206 |
printCustomAssemblyAntCall(PROPERTY_PRE + "archive", properties); //$NON-NLS-1$ |
|
Lines 334-339
Link Here
|
| 334 |
script.printProperty(PROPERTY_ECLIPSE_PLUGINS, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_PLUGIN_LOCATION); |
358 |
script.printProperty(PROPERTY_ECLIPSE_PLUGINS, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_PLUGIN_LOCATION); |
| 335 |
script.printProperty(PROPERTY_ECLIPSE_FEATURES, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_FEATURE_LOCATION); |
359 |
script.printProperty(PROPERTY_ECLIPSE_FEATURES, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_FEATURE_LOCATION); |
| 336 |
script.printProperty(PROPERTY_ARCHIVE_FULLPATH, Utils.getPropertyFormat(PROPERTY_BASEDIR) + '/' + Utils.getPropertyFormat(PROPERTY_BUILD_LABEL) + '/' + Utils.getPropertyFormat(PROPERTY_ARCHIVE_NAME)); |
360 |
script.printProperty(PROPERTY_ARCHIVE_FULLPATH, Utils.getPropertyFormat(PROPERTY_BASEDIR) + '/' + Utils.getPropertyFormat(PROPERTY_BUILD_LABEL) + '/' + Utils.getPropertyFormat(PROPERTY_ARCHIVE_NAME)); |
|
|
361 |
printLauncherJarProperty(); |
| 362 |
script.printProperty(PROPERTY_P2_BUILD_REPO, "file:" + Utils.getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + "/buildRepo"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 337 |
script.printAvailableTask(PROPERTY_CUSTOM_ASSEMBLY, "${builder}/customAssembly.xml", "${builder}/customAssembly.xml"); //$NON-NLS-1$ //$NON-NLS-2$ |
363 |
script.printAvailableTask(PROPERTY_CUSTOM_ASSEMBLY, "${builder}/customAssembly.xml", "${builder}/customAssembly.xml"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 338 |
|
364 |
|
| 339 |
if (productFile != null && productFile.getLauncherName() != null) |
365 |
if (productFile != null && productFile.getLauncherName() != null) |
|
Lines 345-350
Link Here
|
| 345 |
generatePackagingTargets(); |
371 |
generatePackagingTargets(); |
| 346 |
} |
372 |
} |
| 347 |
|
373 |
|
|
|
374 |
protected void printLauncherJarProperty() { |
| 375 |
Bundle launcherBundle = Platform.getBundle(BUNDLE_EQUINOX_LAUNCHER); |
| 376 |
try { |
| 377 |
File bundleFile = FileLocator.getBundleFile(launcherBundle); |
| 378 |
script.printProperty(PROPERTY_LAUNCHER_JAR, bundleFile.getAbsolutePath()); |
| 379 |
} catch (IOException e) { |
| 380 |
// what can we do with this? |
| 381 |
} |
| 382 |
} |
| 383 |
|
| 348 |
protected void generateCustomGatherMacro() { |
384 |
protected void generateCustomGatherMacro() { |
| 349 |
List attributes = new ArrayList(5); |
385 |
List attributes = new ArrayList(5); |
| 350 |
attributes.add("dir"); //$NON-NLS-1$ |
386 |
attributes.add("dir"); //$NON-NLS-1$ |
|
Lines 367-373
Link Here
|
| 367 |
script.println(); |
403 |
script.println(); |
| 368 |
} |
404 |
} |
| 369 |
|
405 |
|
| 370 |
private void printCustomGatherCall(String fullName, String dir, String propertyName, String propertyValue, String subFolder) { |
406 |
protected void printCustomGatherCall(String fullName, String dir, String propertyName, String propertyValue, String subFolder) { |
| 371 |
script.println("<" + PROPERTY_CUSTOM_GATHER + " dir=\"" + dir + "\" projectName=\"" + fullName + "\" propertyName=\"" + propertyName + "\" propertyValue=\"" + propertyValue + "\" subFolder=\"" + (subFolder != null ? subFolder : "") + "\" />"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ |
407 |
script.println("<" + PROPERTY_CUSTOM_GATHER + " dir=\"" + dir + "\" projectName=\"" + fullName + "\" propertyName=\"" + propertyName + "\" propertyValue=\"" + propertyValue + "\" subFolder=\"" + (subFolder != null ? subFolder : "") + "\" />"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ |
| 372 |
} |
408 |
} |
| 373 |
|
409 |
|
|
Lines 492-504
Link Here
|
| 492 |
if (embeddedSource) |
528 |
if (embeddedSource) |
| 493 |
generateGatherSourceTarget(); |
529 |
generateGatherSourceTarget(); |
| 494 |
generatePostProcessingTarget(); |
530 |
generatePostProcessingTarget(); |
| 495 |
generateArchivingTarget(); |
531 |
generateArchivingTarget(true); |
| 496 |
|
532 |
|
| 497 |
if (FORMAT_TAR.equalsIgnoreCase(archiveFormat)) |
533 |
if (FORMAT_TAR.equalsIgnoreCase(archiveFormat)) |
| 498 |
generateGZipTarget(true); |
534 |
generateGZipTarget(true); |
| 499 |
|
535 |
|
| 500 |
generateCustomAssemblyTarget(); |
536 |
generateCustomAssemblyTarget(); |
| 501 |
generateMetadataTarget(); |
537 |
generateMetadataTarget(); |
|
|
538 |
generateDirectorTarget(true); |
| 502 |
|
539 |
|
| 503 |
script.printProjectEnd(); |
540 |
script.printProjectEnd(); |
| 504 |
script.close(); |
541 |
script.close(); |