View | Details | Raw Unified | Return to bug 264603 | Differences between
and this patch

Collapse All | Expand All

(-)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])) {
(-)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/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/P2ConfigScriptGenerator.java (-5 / +80 lines)
Lines 9-18 Link Here
9
9
10
package org.eclipse.pde.internal.build;
10
package org.eclipse.pde.internal.build;
11
11
12
import java.io.File;
12
import java.util.*;
13
import java.util.*;
13
import org.eclipse.core.runtime.CoreException;
14
import org.eclipse.core.runtime.*;
14
import org.eclipse.osgi.service.resolver.BundleDescription;
15
import org.eclipse.osgi.service.resolver.BundleDescription;
16
import org.eclipse.pde.internal.build.ant.AntScript;
17
import org.eclipse.pde.internal.build.ant.FileSet;
15
import org.eclipse.pde.internal.build.site.BuildTimeFeature;
18
import org.eclipse.pde.internal.build.site.BuildTimeFeature;
19
import org.eclipse.pde.internal.build.site.BuildTimeSite;
20
import org.eclipse.pde.internal.build.site.compatibility.FeatureEntry;
16
21
17
public class P2ConfigScriptGenerator extends AssembleConfigScriptGenerator {
22
public class P2ConfigScriptGenerator extends AssembleConfigScriptGenerator {
18
	private AssemblyInformation assemblyInformation = null;
23
	private AssemblyInformation assemblyInformation = null;
Lines 32-45 Link Here
32
		initializeCollections();
37
		initializeCollections();
33
38
34
		try {
39
		try {
35
			openScript(directory, "assemble." + featureId + ".p2.xml"); //$NON-NLS-1$ //$NON-NLS-2$
40
			String prefix = assembling ? "assemble." : "package."; //$NON-NLS-1$ //$NON-NLS-2$
41
			openScript(directory, prefix + featureId + ".p2.xml"); //$NON-NLS-1$
36
		} catch (CoreException e) {
42
		} catch (CoreException e) {
37
			return;
43
			return;
38
		}
44
		}
39
		generatePrologue();
45
		generatePrologue();
40
		generateMainBegin();
46
		generateMainBegin();
41
		generateGatherCalls();
47
		generateGatherCalls();
42
		generateBrandingCalls();
43
		generateMetadataCalls();
48
		generateMetadataCalls();
44
		generateMainEnd();
49
		generateMainEnd();
45
50
Lines 110-133 Link Here
110
			}
115
			}
111
		}
116
		}
112
		script.printDeleteTask(Utils.getPropertyFormat(PROPERTY_ASSEMBLY_TMP) + "/p2.branding", null, null); //$NON-NLS-1$
117
		script.printDeleteTask(Utils.getPropertyFormat(PROPERTY_ASSEMBLY_TMP) + "/p2.branding", null, null); //$NON-NLS-1$
118
		script.println();
113
	}
119
	}
114
120
115
	protected void generateMetadataTarget() {
121
	protected void generateMetadataTarget() {
116
		script.printTargetDeclaration(TARGET_P2_METADATA, null, null, null, null);
122
		script.printTargetDeclaration(TARGET_P2_METADATA, null, null, assembling ? PROPERTY_RUN_PACKAGER : null, null);
123
124
		generateBrandingCalls();
117
125
118
		ProductFile product = getProductFile();
126
		ProductFile product = getProductFile();
119
		if (product != null) {
127
		if (product != null) {
128
129
			String productPath = product.getLocation();
130
			String productDir = getWorkingDirectory() + '/' + DEFAULT_FEATURE_LOCATION + '/' + CONTAINER_FEATURE + "/product"; //$NON-NLS-1$
131
			File productFile = new File(productPath);
132
			String newProduct = new File(productDir, productFile.getName()).getAbsolutePath();
133
			script.printCopyFileTask(productPath, newProduct, true);
134
135
			File parent = new File(productPath).getParentFile();
136
			File p2Inf = new File(parent, "p2.inf"); //$NON-NLS-1$
137
			if (p2Inf.exists())
138
				script.printCopyTask(p2Inf.getAbsolutePath(), productDir, null, false, true);
139
			generateProductReplaceTask(product, newProduct);
140
			productPath = newProduct;
141
120
			script.printTab();
142
			script.printTab();
121
			script.print("<p2.publish.product "); //$NON-NLS-1$
143
			script.print("<p2.publish.product "); //$NON-NLS-1$
122
			script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
144
			script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
123
			script.printAttribute("repository", Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO), true); //$NON-NLS-1$ 
145
			script.printAttribute("repository", Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO), true); //$NON-NLS-1$ 
124
			script.printAttribute("productFile", product.getLocation(), true); //$NON-NLS-1$
146
			script.printAttribute("productFile", newProduct, true); //$NON-NLS-1$
125
			script.println("/>"); //$NON-NLS-1$
147
			script.println("/>"); //$NON-NLS-1$
126
		}
148
		}
127
		script.printTargetEnd();
149
		script.printTargetEnd();
128
	}
150
	}
