Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 264603 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/build/IXMLConstants.java (+3 lines)
Lines 65-70 Link Here
65
	public static final String TARGET_ROOT_TARGET = "rootTarget"; //$NON-NLS-1$
65
	public static final String TARGET_ROOT_TARGET = "rootTarget"; //$NON-NLS-1$
66
	public static final String TARGET_CUSTOM_ASSEMBLY = "customAssembly"; //$NON-NLS-1$
66
	public static final String TARGET_CUSTOM_ASSEMBLY = "customAssembly"; //$NON-NLS-1$
67
	public static final String TARGET_P2_METADATA = "generate.p2.metadata"; //$NON-NLS-1$
67
	public static final String TARGET_P2_METADATA = "generate.p2.metadata"; //$NON-NLS-1$
68
	public static final String TARGET_RUN_DIRECTOR = "runDirector"; //$NON-NLS-1$
69
68
	// properties
70
	// properties
69
	public static final String PROPERTY_ARCH = "arch"; //$NON-NLS-1$
71
	public static final String PROPERTY_ARCH = "arch"; //$NON-NLS-1$
70
	public static final String PROPERTY_BASE_ARCH = "basearch"; //$NON-NLS-1$
72
	public static final String PROPERTY_BASE_ARCH = "basearch"; //$NON-NLS-1$
Lines 153-158 Link Here
153
	public static final String PROPERTY_OMIT_ROOTFILES = "updateJar.omitRootfiles"; //$NON-NLS-1$
155
	public static final String PROPERTY_OMIT_ROOTFILES = "updateJar.omitRootfiles"; //$NON-NLS-1$
154
	public static final String PROPERTY_GENERATE_API_DESCRIPTION = "generateAPIDescription"; //$NON-NLS-1$
156
	public static final String PROPERTY_GENERATE_API_DESCRIPTION = "generateAPIDescription"; //$NON-NLS-1$
155
	public static final String PROPERTY_BINARY_FOLDERS = "binary.folders"; //$NON-NLS-1$
157
	public static final String PROPERTY_BINARY_FOLDERS = "binary.folders"; //$NON-NLS-1$
158
	public static final String PROPERTY_LAUNCHER_JAR = "equinoxLauncherJar"; //$NON-NLS-1$
156
159
157
	//Jar processor properties
160
	//Jar processor properties
158
	public static final String PROPERTY_SIGN_ALIAS = "sign.alias"; //$NON-NLS-1$
161
	public static final String PROPERTY_SIGN_ALIAS = "sign.alias"; //$NON-NLS-1$
(-)src/org/eclipse/pde/internal/build/P2ConfigScriptGenerator.java (-1 / +1 lines)
Lines 71-78 Link Here
71
		if (product != null) {
71
		if (product != null) {
72
			script.printProperty(PROPERTY_LAUNCHER_NAME, product.getLauncherName());
72
			script.printProperty(PROPERTY_LAUNCHER_NAME, product.getLauncherName());
73
			script.printProperty(PROPERTY_LAUNCHER_PROVIDER, FEATURE_EQUINOX_EXECUTABLE);
73
			script.printProperty(PROPERTY_LAUNCHER_PROVIDER, FEATURE_EQUINOX_EXECUTABLE);
74
			script.printProperty(PROPERTY_P2_BUILD_REPO, "file:" + Utils.getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + "/buildRepo"); //$NON-NLS-1$ //$NON-NLS-2$
75
		}
74
		}
75
		script.printProperty(PROPERTY_P2_BUILD_REPO, "file:" + Utils.getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + "/buildRepo"); //$NON-NLS-1$ //$NON-NLS-2$
76
		script.printProperty(PROPERTY_ASSEMBLY_TMP, Utils.getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + "/tmp"); //$NON-NLS-1$
76
		script.printProperty(PROPERTY_ASSEMBLY_TMP, Utils.getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + "/tmp"); //$NON-NLS-1$
77
		script.println();
77
		script.println();
78
		generateCustomGatherMacro();
78
		generateCustomGatherMacro();
(-)src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java (-1 / +7 lines)
Lines 96-104 Link Here
96
	public static final String PROPERTY_P2_COMPRESS = "p2.compress"; //$NON-NLS-1$
96
	public static final String PROPERTY_P2_COMPRESS = "p2.compress"; //$NON-NLS-1$
97
	public static final String PROPERTY_P2_METADATA_REPO_NAME = "p2.metadata.repo.name"; //$NON-NLS-1$
