Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 126224 Details for
Bug 264603
Invoke the director to perform install during builds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated
264603.txt (text/plain), 31.51 KB, created by
Andrew Niefer
on 2009-02-19 16:47:36 EST
(
hide
)
Description:
updated
Filename:
MIME Type:
Creator:
Andrew Niefer
Created:
2009-02-19 16:47:36 EST
Size:
31.51 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.build >Index: src/org/eclipse/pde/internal/build/IXMLConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/IXMLConstants.java,v >retrieving revision 1.83 >diff -u -r1.83 IXMLConstants.java >--- src/org/eclipse/pde/internal/build/IXMLConstants.java 6 Feb 2009 22:11:37 -0000 1.83 >+++ src/org/eclipse/pde/internal/build/IXMLConstants.java 19 Feb 2009 21:46:48 -0000 >@@ -65,6 +65,8 @@ > public static final String TARGET_ROOT_TARGET = "rootTarget"; //$NON-NLS-1$ > public static final String TARGET_CUSTOM_ASSEMBLY = "customAssembly"; //$NON-NLS-1$ > public static final String TARGET_P2_METADATA = "generate.p2.metadata"; //$NON-NLS-1$ >+ public static final String TARGET_RUN_DIRECTOR = "runDirector"; //$NON-NLS-1$ >+ > // properties > public static final String PROPERTY_ARCH = "arch"; //$NON-NLS-1$ > public static final String PROPERTY_BASE_ARCH = "basearch"; //$NON-NLS-1$ >@@ -153,6 +155,7 @@ > public static final String PROPERTY_OMIT_ROOTFILES = "updateJar.omitRootfiles"; //$NON-NLS-1$ > public static final String PROPERTY_GENERATE_API_DESCRIPTION = "generateAPIDescription"; //$NON-NLS-1$ > public static final String PROPERTY_BINARY_FOLDERS = "binary.folders"; //$NON-NLS-1$ >+ public static final String PROPERTY_LAUNCHER_JAR = "equinoxLauncherJar"; //$NON-NLS-1$ > > //Jar processor properties > public static final String PROPERTY_SIGN_ALIAS = "sign.alias"; //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java,v >retrieving revision 1.36 >diff -u -r1.36 IBuildPropertiesConstants.java >--- src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java 6 Feb 2009 22:11:37 -0000 1.36 >+++ src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java 19 Feb 2009 21:46:47 -0000 >@@ -96,9 +96,15 @@ > public static final String PROPERTY_P2_COMPRESS = "p2.compress"; //$NON-NLS-1$ > public static final String PROPERTY_P2_METADATA_REPO_NAME = "p2.metadata.repo.name"; //$NON-NLS-1$ > public static final String PROPERTY_P2_ARTIFACT_REPO_NAME = "p2.artifact.repo.name"; //$NON-NLS-1$ >- public static final String PROPERTY_P2_BUILD_REPO = "p2.build.repo"; //$NON-NLS-1$ >+ > //Internal usage only >+ public static final String PROPERTY_P2_BUILD_REPO = "p2.build.repo"; //$NON-NLS-1$ > public static final String PROPERTY_P2_GENERATION_MODE = "p2.generation.mode"; //$NON-NLS-1$ >+ public static final String PROPERTY_P2_REPO = "p2.repo"; //$NON-NLS-1$ >+ public static final String PROPERTY_P2_DIRECTOR_IU = "p2.director.iu"; //$NON-NLS-1$ >+ public static final String PROPERTY_P2_DIRECTOR_VERSION = "p2.director.version"; //$NON-NLS-1$ >+ public static final String PROPERTY_P2_DIRECTOR_INSTALLPATH = "p2.director.installPath"; //$NON-NLS-1$ >+ > public static final String SOURCE_PLUGIN = "sourcePlugin"; //$NON-NLS-1$ > > public static final String PROPERTY_PACKAGER_MODE = "packagerMode"; //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/build/P2ConfigScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/P2ConfigScriptGenerator.java,v >retrieving revision 1.2 >diff -u -r1.2 P2ConfigScriptGenerator.java >--- src/org/eclipse/pde/internal/build/P2ConfigScriptGenerator.java 12 Feb 2009 21:41:32 -0000 1.2 >+++ src/org/eclipse/pde/internal/build/P2ConfigScriptGenerator.java 19 Feb 2009 21:46:48 -0000 >@@ -9,10 +9,15 @@ > > package org.eclipse.pde.internal.build; > >+import java.io.File; > import java.util.*; >-import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.*; > import org.eclipse.osgi.service.resolver.BundleDescription; >+import org.eclipse.pde.internal.build.ant.AntScript; >+import org.eclipse.pde.internal.build.ant.FileSet; > import org.eclipse.pde.internal.build.site.BuildTimeFeature; >+import org.eclipse.pde.internal.build.site.BuildTimeSite; >+import org.eclipse.pde.internal.build.site.compatibility.FeatureEntry; > > public class P2ConfigScriptGenerator extends AssembleConfigScriptGenerator { > private AssemblyInformation assemblyInformation = null; >@@ -32,14 +37,14 @@ > initializeCollections(); > > try { >- openScript(directory, "assemble." + featureId + ".p2.xml"); //$NON-NLS-1$ //$NON-NLS-2$ >+ String prefix = assembling ? "assemble." : "package."; //$NON-NLS-1$ //$NON-NLS-2$ >+ openScript(directory, prefix + featureId + ".p2.xml"); //$NON-NLS-1$ > } catch (CoreException e) { > return; > } > generatePrologue(); > generateMainBegin(); > generateGatherCalls(); >- generateBrandingCalls(); > generateMetadataCalls(); > generateMainEnd(); > >@@ -110,24 +115,94 @@ > } > } > script.printDeleteTask(Utils.getPropertyFormat(PROPERTY_ASSEMBLY_TMP) + "/p2.branding", null, null); //$NON-NLS-1$ >+ script.println(); > } > > protected void generateMetadataTarget() { >- script.printTargetDeclaration(TARGET_P2_METADATA, null, null, null, null); >+ script.printTargetDeclaration(TARGET_P2_METADATA, null, null, assembling ? PROPERTY_RUN_PACKAGER : null, null); >+ >+ generateBrandingCalls(); > > ProductFile product = getProductFile(); > if (product != null) { >+ >+ String productPath = product.getLocation(); >+ String productDir = getWorkingDirectory() + '/' + DEFAULT_FEATURE_LOCATION + '/' + CONTAINER_FEATURE + "/product"; //$NON-NLS-1$ >+ File productFile = new File(productPath); >+ String newProduct = new File(productDir, productFile.getName()).getAbsolutePath(); >+ script.printCopyFileTask(productPath, newProduct, true); >+ >+ File parent = new File(productPath).getParentFile(); >+ File p2Inf = new File(parent, "p2.inf"); //$NON-NLS-1$ >+ if (p2Inf.exists()) >+ script.printCopyTask(p2Inf.getAbsolutePath(), productDir, null, false, true); >+ generateProductReplaceTask(product, newProduct); >+ productPath = newProduct; >+ > script.printTab(); > script.print("<p2.publish.product "); //$NON-NLS-1$ > script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$ > script.printAttribute("repository", Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO), true); //$NON-NLS-1$ >- script.printAttribute("productFile", product.getLocation(), true); //$NON-NLS-1$ >+ script.printAttribute("productFile", newProduct, true); //$NON-NLS-1$ > script.println("/>"); //$NON-NLS-1$ > } > script.printTargetEnd(); > } > >+ //TODO this is duplicated from AssembleScriptGenerator >+ protected void generateProductReplaceTask(ProductFile product, String productDirectory) { >+ if (product == null) >+ return; >+ >+ BuildTimeSite site = null; >+ try { >+ site = getSite(false); >+ } catch (CoreException e1) { >+ return; >+ } >+ >+ List productEntries = product.getProductEntries(); >+ String mappings = Utils.getEntryVersionMappings((FeatureEntry[]) productEntries.toArray(new FeatureEntry[productEntries.size()]), site); >+ script.println("<eclipse.idReplacer productFilePath=\"" + AntScript.getEscaped(productDirectory) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ >+ script.println(" selfVersion=\"" + product.getVersion() + "\" "); //$NON-NLS-1$ //$NON-NLS-2$ >+ if (product.useFeatures()) >+ script.println(" featureIds=\"" + mappings + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ >+ else >+ script.println(" pluginIds=\"" + mappings + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ return; >+ } >+ > protected void generateEpilogue() { > script.printProjectEnd(); > } >+ >+ protected void generateGatherBinPartsTarget() { >+ if (assembling) { >+ super.generateGatherBinPartsTarget(); >+ return; >+ } >+ >+ script.printTargetDeclaration(TARGET_GATHER_BIN_PARTS, null, null, null, null); >+ >+ ArrayList p2Features = new ArrayList(); >+ ArrayList p2Bundles = new ArrayList(); >+ for (int i = 0; i < plugins.length; i++) { >+ Path pluginLocation = new Path(plugins[i].getLocation()); >+ p2Bundles.add(new FileSet(pluginLocation.removeLastSegments(1).toOSString(), null, pluginLocation.lastSegment(), null, null, null, null)); >+ >+ } >+ >+ for (int i = 0; i < features.length; i++) { >+ IPath featureLocation = new Path(features[i].getURL().getPath()); >+ featureLocation = featureLocation.removeLastSegments(1); >+ p2Features.add(new FileSet(featureLocation.removeLastSegments(1).toOSString(), null, featureLocation.lastSegment(), null, null, null, null)); >+ } >+ >+ String repo = Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO); >+ script.printP2PublishFeaturesAndBundles(repo, repo, (FileSet[]) p2Bundles.toArray(new FileSet[p2Bundles.size()]), (FileSet[]) p2Features.toArray(new FileSet[p2Features.size()]), Utils.getPropertyFormat(PROPERTY_P2_CATEGORY_SITE)); >+ >+ script.printTargetEnd(); >+ script.println(); >+ } > } >Index: src/org/eclipse/pde/internal/build/IPDEBuildConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/IPDEBuildConstants.java,v >retrieving revision 1.48 >diff -u -r1.48 IPDEBuildConstants.java >--- src/org/eclipse/pde/internal/build/IPDEBuildConstants.java 6 Feb 2009 22:11:37 -0000 1.48 >+++ src/org/eclipse/pde/internal/build/IPDEBuildConstants.java 19 Feb 2009 21:46:47 -0000 >@@ -39,6 +39,7 @@ > public final static String MANIFEST = "MANIFEST.MF"; //$NON-NLS-1$ > > // default values >+ public final static String PROPERTY_GENERIC_TARGETS = "genericTargets"; //$NON-NLS-1$ > public final static String DEFAULT_BUILD_SCRIPT_FILENAME = "build.xml"; //$NON-NLS-1$ > public final static String DEFAULT_FEATURE_LOCATION = "features"; //$NON-NLS-1$ > public final static String DEFAULT_FETCH_SCRIPT_FILENAME = "fetch.xml"; //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/build/AssembleScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AssembleScriptGenerator.java,v >retrieving revision 1.37 >diff -u -r1.37 AssembleScriptGenerator.java >--- src/org/eclipse/pde/internal/build/AssembleScriptGenerator.java 6 Feb 2009 22:11:37 -0000 1.37 >+++ src/org/eclipse/pde/internal/build/AssembleScriptGenerator.java 19 Feb 2009 21:46:47 -0000 >@@ -110,7 +110,7 @@ > basicGenerateAssembleConfigFileTargetCall(current, configInfo[0], configInfo[1], configInfo[2], configInfo[3]); > } > } >- if (configScriptGenerator.haveP2Bundles()) >+ if (configScriptGenerator.haveP2Bundles() && !BuildDirector.p2Gathering) > script.printAntCallTask(TARGET_P2_METADATA, true, null); > script.printTargetEnd(); > } >@@ -125,6 +125,7 @@ > p2ConfigGenerator.initialize(directory, featureId); > p2ConfigGenerator.generate(); > >+ script.printTab(); > script.print("<assemble "); //$NON-NLS-1$ > script.printAttribute("config", "p2", true); //$NON-NLS-1$ //$NON-NLS-2$ > script.printAttribute("element", p2ConfigGenerator.getTargetElement(), true); //$NON-NLS-1$ >@@ -141,6 +142,7 @@ > configScriptGenerator.setGroupConfigs(groupConfigs); > configScriptGenerator.generate(); > >+ script.printTab(); > script.print("<assemble "); //$NON-NLS-1$ > String config = configScriptGenerator.getTargetConfig(); > script.printAttribute("config", config, true); //$NON-NLS-1$ >@@ -151,6 +153,8 @@ > } > > protected void generateMetadataTarget() { >+ if (BuildDirector.p2Gathering) >+ return; > if (configScriptGenerator.haveP2Bundles()) { > script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, PROPERTY_RUN_PACKAGER, null); > >Index: src/org/eclipse/pde/internal/build/AssembleConfigScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AssembleConfigScriptGenerator.java,v >retrieving revision 1.114 >diff -u -r1.114 AssembleConfigScriptGenerator.java >--- src/org/eclipse/pde/internal/build/AssembleConfigScriptGenerator.java 6 Feb 2009 22:11:37 -0000 1.114 >+++ src/org/eclipse/pde/internal/build/AssembleConfigScriptGenerator.java 19 Feb 2009 21:46:47 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.pde.internal.build; > > import java.io.File; >+import java.io.IOException; > import java.util.*; > import java.util.jar.JarFile; > import org.eclipse.core.runtime.*; >@@ -20,6 +21,7 @@ > import org.eclipse.pde.internal.build.builder.BuildDirector; > import org.eclipse.pde.internal.build.builder.ModelBuildScriptGenerator; > import org.eclipse.pde.internal.build.site.BuildTimeFeature; >+import org.osgi.framework.Bundle; > > /** > * Generate an assemble script for a given feature and a given config. It >@@ -119,10 +121,14 @@ > > generateMainBegin(); > generateInitializationSteps(); >- generateGatherCalls(); >- generateProcessingCalls(); >- generateBrandingCalls(); >- generateP2Steps(); >+ if (BuildDirector.p2Gathering) { >+ generateDirectorCall(); >+ } else { >+ generateGatherCalls(); >+ generateProcessingCalls(); >+ generateBrandingCalls(); >+ generateP2Steps(); >+ } > generateArchivingCalls(); > generateMainEnd(); > >@@ -139,13 +145,33 @@ > script.println(); > } > >+ protected void generateDirectorCall() { >+ if (productFile != null) >+ script.printAntCallTask(TARGET_RUN_DIRECTOR, true, null); >+ } >+ >+ protected void generateDirectorTarget(boolean assembling) { >+ script.printTargetDeclaration(TARGET_RUN_DIRECTOR, null, null, assembling ? PROPERTY_RUN_PACKAGER : null, null); >+ Map parameters = new HashMap(); >+ parameters.put(PROPERTY_OS, Utils.getPropertyFormat(PROPERTY_OS)); >+ parameters.put(PROPERTY_WS, Utils.getPropertyFormat(PROPERTY_WS)); >+ parameters.put(PROPERTY_ARCH, Utils.getPropertyFormat(PROPERTY_ARCH)); >+ parameters.put(PROPERTY_P2_REPO, Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO)); >+ parameters.put(PROPERTY_P2_DIRECTOR_IU, productFile != null ? productFile.getId() : Utils.getPropertyFormat(PROPERTY_P2_ROOT_NAME)); >+ parameters.put(PROPERTY_P2_DIRECTOR_VERSION, productFile != null ? productFile.getVersion() : Utils.getPropertyFormat(PROPERTY_P2_ROOT_VERSION)); >+ parameters.put(PROPERTY_P2_DIRECTOR_INSTALLPATH, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE)); >+ script.printAntTask(Utils.getPropertyFormat(PROPERTY_GENERIC_TARGETS), null, TARGET_RUN_DIRECTOR, null, TRUE, parameters); >+ script.println(); >+ script.printTargetEnd(); >+ } >+ > private void generateProcessingCalls() { > script.printAntCallTask(TARGET_JAR_PROCESSING, true, null); > script.println(); > } > > private void generateArchivingCalls() { >- if (!BuildDirector.p2Gathering) >+ if (!BuildDirector.p2Gathering || productFile != null) > script.printAntCallTask(TARGET_ASSEMBLE_ARCHIVE, true, null); > } > >@@ -175,8 +201,8 @@ > script.println(); > } > >- private void generateArchivingTarget() { >- script.printTargetDeclaration(TARGET_ASSEMBLE_ARCHIVE, null, null, null, null); >+ protected void generateArchivingTarget(boolean assembling) { >+ script.printTargetDeclaration(TARGET_ASSEMBLE_ARCHIVE, null, null, assembling && BuildDirector.p2Gathering ? PROPERTY_RUN_PACKAGER : null, null); > Map properties = new HashMap(); > properties.put(PROPERTY_ROOT_FOLDER, rootFolder); > printCustomAssemblyAntCall(PROPERTY_PRE + "archive", properties); //$NON-NLS-1$ >@@ -334,6 +360,8 @@ > script.printProperty(PROPERTY_ECLIPSE_PLUGINS, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_PLUGIN_LOCATION); > script.printProperty(PROPERTY_ECLIPSE_FEATURES, Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_FEATURE_LOCATION); > script.printProperty(PROPERTY_ARCHIVE_FULLPATH, Utils.getPropertyFormat(PROPERTY_BASEDIR) + '/' + Utils.getPropertyFormat(PROPERTY_BUILD_LABEL) + '/' + Utils.getPropertyFormat(PROPERTY_ARCHIVE_NAME)); >+ printLauncherJarProperty(); >+ script.printProperty(PROPERTY_P2_BUILD_REPO, "file:" + Utils.getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + "/buildRepo"); //$NON-NLS-1$ //$NON-NLS-2$ > script.printAvailableTask(PROPERTY_CUSTOM_ASSEMBLY, "${builder}/customAssembly.xml", "${builder}/customAssembly.xml"); //$NON-NLS-1$ //$NON-NLS-2$ > > if (productFile != null && productFile.getLauncherName() != null) >@@ -345,6 +373,16 @@ > generatePackagingTargets(); > } > >+ protected void printLauncherJarProperty() { >+ Bundle launcherBundle = Platform.getBundle(BUNDLE_EQUINOX_LAUNCHER); >+ try { >+ File bundleFile = FileLocator.getBundleFile(launcherBundle); >+ script.printProperty(PROPERTY_LAUNCHER_JAR, bundleFile.getAbsolutePath()); >+ } catch (IOException e) { >+ // what can we do with this? >+ } >+ } >+ > protected void generateCustomGatherMacro() { > List attributes = new ArrayList(5); > attributes.add("dir"); //$NON-NLS-1$ >@@ -367,7 +405,7 @@ > script.println(); > } > >- private void printCustomGatherCall(String fullName, String dir, String propertyName, String propertyValue, String subFolder) { >+ protected void printCustomGatherCall(String fullName, String dir, String propertyName, String propertyValue, String subFolder) { > 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$ > } > >@@ -492,13 +530,14 @@ > if (embeddedSource) > generateGatherSourceTarget(); > generatePostProcessingTarget(); >- generateArchivingTarget(); >+ generateArchivingTarget(true); > > if (FORMAT_TAR.equalsIgnoreCase(archiveFormat)) > generateGZipTarget(true); > > generateCustomAssemblyTarget(); > generateMetadataTarget(); >+ generateDirectorTarget(true); > > script.printProjectEnd(); > script.close(); >@@ -589,6 +628,7 @@ > } > > script.printTargetEnd(); >+ script.println(); > } > } > >@@ -700,41 +740,40 @@ > > //TODO this code and the generateAntTarTarget() should be refactored using a factory or something like that. > protected void generateAntZipTarget() { >- FileSet[] filesPlugins = new FileSet[plugins.length]; >- for (int i = 0; i < plugins.length; i++) { >- Object[] shape = shapeAdvisor.getFinalShape(plugins[i]); >- filesPlugins[i] = new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_PLUGIN_LOCATION + '/' + (String) shape[0], shape[1] == ShapeAdvisor.FILE, null, null, null, null, null, Utils.getPropertyFormat(PROPERTY_PLUGIN_ARCHIVE_PREFIX) + '/' + (String) shape[0], null, null); >- } >- if (plugins.length != 0) >- script.printZipTask(Utils.getPropertyFormat(PROPERTY_ARCHIVE_FULLPATH), null, false, true, filesPlugins); >+ List fileSets = new ArrayList(); > >- FileSet[] filesFeatures = new FileSet[features.length]; >- for (int i = 0; i < features.length; i++) { >- Object[] shape = shapeAdvisor.getFinalShape(features[i]); >- filesFeatures[i] = new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_FEATURE_LOCATION + '/' + (String) shape[0], shape[1] == ShapeAdvisor.FILE, null, null, null, null, null, Utils.getPropertyFormat(PROPERTY_FEATURE_ARCHIVE_PREFIX) + '/' + (String) shape[0], null, null); >- } >- if (features.length != 0) >- script.printZipTask(Utils.getPropertyFormat(PROPERTY_ARCHIVE_FULLPATH), null, false, true, filesFeatures); >+ if (BuildDirector.p2Gathering) { >+ //TODO permissions >+ fileSets.add(new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE), false, null, "**/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX), null, null)); //$NON-NLS-1$ >+ } else { >+ for (int i = 0; i < plugins.length; i++) { >+ Object[] shape = shapeAdvisor.getFinalShape(plugins[i]); >+ fileSets.add(new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_PLUGIN_LOCATION + '/' + (String) shape[0], shape[1] == ShapeAdvisor.FILE, null, null, null, null, null, Utils.getPropertyFormat(PROPERTY_PLUGIN_ARCHIVE_PREFIX) + '/' + (String) shape[0], null, null)); >+ } > >- if (rootFileProviders.size() == 0) >- return; >+ for (int i = 0; i < features.length; i++) { >+ Object[] shape = shapeAdvisor.getFinalShape(features[i]); >+ fileSets.add(new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + DEFAULT_FEATURE_LOCATION + '/' + (String) shape[0], shape[1] == ShapeAdvisor.FILE, null, null, null, null, null, Utils.getPropertyFormat(PROPERTY_FEATURE_ARCHIVE_PREFIX) + '/' + (String) shape[0], null, null)); >+ } > >- if (groupConfigs) { >- List allConfigs = getConfigInfos(); >- FileSet[] rootFiles = new FileSet[allConfigs.size()]; >- int i = 0; >- for (Iterator iter = allConfigs.iterator(); iter.hasNext();) { >- Config elt = (Config) iter.next(); >- rootFiles[i++] = new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + elt.toStringReplacingAny(".", ANY_STRING), false, null, "**/**", null, null, null, elt.toStringReplacingAny(".", ANY_STRING), null, null); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ >+ if (rootFileProviders.size() > 0) { >+ if (groupConfigs) { >+ List allConfigs = getConfigInfos(); >+ for (Iterator iter = allConfigs.iterator(); iter.hasNext();) { >+ Config elt = (Config) iter.next(); >+ fileSets.add(new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + elt.toStringReplacingAny(".", ANY_STRING), false, null, "**/**", null, null, null, elt.toStringReplacingAny(".", ANY_STRING), null, null)); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ >+ } >+ } else { >+ FileSet[] permissions = generatePermissions(true); >+ String toExcludeFromArchive = Utils.getStringFromCollection(this.addedByPermissions, ","); //$NON-NLS-1$ >+ fileSets.add(new ZipFileSet(rootFolder, false, null, "**/**", null, toExcludeFromArchive, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX), null, null)); //$NON-NLS-1$ >+ fileSets.addAll(Arrays.asList(permissions)); >+ } > } >- script.printZipTask(Utils.getPropertyFormat(PROPERTY_ARCHIVE_FULLPATH), null, false, true, rootFiles); >- } else { >- FileSet[] permissionSets = generatePermissions(true); >- FileSet[] rootFiles = new FileSet[permissionSets.length + 1]; >- String toExcludeFromArchive = Utils.getStringFromCollection(this.addedByPermissions, ","); //$NON-NLS-1$ >- System.arraycopy(permissionSets, 0, rootFiles, 1, permissionSets.length); >- rootFiles[0] = new ZipFileSet(rootFolder, false, null, "**/**", null, toExcludeFromArchive, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX), null, null); //$NON-NLS-1$ >- script.printZipTask(Utils.getPropertyFormat(PROPERTY_ARCHIVE_FULLPATH), null, false, true, rootFiles); >+ } >+ if (fileSets.size() > 0) { >+ FileSet[] sets = (FileSet[]) fileSets.toArray(new FileSet[fileSets.size()]); >+ script.printZipTask(Utils.getPropertyFormat(PROPERTY_ARCHIVE_FULLPATH), null, false, true, sets); > } > } > >Index: src/org/eclipse/pde/internal/build/ant/AntScript.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ant/AntScript.java,v >retrieving revision 1.60 >diff -u -r1.60 AntScript.java >--- src/org/eclipse/pde/internal/build/ant/AntScript.java 11 Feb 2009 22:59:03 -0000 1.60 >+++ src/org/eclipse/pde/internal/build/ant/AntScript.java 19 Feb 2009 21:46:49 -0000 >@@ -102,6 +102,7 @@ > bundles[i].printAs("bundles", this); //$NON-NLS-1$ > } > indent--; >+ printTab(); > output.println("</eclipse.publish.featuresAndBundles>"); //$NON-NLS-1$ > } > >Index: src/org/eclipse/pde/internal/build/packager/PackageScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/packager/PackageScriptGenerator.java,v >retrieving revision 1.26 >diff -u -r1.26 PackageScriptGenerator.java >--- src/org/eclipse/pde/internal/build/packager/PackageScriptGenerator.java 6 Feb 2009 22:11:37 -0000 1.26 >+++ src/org/eclipse/pde/internal/build/packager/PackageScriptGenerator.java 19 Feb 2009 21:46:50 -0000 >@@ -47,7 +47,18 @@ > } > > protected void generateP2ConfigFileTargetCall() { >- //empty >+ P2ConfigScriptGenerator p2ConfigGenerator = new P2ConfigScriptGenerator(assemblageInformation, false); >+ p2ConfigGenerator.setProduct(productLocation); >+ p2ConfigGenerator.initialize(directory, featureId); >+ p2ConfigGenerator.generate(); >+ >+ script.printTab(); >+ script.print("<assemble "); //$NON-NLS-1$ >+ script.printAttribute("config", "p2", true); //$NON-NLS-1$ //$NON-NLS-2$ >+ script.printAttribute("element", p2ConfigGenerator.getTargetElement(), true); //$NON-NLS-1$ >+ script.printAttribute("dot", ".", true); //$NON-NLS-1$ //$NON-NLS-2$ >+ script.printAttribute("scriptPrefix", "package", true); //$NON-NLS-1$ //$NON-NLS-2$ >+ script.println("/>"); //$NON-NLS-1$ > } > > protected void basicGenerateAssembleConfigFileTargetCall(Config aConfig, Collection binaryPlugins, Collection binaryFeatures, Collection allFeatures, Collection rootFiles) throws CoreException { >@@ -59,6 +70,7 @@ > configScriptGenerator.setBuildSiteFactory(siteFactory); > configScriptGenerator.generate(); > >+ script.printTab(); > script.print("<assemble "); //$NON-NLS-1$ > String config = configScriptGenerator.getTargetConfig(); > script.printAttribute("config", config, true); //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/build/packager/PackageConfigScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/packager/PackageConfigScriptGenerator.java,v >retrieving revision 1.23 >diff -u -r1.23 PackageConfigScriptGenerator.java >--- src/org/eclipse/pde/internal/build/packager/PackageConfigScriptGenerator.java 20 Jan 2009 22:27:33 -0000 1.23 >+++ src/org/eclipse/pde/internal/build/packager/PackageConfigScriptGenerator.java 19 Feb 2009 21:46:50 -0000 >@@ -183,6 +183,14 @@ > super.generateTarGZTasks(false); > } > >+ protected void generateDirectorTarget(boolean assembling) { >+ super.generateDirectorTarget(false); >+ } >+ >+ protected void generateArchivingTarget(boolean assembling) { >+ super.generateArchivingTarget(false); >+ } >+ > protected Object[] getFinalShape(BundleDescription bundle) { > if (AbstractScriptGenerator.getPropertyAsBoolean(IBuildPropertiesConstants.PROPERTY_PACKAGER_MODE) == true) { > String shape = isFolder(new Path(bundle.getLocation())) ? ShapeAdvisor.FOLDER : ShapeAdvisor.FILE; >Index: src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java,v >retrieving revision 1.126 >diff -u -r1.126 ModelBuildScriptGenerator.java >--- src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java 2 Feb 2009 16:55:33 -0000 1.126 >+++ src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java 19 Feb 2009 21:46:50 -0000 >@@ -607,8 +607,8 @@ > generateAPIToolsCall(getCompiledLocations(), Utils.isStringIn(splitIncludes, EXPANDED_DOT + '/') != -1, Utils.getPropertyFormat(PROPERTY_BUILD_RESULT_FOLDER)); > > script.println("<eclipse.gatherBundle "); //$NON-NLS-1$ >- script.println(" metadataRepository=\"file:${buildDirectory}/buildRepo\""); //$NON-NLS-1$ >- script.println(" artifactRepository=\"file:${buildDirectory}/buildRepo\""); //$NON-NLS-1$ >+ script.println(" metadataRepository=\"" + Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ >+ script.println(" artifactRepository=\"" + Utils.getPropertyFormat(PROPERTY_P2_BUILD_REPO) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ > script.println(" buildResultFolder=\"" + Utils.getPropertyFormat(PROPERTY_BUILD_RESULT_FOLDER) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ > script.println(" baseDirectory=\"${basedir}\""); //$NON-NLS-1$ > if (associatedEntry != null && associatedEntry.unpackSet()) >@@ -856,6 +856,7 @@ > script.printProjectDeclaration(model.getSymbolicName(), TARGET_BUILD_JARS, DOT); > script.println(); > >+ script.printProperty(PROPERTY_P2_BUILD_REPO, "file:" + Utils.getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + "/buildRepo"); //$NON-NLS-1$ //$NON-NLS-2$ > script.printProperty(PROPERTY_BASE_WS, Utils.getPropertyFormat(PROPERTY_WS)); > script.printProperty(PROPERTY_BASE_OS, Utils.getPropertyFormat(PROPERTY_OS)); > script.printProperty(PROPERTY_BASE_ARCH, Utils.getPropertyFormat(PROPERTY_ARCH)); >Index: scripts/genericTargets.xml >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/scripts/genericTargets.xml,v >retrieving revision 1.27 >diff -u -r1.27 genericTargets.xml >--- scripts/genericTargets.xml 23 Jan 2009 22:15:18 -0000 1.27 >+++ scripts/genericTargets.xml 19 Feb 2009 21:46:47 -0000 >@@ -200,4 +200,40 @@ > </p2.repo2runnable> > </target> > >+<!-- Invoke the p2 director to perform an install --> >+<target name="runDirector" > >+ <property name="p2.director.bundlepool" value="${p2.director.installPath}"/> >+ <property name="p2.director.dataArea" value="${p2.director.installPath}/p2"/> >+ <property name="p2.director.extraArgs" value="-profileProperties org.eclipse.update.install.features=true" /> >+ <property name="p2.director.extraVMArgs" value="-Declipse.p2.MD5Check=false" /> >+ <property name="p2.director.profile" value="profile" /> >+ <property name="p2.director.version" value="" /> >+ >+ <java jar="${equinoxLauncherJar}" fork="true" failonerror="true"> >+ <arg line="-application org.eclipse.equinox.p2.director.app.application" /> >+ <arg line="-nosplash" /> >+ <arg line="--launcher.suppressErrors" /> >+ <arg line="-consoleLog" /> >+ <arg line="-flavor ${p2.flavor}" /> >+ <arg line="-installIU ${p2.director.iu}" /> >+ <arg line="-version ${p2.director.version}" /> >+ <arg line="-p2.os ${os}" /> >+ <arg line="-p2.ws ${ws}" /> >+ <arg line="-p2.arch ${arch}" /> >+ <arg line="-roaming" /> >+ <arg line="-profile ${p2.director.profile}" /> >+ <arg line="${p2.director.extraArgs}" /> >+ <arg line="-metadataRepository"/> >+ <arg value="${p2.repo}" /> >+ <arg line="-artifactRepository"/> >+ <arg value="${p2.repo}" /> >+ <arg line="-destination"/> >+ <arg value="${p2.director.installPath}" /> >+ <arg line="-bundlepool"/> >+ <arg value="${p2.director.bundlepool}" /> >+ >+ <jvmarg value="-Declipse.p2.data.area=${p2.director.dataArea}" /> >+ <jvmarg line="${p2.director.extraVMArgs}" /> >+ </java> >+</target> > </project> >#P org.eclipse.pde.build.tests >Index: src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java,v >retrieving revision 1.11 >diff -u -r1.11 PublishingTests.java >--- src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java 12 Feb 2009 21:41:30 -0000 1.11 >+++ src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java 19 Feb 2009 21:46:52 -0000 >@@ -349,5 +349,7 @@ > assertEquals(iu.getVersion().toString(), "1.0.0"); > assertRequires(iu, "org.eclipse.equinox.p2.iu", "org.eclipse.osgi"); > >+ assertResourceFile(buildFolder, "I.TestBuild/eclipse-macosx.carbon.ppc.zip"); >+ assertResourceFile(buildFolder, "I.TestBuild/eclipse-win32.win32.x86.zip"); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 264603
:
125463
|
125595
| 126224