129
151
152
	//TODO this is duplicated from AssembleScriptGenerator
153
	protected void generateProductReplaceTask(ProductFile product, String productDirectory) {
154
		if (product == null)
155
			return;
156
157
		BuildTimeSite site = null;
158
		try {
159
			site = getSite(false);
160
		} catch (CoreException e1) {
161
			return;
162
		}
163
164
		List productEntries = product.getProductEntries();
165
		String mappings = Utils.getEntryVersionMappings((FeatureEntry[]) productEntries.toArray(new FeatureEntry[productEntries.size()]), site);
166
		script.println("<eclipse.idReplacer productFilePath=\"" + AntScript.getEscaped(productDirectory) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
167
		script.println("                    selfVersion=\"" + product.getVersion() + "\" "); //$NON-NLS-1$ //$NON-NLS-2$
168
		if (product.useFeatures())
169
			script.println("                    featureIds=\"" + mappings + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
170
		else
171
			script.println("                    pluginIds=\"" + mappings + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ 
172
173
		return;
174
	}
175
130
	protected void generateEpilogue() {
176
	protected void generateEpilogue() {
131
		script.printProjectEnd();
177
		script.printProjectEnd();
132
	}
178
	}
179
180
	protected void generateGatherBinPartsTarget() {
181
		if (assembling) {
182
			super.generateGatherBinPartsTarget();
183
			return;
184
		}
185
186
		script.printTargetDeclaration(TARGET_GATHER_BIN_PARTS, null, null, null, null);
187
188
		ArrayList p2Features = new ArrayList();
189
		ArrayList p2Bundles = new ArrayList();
190
		for (int i = 0; i < plugins.length; i++) {
191
			Path pluginLocation = new Path(plugins[i].getLocation());
192
			p2Bundles.add(new FileSet(pluginLocation.removeLastSegments(1).toOSString(), null, pluginLocation.lastSegment(), null, null, null, null));
193
194
		}
195
196
		for (int i = 0; i < features.length; i++) {
197
			IPath featureLocation = new Path(features[i].getURL().getPath());
198
			featureLocation = featureLocation.removeLastSegments(1);
199
			p2Features.add(new FileSet(featureLocation.removeLastSegments(1).toOSString(), null, featureLocation.lastSegment(), null, null, null, null));
200
		}
201
202
		String repo = Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO);
203
		script.printP2PublishFeaturesAndBundles(repo, repo, (FileSet[]) p2Bundles.toArray(new FileSet[p2Bundles.size()]), (FileSet[]) p2Features.toArray(new FileSet[p2Features.size()]), Utils.getPropertyFormat(PROPERTY_P2_CATEGORY_SITE));
204
205
		script.printTargetEnd();
206
		script.println();
207
	}
133
}
208
}
(-)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/AssembleScriptGenerator.java (-1 / +5 lines)
Lines 110-116 Link Here
110
				basicGenerateAssembleConfigFileTargetCall(current, configInfo[0], configInfo[1], configInfo[2], configInfo[3]);
110
				basicGenerateAssembleConfigFileTargetCall(current, configInfo[0], configInfo[1], configInfo[2], configInfo[3]);
111
			}
111
			}
112
		}
112
		}
113
		if (configScriptGenerator.haveP2Bundles())
113
		if (configScriptGenerator.haveP2Bundles() && !BuildDirector.p2Gathering)
114
			script.printAntCallTask(TARGET_P2_METADATA, true, null);
114
			script.printAntCallTask(TARGET_P2_METADATA, true, null);
115
		script.printTargetEnd();
115
		script.printTargetEnd();
116
	}
116
	}
Lines 125-130 Link Here
125
		p2ConfigGenerator.initialize(directory, featureId);
125
		p2ConfigGenerator.initialize(directory, featureId);
126
		p2ConfigGenerator.generate();
126
		p2ConfigGenerator.generate();
127
127
128
		script.printTab();
128
		script.print("<assemble "); //$NON-NLS-1$
129
		script.print("<assemble "); //$NON-NLS-1$
129
		script.printAttribute("config", "p2", true); //$NON-NLS-1$ //$NON-NLS-2$
130
		script.printAttribute("config", "p2", true); //$NON-NLS-1$ //$NON-NLS-2$
130
		script.printAttribute("element", p2ConfigGenerator.getTargetElement(), true); //$NON-NLS-1$
131
		script.printAttribute("element", p2ConfigGenerator.getTargetElement(), true); //$NON-NLS-1$
Lines 141-146 Link Here
141
		configScriptGenerator.setGroupConfigs(groupConfigs);
142
		configScriptGenerator.setGroupConfigs(groupConfigs);
142
		configScriptGenerator.generate();
143
		configScriptGenerator.generate();
143
144
145
		script.printTab();
144
		script.print("<assemble "); //$NON-NLS-1$
146
		script.print("<assemble "); //$NON-NLS-1$
145
		String config = configScriptGenerator.getTargetConfig();
147
		String config = configScriptGenerator.getTargetConfig();