97
	public static final String PROPERTY_P2_METADATA_REPO_NAME = "p2.metadata.repo.name"; //$NON-NLS-1$
98
	public static final String PROPERTY_P2_ARTIFACT_REPO_NAME = "p2.artifact.repo.name"; //$NON-NLS-1$
98
	public static final String PROPERTY_P2_ARTIFACT_REPO_NAME = "p2.artifact.repo.name"; //$NON-NLS-1$
99
	public static final String PROPERTY_P2_BUILD_REPO = "p2.build.repo"; //$NON-NLS-1$
99
100
	//Internal usage only
100
	//Internal usage only
101
	public static final String PROPERTY_P2_BUILD_REPO = "p2.build.repo"; //$NON-NLS-1$
101
	public static final String PROPERTY_P2_GENERATION_MODE = "p2.generation.mode"; //$NON-NLS-1$
102
	public static final String PROPERTY_P2_GENERATION_MODE = "p2.generation.mode"; //$NON-NLS-1$
103
	public static final String PROPERTY_P2_REPO = "p2.repo"; //$NON-NLS-1$
104
	public static final String PROPERTY_P2_DIRECTOR_IU = "p2.director.iu"; //$NON-NLS-1$
105
	public static final String PROPERTY_P2_DIRECTOR_VERSION = "p2.director.version"; //$NON-NLS-1$
106
	public static final String PROPERTY_P2_DIRECTOR_INSTALLPATH = "p2.director.installPath"; //$NON-NLS-1$
107
102
	public static final String SOURCE_PLUGIN = "sourcePlugin"; //$NON-NLS-1$
108
	public static final String SOURCE_PLUGIN = "sourcePlugin"; //$NON-NLS-1$
103
109
104
	public static final String PROPERTY_PACKAGER_MODE = "packagerMode"; //$NON-NLS-1$
110
	public static final String PROPERTY_PACKAGER_MODE = "packagerMode"; //$NON-NLS-1$
(-)src/org/eclipse/pde/internal/build/IPDEBuildConstants.java (+1 lines)
Lines 39-44 Link Here
39
	public final static String MANIFEST = "MANIFEST.MF"; //$NON-NLS-1$
39
	public final static String MANIFEST = "MANIFEST.MF"; //$NON-NLS-1$
40
40
41
	// default values
41
	// default values
42
	public final static String PROPERTY_GENERIC_TARGETS = "genericTargets"; //$NON-NLS-1$
42
	public final static String DEFAULT_BUILD_SCRIPT_FILENAME = "build.xml"; //$NON-NLS-1$
43
	public final static String DEFAULT_BUILD_SCRIPT_FILENAME = "build.xml"; //$NON-NLS-1$
43
	public final static String DEFAULT_FEATURE_LOCATION = "features"; //$NON-NLS-1$
44
	public final static String DEFAULT_FEATURE_LOCATION = "features"; //$NON-NLS-1$
44
	public final static String DEFAULT_FETCH_SCRIPT_FILENAME = "fetch.xml"; //$NON-NLS-1$
45
	public final static String DEFAULT_FETCH_SCRIPT_FILENAME = "fetch.xml"; //$NON-NLS-1$
(-)src/org/eclipse/pde/internal/build/AssembleConfigScriptGenerator.java (-4 / +35 lines)
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-144 Link Here
139
		script.println();
145
		script.println();
140
	}
146
	}
141
147
148
	protected void generateDirectorCall() {
149
		Map parameters = new HashMap();
150
		parameters.put(PROPERTY_OS, Utils.getPropertyFormat(PROPERTY_OS));
151
		parameters.put(PROPERTY_WS, Utils.getPropertyFormat(PROPERTY_WS));
152
		parameters.put(PROPERTY_ARCH, Utils.getPropertyFormat(PROPERTY_ARCH));
153
		parameters.put(PROPERTY_P2_REPO, Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO));
154
		parameters.put(PROPERTY_P2_DIRECTOR_IU, productFile != null ? productFile.getId() : Utils.getPropertyFormat(PROPERTY_P2_ROOT_NAME));
155
		parameters.put(PROPERTY_P2_DIRECTOR_VERSION, productFile != null ? productFile.getVersion() : Utils.getPropertyFormat(PROPERTY_P2_ROOT_VERSION));
156
		parameters.put(PROPERTY_P2_DIRECTOR_INSTALLPATH, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE));
157
		script.printAntTask(Utils.getPropertyFormat(PROPERTY_GENERIC_TARGETS), null, TARGET_RUN_DIRECTOR, null, TRUE, parameters);