146
		script.printAttribute("config", config, true); //$NON-NLS-1$
148
		script.printAttribute("config", config, true); //$NON-NLS-1$
Lines 151-156 Link Here
151
	}
153
	}
152
154
153
	protected void generateMetadataTarget() {
155
	protected void generateMetadataTarget() {
156
		if (BuildDirector.p2Gathering)
157
			return;
154
		if (configScriptGenerator.haveP2Bundles()) {
158
		if (configScriptGenerator.haveP2Bundles()) {
155
			script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, PROPERTY_RUN_PACKAGER, null);
159
			script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, PROPERTY_RUN_PACKAGER, null);
156
160
(-)src/org/eclipse/pde/internal/build/AssembleConfigScriptGenerator.java (-10 / +47 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-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();
(-)src/org/eclipse/pde/internal/build/ant/AntScript.java (+1 lines)
Lines 102-107 Link Here
102
			bundles[i].printAs("bundles", this); //$NON-NLS-1$
102
			bundles[i].printAs("bundles", this); //$NON-NLS-1$
103
		}
103
		}
104
		indent--;
104
		indent--;
105
		printTab();
105
		output.println("</eclipse.publish.featuresAndBundles>"); //$NON-NLS-1$
106
		output.println("</eclipse.publish.featuresAndBundles>"); //$NON-NLS-1$
106
	}
107
	}
107
108
(-)src/org/eclipse/pde/internal/build/packager/PackageScriptGenerator.java (-1 / +13 lines)
Lines 47-53 Link Here
47
	}
47
	}
48
48
49
	protected void generateP2ConfigFileTargetCall() {
49
	protected void generateP2ConfigFileTargetCall() {
50
		//empty
50
		P2ConfigScriptGenerator p2ConfigGenerator = new P2ConfigScriptGenerator(assemblageInformation, false);
51
		p2ConfigGenerator.setProduct(productLocation);
52
		p2ConfigGenerator.initialize(directory, featureId);
53
		p2ConfigGenerator.generate();
54
55
		script.printTab();
56
		script.print("<assemble "); //$NON-NLS-1$
57
		script.printAttribute("config", "p2", true); //$NON-NLS-1$ //$NON-NLS-2$
58
		script.printAttribute("element", p2ConfigGenerator.getTargetElement(), true); //$NON-NLS-1$
59
		script.printAttribute("dot", ".", true); //$NON-NLS-1$ //$NON-NLS-2$
60
		script.printAttribute("scriptPrefix", "package", true); //$NON-NLS-1$ //$NON-NLS-2$
61
		script.println("/>"); //$NON-NLS-1$
51
	}
62
	}
52
63
53
	protected void basicGenerateAssembleConfigFileTargetCall(Config aConfig, Collection binaryPlugins, Collection binaryFeatures, Collection allFeatures, Collection rootFiles) throws CoreException {
64
	protected void basicGenerateAssembleConfigFileTargetCall(Config aConfig, Collection binaryPlugins, Collection binaryFeatures, Collection allFeatures, Collection rootFiles) throws CoreException {
Lines 59-64 Link Here
59
		configScriptGenerator.setBuildSiteFactory(siteFactory);
70
		configScriptGenerator.setBuildSiteFactory(siteFactory);
60
		configScriptGenerator.generate();
71
		configScriptGenerator.generate();
61
72
73
		script.printTab();
62
		script.print("<assemble "); //$NON-NLS-1$
74
		script.print("<assemble "); //$NON-NLS-1$
63
		String config = configScriptGenerator.getTargetConfig();
75
		String config = configScriptGenerator.getTargetConfig();
64
		script.printAttribute("config", config, true); //$NON-NLS-1$
76
		script.printAttribute("config", config, true); //$NON-NLS-1$
(-)src/org/eclipse/pde/internal/build/packager/PackageConfigScriptGenerator.java (+8 lines)
Lines 183-188 Link Here
183
		super.generateTarGZTasks(false);
183
		super.generateTarGZTasks(false);
184
	}
184
	}
185
185
186
	protected void generateDirectorTarget(boolean assembling) {
187
		super.generateDirectorTarget(false);
188
	}
189
190
	protected void generateArchivingTarget(boolean assembling) {
191
		super.generateArchivingTarget(false);
192
	}
193
186
	protected Object[] getFinalShape(BundleDescription bundle) {
194
	protected Object[] getFinalShape(BundleDescription bundle) {
187
		if (AbstractScriptGenerator.getPropertyAsBoolean(IBuildPropertiesConstants.PROPERTY_PACKAGER_MODE) == true) {
195
		if (AbstractScriptGenerator.getPropertyAsBoolean(IBuildPropertiesConstants.PROPERTY_PACKAGER_MODE) == true) {
188
			String shape = isFolder(new Path(bundle.getLocation())) ? ShapeAdvisor.FOLDER : ShapeAdvisor.FILE;
196
			String shape = isFolder(new Path(bundle.getLocation())) ? ShapeAdvisor.FOLDER : ShapeAdvisor.FILE;
(-)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>

Return to bug 264603