158
		script.println();
159
	}
160
142
	private void generateProcessingCalls() {
161
	private void generateProcessingCalls() {
143
		script.printAntCallTask(TARGET_JAR_PROCESSING, true, null);
162
		script.printAntCallTask(TARGET_JAR_PROCESSING, true, null);
144
		script.println();
163
		script.println();
Lines 334-339 Link Here
334
		script.printProperty(PROPERTY_ECLIPSE_PLUGINS, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_PLUGIN_LOCATION);
353
		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);
354
		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));
355
		script.printProperty(PROPERTY_ARCHIVE_FULLPATH, Utils.getPropertyFormat(PROPERTY_BASEDIR) + '/' + Utils.getPropertyFormat(PROPERTY_BUILD_LABEL) + '/' + Utils.getPropertyFormat(PROPERTY_ARCHIVE_NAME));
356
		printLauncherJarProperty();
357
		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$
358
		script.printAvailableTask(PROPERTY_CUSTOM_ASSEMBLY, "${builder}/customAssembly.xml", "${builder}/customAssembly.xml"); //$NON-NLS-1$ //$NON-NLS-2$
338
359
339
		if (productFile != null && productFile.getLauncherName() != null)
360
		if (productFile != null && productFile.getLauncherName() != null)
Lines 345-350 Link Here
345
		generatePackagingTargets();
366
		generatePackagingTargets();
346
	}
367
	}
347
368
369
	protected void printLauncherJarProperty() {
370
		Bundle launcherBundle = Platform.getBundle(BUNDLE_EQUINOX_LAUNCHER);
371
		try {
372
			File bundleFile = FileLocator.getBundleFile(launcherBundle);
373
			script.printProperty(PROPERTY_LAUNCHER_JAR, bundleFile.getAbsolutePath());
374
		} catch (IOException e) {
375
			// what can we do with this?
376
		}
377
	}
378
348
	protected void generateCustomGatherMacro() {
379
	protected void generateCustomGatherMacro() {
349
		List attributes = new ArrayList(5);
380
		List attributes = new ArrayList(5);
350
		attributes.add("dir"); //$NON-NLS-1$
381
		attributes.add("dir"); //$NON-NLS-1$
(-)src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java (-2 / +2 lines)
Lines 607-614 Link Here
607
		generateAPIToolsCall(getCompiledLocations(), Utils.isStringIn(splitIncludes, EXPANDED_DOT + '/') != -1, Utils.getPropertyFormat(PROPERTY_BUILD_RESULT_FOLDER));
607
		generateAPIToolsCall(getCompiledLocations(), Utils.isStringIn(splitIncludes, EXPANDED_DOT + '/') != -1, Utils.getPropertyFormat(PROPERTY_BUILD_RESULT_FOLDER));
608
608
609
		script.println("<eclipse.gatherBundle "); //$NON-NLS-1$
609
		script.println("<eclipse.gatherBundle "); //$NON-NLS-1$
610
		script.println("   metadataRepository=\"file:${buildDirectory}/buildRepo\""); //$NON-NLS-1$
610
		script.println("   metadataRepository=\"" + Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
611
		script.println("   artifactRepository=\"file:${buildDirectory}/buildRepo\""); //$NON-NLS-1$
611
		script.println("   artifactRepository=\"" + Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
612
		script.println("   buildResultFolder=\"" + Utils.getPropertyFormat(PROPERTY_BUILD_RESULT_FOLDER) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
612
		script.println("   buildResultFolder=\"" + Utils.getPropertyFormat(PROPERTY_BUILD_RESULT_FOLDER) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
613
		script.println("   baseDirectory=\"${basedir}\""); //$NON-NLS-1$
613
		script.println("   baseDirectory=\"${basedir}\""); //$NON-NLS-1$
614
		if (associatedEntry != null && associatedEntry.unpackSet())
614
		if (associatedEntry != null && associatedEntry.unpackSet())
(-)scripts/genericTargets.xml (+38 lines)
Lines 200-203 Link Here
200
	</p2.repo2runnable>
200
	</p2.repo2runnable>
201
</target>
201
</target>
202
202
203
<!-- Invoke the p2 director to perform an install  -->
204
<target name="runDirector" >
205
	<property name="p2.director.bundlepool" value="${p2.director.installPath}"/>
206
	<property name="p2.director.dataArea" value="${p2.director.installPath}/p2"/>
207
	<property name="p2.director.extraArgs" value="-profileProperties org.eclipse.update.install.features=true" />
208
	<property name="p2.director.extraVMArgs" value="-Declipse.p2.MD5Check=false" />
209
	<property name="p2.director.profile" value="profile" />
210
	<property name="p2.director.version" value="" />
211
	<property name="p2.director.log" value="${basedir}/p2.director.log" />
212
	
213
	<echo message="Invoking the p2 director with log file {p2.director.log}" />
214
	<java jar="${equinoxLauncherJar}" fork="true"  failonerror="true">
215
		<arg line="-application org.eclipse.equinox.p2.director.app.application" />
216
		<arg line="-nosplash" />
217
		<arg line="--launcher.suppressErrors" />
218
		<arg line="-consoleLog" />
219
		<arg line="-flavor ${p2.flavor}" />
220
		<arg line="-installIU ${p2.director.iu}" />
221
		<arg line="-version ${p2.director.version}" />
222
		<arg line="-p2.os ${os}" />
223
		<arg line="-p2.ws ${ws}" />
224
		<arg line="-p2.arch ${arch}" />
225
		<arg line="-roaming" />
226
		<arg line="-profile ${p2.director.profile}" />
227
		<arg line="${p2.director.extraArgs}" />
228
		<arg line="-metadataRepository"/>
229
		<arg value="${p2.repo}" />
230
		<arg line="-artifactRepository"/>
231
		<arg value="${p2.repo}" />
232
		<arg line="-destination"/>
233
		<arg value="${p2.director.installPath}" />
234
		<arg line="-bundlepool"/>
235
		<arg value="${p2.director.bundlepool}" />
236
		<arg line="-vmargs" />
237
		<arg value="-Declipse.p2.data.area=${p2.director.dataArea}" />
238
		<arg line="${p2.director.extraVMArgs}" />
239
	</java>
240
</target>
203
</project>
241
</project>
(-)src/org/eclipse/equinox/internal/p2/director/app/Application.java (-5 / +7 lines)
Lines 38-47 Link Here
38
38
39
public class Application implements IApplication {
39
public class Application implements IApplication {
40
	private static final Integer EXIT_ERROR = new Integer(13);
40
	private static final Integer EXIT_ERROR = new Integer(13);
41
	static private String FLAVOR_DEFAULT = "tooling"; //$NON-NLS-1$
41
	static private final String ANT_PROPERTY_PREFIX = "${"; //$NON-NLS-1$
42
	static private String EXEMPLARY_SETUP = "org.eclipse.equinox.p2.exemplarysetup"; //$NON-NLS-1$
42
	static private final String FLAVOR_DEFAULT = "tooling"; //$NON-NLS-1$
43
	static private String FRAMEWORKADMIN_EQUINOX = "org.eclipse.equinox.frameworkadmin.equinox"; //$NON-NLS-1$
43
	static private final String EXEMPLARY_SETUP = "org.eclipse.equinox.p2.exemplarysetup"; //$NON-NLS-1$
44
	static private String SIMPLE_CONFIGURATOR_MANIPULATOR = "org.eclipse.equinox.simpleconfigurator.manipulator"; //$NON-NLS-1$
44
	static private final String FRAMEWORKADMIN_EQUINOX = "org.eclipse.equinox.frameworkadmin.equinox"; //$NON-NLS-1$
45
	static private final String SIMPLE_CONFIGURATOR_MANIPULATOR = "org.eclipse.equinox.simpleconfigurator.manipulator"; //$NON-NLS-1$
45
46
46
	public static final int COMMAND_INSTALL = 0;
47
	public static final int COMMAND_INSTALL = 0;
47
	public static final int COMMAND_UNINSTALL = 1;
48
	public static final int COMMAND_UNINSTALL = 1;
Lines 331-337 Link Here
331
			}
332
			}
332
333
333
			if (opt.equalsIgnoreCase("-version")) { //$NON-NLS-1$
334
			if (opt.equalsIgnoreCase("-version")) { //$NON-NLS-1$
334
				version = new Version(arg);
335
				if (arg != null && !arg.startsWith(ANT_PROPERTY_PREFIX))
336
					version = new Version(arg);
335
			}
337
			}
336
338
337
			if (opt.equalsIgnoreCase(COMMAND_NAMES[COMMAND_UNINSTALL])) {
339
			if (opt.equalsIgnoreCase(COMMAND_NAMES[COMMAND_UNINSTALL])) {

Return to bug 264603