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 231215 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java (+2 lines)
Lines 89-94 Link Here
89
	public static final String PROPERTY_P2_FINAL_MODE_OVERRIDE = "p2.final.mode.override"; //$NON-NLS-1$
89
	public static final String PROPERTY_P2_FINAL_MODE_OVERRIDE = "p2.final.mode.override"; //$NON-NLS-1$
90
	public static final String PROPERTY_P2_FLAVOR = "p2.flavor"; //$NON-NLS-1$
90
	public static final String PROPERTY_P2_FLAVOR = "p2.flavor"; //$NON-NLS-1$
91
	public static final String PROPERTY_P2_APPEND = "p2.append"; //$NON-NLS-1$
91
	public static final String PROPERTY_P2_APPEND = "p2.append"; //$NON-NLS-1$
92
	public static final String PROPERTY_P2_METADATA_REPO_NAME = "p2.metadata.repo.name"; //$NON-NLS-1$
93
	public static final String PROPERTY_P2_ARTIFACT_REPO_NAME = "p2.artifact.repo.name"; //$NON-NLS-1$
92
	//Internal usage only
94
	//Internal usage only
93
	public static final String PROPERTY_P2_GENERATION_MODE = "p2.generation.mode"; //$NON-NLS-1$
95
	public static final String PROPERTY_P2_GENERATION_MODE = "p2.generation.mode"; //$NON-NLS-1$
94
	public static final String SOURCE_PLUGIN = "sourcePlugin"; //$NON-NLS-1$
96
	public static final String SOURCE_PLUGIN = "sourcePlugin"; //$NON-NLS-1$
(-)src/org/eclipse/pde/internal/build/AssembleScriptGenerator.java (-1 / +5 lines)
Lines 129-139 Link Here
129
			script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, PROPERTY_RUN_PACKAGER, null);
129
			script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, PROPERTY_RUN_PACKAGER, null);
130
			script.printConditionIsSet("mode", "incremental", PROPERTY_RUN_PACKAGER, "final"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
130
			script.printConditionIsSet("mode", "incremental", PROPERTY_RUN_PACKAGER, "final"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
131
			script.printProperty(PROPERTY_P2_APPEND, "true"); //$NON-NLS-1$
131
			script.printProperty(PROPERTY_P2_APPEND, "true"); //$NON-NLS-1$
132
			script.printProperty(PROPERTY_P2_METADATA_REPO_NAME, ""); //$NON-NLS-1$
133
			script.printProperty(PROPERTY_P2_ARTIFACT_REPO_NAME, ""); //$NON-NLS-1$
132
			script.print("<p2.generator "); //$NON-NLS-1$
134
			script.print("<p2.generator "); //$NON-NLS-1$
133
			script.printAttribute("append", Utils.getPropertyFormat(PROPERTY_P2_APPEND), true); //$NON-NLS-1$
135
			script.printAttribute("append", Utils.getPropertyFormat(PROPERTY_P2_APPEND), true); //$NON-NLS-1$
134
			script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
136
			script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
135
			script.printAttribute("metadataRepository", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO), true); //$NON-NLS-1$ 
137
			script.printAttribute("metadataRepository", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO), true); //$NON-NLS-1$ 
136
			script.printAttribute("artifactRepository", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO), true); //$NON-NLS-1$ 
138
			script.printAttribute("artifactRepository", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO), true); //$NON-NLS-1$
139
			script.printAttribute("metadataRepositoryName", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO_NAME), true); //$NON-NLS-1$
140
			script.printAttribute("artifactRepositoryName", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO_NAME), true); //$NON-NLS-1$
137
			script.printAttribute("publishArtifacts", Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS), true); //$NON-NLS-1$ 
141
			script.printAttribute("publishArtifacts", Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS), true); //$NON-NLS-1$ 
138
			script.printAttribute("mode", "${mode}", true); //$NON-NLS-1$ //$NON-NLS-2$
142
			script.printAttribute("mode", "${mode}", true); //$NON-NLS-1$ //$NON-NLS-2$
139
143
(-)src/org/eclipse/pde/internal/build/AssembleConfigScriptGenerator.java (-5 / +11 lines)
Lines 481-487 Link Here
481
		if (haveP2Bundles()) {
481
		if (haveP2Bundles()) {
482
			script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, null, null);
482
			script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, null, null);
483
			script.printProperty(PROPERTY_P2_APPEND, "true"); //$NON-NLS-1$
483
			script.printProperty(PROPERTY_P2_APPEND, "true"); //$NON-NLS-1$
484
			
484
			script.printProperty(PROPERTY_P2_METADATA_REPO_NAME, ""); //$NON-NLS-1$
485
			script.printProperty(PROPERTY_P2_ARTIFACT_REPO_NAME, ""); //$NON-NLS-1$
486
485
			if (havePDEUIState()) {
487
			if (havePDEUIState()) {
486
				//during feature export we need to override the "mode"
488
				//during feature export we need to override the "mode"
487
				printP2GenerationModeCondition();
489
				printP2GenerationModeCondition();
Lines 492-502 Link Here
492
			script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
494
			script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
493
			script.printAttribute("metadataRepository", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO), true); //$NON-NLS-1$ 
495
			script.printAttribute("metadataRepository", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO), true); //$NON-NLS-1$ 
494
			script.printAttribute("artifactRepository", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO), true); //$NON-NLS-1$ 
496
			script.printAttribute("artifactRepository", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO), true); //$NON-NLS-1$ 
497
			script.printAttribute("metadataRepositoryName", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO_NAME), true); //$NON-NLS-1$
498
			script.printAttribute("artifactRepositoryName", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO_NAME), true); //$NON-NLS-1$
495
			script.printAttribute("publishArtifacts", Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS), true); //$NON-NLS-1$ 
499
			script.printAttribute("publishArtifacts", Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS), true); //$NON-NLS-1$ 
496
			script.printAttribute("p2OS", configInfo.getOs(), true); //$NON-NLS-1$
500
			script.printAttribute("p2OS", configInfo.getOs(), true); //$NON-NLS-1$
497
			if (!havePDEUIState() || rootFileProviders.size() > 0)
501
			if (!havePDEUIState() || rootFileProviders.size() > 0)
498
				script.printAttribute("mode", "incremental", true); //$NON-NLS-1$ //$NON-NLS-2$
502
				script.printAttribute("mode", "incremental", true); //$NON-NLS-1$ //$NON-NLS-2$
499
			else 
503
			else
500
				script.printAttribute("mode", Utils.getPropertyFormat(PROPERTY_P2_GENERATION_MODE), true); //$NON-NLS-1$
504
				script.printAttribute("mode", Utils.getPropertyFormat(PROPERTY_P2_GENERATION_MODE), true); //$NON-NLS-1$
501
			script.println("/>"); //$NON-NLS-1$
505
			script.println("/>"); //$NON-NLS-1$
502
506
Lines 507-516 Link Here
507
				script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
511
				script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
508
				script.printAttribute("metadataRepository", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO), true); //$NON-NLS-1$ 
512
				script.printAttribute("metadataRepository", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO), true); //$NON-NLS-1$ 
509
				script.printAttribute("artifactRepository", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO), true); //$NON-NLS-1$ 
513
				script.printAttribute("artifactRepository", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO), true); //$NON-NLS-1$ 
514
				script.printAttribute("metadataRepositoryName", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO_NAME), true); //$NON-NLS-1$
515
				script.printAttribute("artifactRepositoryName", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO_NAME), true); //$NON-NLS-1$
510
				script.printAttribute("launcherConfig", configInfo.toString(), true); //$NON-NLS-1$
516
				script.printAttribute("launcherConfig", configInfo.toString(), true); //$NON-NLS-1$
511
				script.printAttribute("p2OS", configInfo.getOs(), true); //$NON-NLS-1$
517
				script.printAttribute("p2OS", configInfo.getOs(), true); //$NON-NLS-1$
512
				script.printAttribute("publishArtifacts", Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS), true); //$NON-NLS-1$ 
518
				script.printAttribute("publishArtifacts", Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS), true); //$NON-NLS-1$ 
513
				if(!havePDEUIState())
519
				if (!havePDEUIState())
514
					script.printAttribute("mode", "incremental", true); //$NON-NLS-1$ //$NON-NLS-2$
520
					script.printAttribute("mode", "incremental", true); //$NON-NLS-1$ //$NON-NLS-2$
515
				else
521
				else
516
					script.printAttribute("mode", Utils.getPropertyFormat(PROPERTY_P2_GENERATION_MODE), true); //$NON-NLS-1$
522
					script.printAttribute("mode", Utils.getPropertyFormat(PROPERTY_P2_GENERATION_MODE), true); //$NON-NLS-1$
Lines 527-533 Link Here
527
533
528
	protected void printP2GenerationModeCondition() {
534
	protected void printP2GenerationModeCondition() {
529
		// "final" if not running packager and we are overriding, else "incremental"
535
		// "final" if not running packager and we are overriding, else "incremental"
530
		script.print("<condition");  //$NON-NLS-1$
536
		script.print("<condition"); //$NON-NLS-1$
531
		script.printAttribute("property", PROPERTY_P2_GENERATION_MODE, true); //$NON-NLS-1$
537
		script.printAttribute("property", PROPERTY_P2_GENERATION_MODE, true); //$NON-NLS-1$
532
		script.printAttribute("value", "final", true); //$NON-NLS-1$ //$NON-NLS-2$
538
		script.printAttribute("value", "final", true); //$NON-NLS-1$ //$NON-NLS-2$
533
		script.printAttribute("else", "incremental", false); //$NON-NLS-1$ //$NON-NLS-2$
539
		script.printAttribute("else", "incremental", false); //$NON-NLS-1$ //$NON-NLS-2$
Lines 540-546 Link Here
540
		script.println("\t</and>"); //$NON-NLS-1$
546
		script.println("\t</and>"); //$NON-NLS-1$
541
		script.printEndTag("condition"); //$NON-NLS-1$
547
		script.printEndTag("condition"); //$NON-NLS-1$
542
	}
548
	}
543
	
549
544
	public boolean haveP2Bundles() {
550
	public boolean haveP2Bundles() {
545
		if (p2Bundles != null)
551
		if (p2Bundles != null)
546
			return p2Bundles.booleanValue();
552
			return p2Bundles.booleanValue();
(-)src/org/eclipse/pde/internal/build/packager/PackageScriptGenerator.java (+8 lines)
Lines 8-13 Link Here
8
 ******************************************************************************/
8
 ******************************************************************************/
9
package org.eclipse.pde.internal.build.packager;
9
package org.eclipse.pde.internal.build.packager;
10
10
11
import org.eclipse.pde.internal.build.Utils;
12
11
import java.io.*;
13
import java.io.*;
12
import java.util.*;
14
import java.util.*;
13
import org.eclipse.core.runtime.*;
15
import org.eclipse.core.runtime.*;
Lines 84-89 Link Here
84
		if (configScriptGenerator.haveP2Bundles()) {
86
		if (configScriptGenerator.haveP2Bundles()) {
85
			script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, null, null);
87
			script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, null, null);
86
			script.printProperty(PROPERTY_P2_APPEND, "true"); //$NON-NLS-1$
88
			script.printProperty(PROPERTY_P2_APPEND, "true"); //$NON-NLS-1$
89
			script.printProperty(PROPERTY_P2_METADATA_REPO_NAME, ""); //$NON-NLS-1$
90
			script.printProperty(PROPERTY_P2_ARTIFACT_REPO_NAME, ""); //$NON-NLS-1$
87
			ProductFile product = configScriptGenerator.getProductFile();
91
			ProductFile product = configScriptGenerator.getProductFile();
88
			String versionAdvice = null;
92
			String versionAdvice = null;
89
			if (versionsList && product != null) {
93
			if (versionsList && product != null) {
Lines 103-108 Link Here
103
		script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
107
		script.printAttribute("flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); //$NON-NLS-1$
104
		script.printAttribute("metadataRepository", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO), true); //$NON-NLS-1$ 
108
		script.printAttribute("metadataRepository", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO), true); //$NON-NLS-1$ 
105
		script.printAttribute("artifactRepository", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO), true); //$NON-NLS-1$ 
109
		script.printAttribute("artifactRepository", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO), true); //$NON-NLS-1$ 
110
		script.printAttribute("metadataRepositoryName", Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO_NAME), true); //$NON-NLS-1$
111
		script.printAttribute("artifactRepositoryName", Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO_NAME), true); //$NON-NLS-1$
106
		script.printAttribute("publishArtifacts", Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS), true); //$NON-NLS-1$ 
112
		script.printAttribute("publishArtifacts", Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS), true); //$NON-NLS-1$ 
107
		script.printAttribute("mode", "final", true); //$NON-NLS-1$ //$NON-NLS-2$
113
		script.printAttribute("mode", "final", true); //$NON-NLS-1$ //$NON-NLS-2$
108
114
Lines 162-167 Link Here
162
			p2Script.printProjectDeclaration("P2 Product IU Generation", "main", "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
168
			p2Script.printProjectDeclaration("P2 Product IU Generation", "main", "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
163
			p2Script.println();
169
			p2Script.println();
164
			p2Script.printProperty(PROPERTY_P2_APPEND, "true"); //$NON-NLS-1$
170
			p2Script.printProperty(PROPERTY_P2_APPEND, "true"); //$NON-NLS-1$
171
			p2Script.printProperty(PROPERTY_P2_METADATA_REPO_NAME, ""); //$NON-NLS-1$
172
			p2Script.printProperty(PROPERTY_P2_ARTIFACT_REPO_NAME, ""); //$NON-NLS-1$
165
			p2Script.printTargetDeclaration("main", null, TARGET_P2_METADATA, null, "Generate the final Product IU"); //$NON-NLS-1$//$NON-NLS-2$
173
			p2Script.printTargetDeclaration("main", null, TARGET_P2_METADATA, null, "Generate the final Product IU"); //$NON-NLS-1$//$NON-NLS-2$
166
			generateP2FinalCall(p2Script, productFileLocation, adviceFile != null ? adviceFile.getAbsolutePath() : null);
174
			generateP2FinalCall(p2Script, productFileLocation, adviceFile != null ? adviceFile.getAbsolutePath() : null);
167
			p2Script.printTargetEnd();
175
			p2Script.printTargetEnd();
(-)src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java (-8 / +2 lines)
Lines 112-118 Link Here
112
			throw new IllegalArgumentException(NLS.bind(Messages.exception_artifactRepoLocationURL, artifactLocation));
112
			throw new IllegalArgumentException(NLS.bind(Messages.exception_artifactRepoLocationURL, artifactLocation));
113
		}
113
		}
114
114
115
		String repositoryName = artifactRepoName != null ? artifactRepoName : artifactLocation + " - artifacts"; //$NON-NLS-1$
115
		String repositoryName = (artifactRepoName != null && artifactRepoName.length() > 0) ? artifactRepoName : artifactLocation + " - artifacts"; //$NON-NLS-1$
116
		Map properties = new HashMap(1);
116
		Map properties = new HashMap(1);
117
		properties.put(IRepository.PROP_COMPRESSED, compress);
117
		properties.put(IRepository.PROP_COMPRESSED, compress);
118
		if (provider.reuseExistingPack200Files())
118
		if (provider.reuseExistingPack200Files())
Lines 122-130 Link Here
122
			result = manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
122
			result = manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
123
			manager.removeRepository(location);
123
			manager.removeRepository(location);
124
			provider.setArtifactRepository(result);
124
			provider.setArtifactRepository(result);
125
			// TODO is this needed?
126
			if (artifactRepoName != null)
127
				result.setName(artifactRepoName);
128
			return;
125
			return;
129
		} catch (ProvisionException e) {
126
		} catch (ProvisionException e) {
130
			//fall through a load existing repo
127
			//fall through a load existing repo
Lines 171-177 Link Here
171
		//  We try creating a repo first instead of just loading what is there because we don't want a repo based
168
		//  We try creating a repo first instead of just loading what is there because we don't want a repo based
172
		//  on a site.xml if there is one there.
169
		//  on a site.xml if there is one there.
173
170
174
		String repositoryName = metadataRepoName == null ? metadataLocation + " - metadata" : metadataRepoName; //$NON-NLS-1$
171
		String repositoryName = (metadataRepoName == null || metadataRepoName.length() == 0) ? metadataLocation + " - metadata" : metadataRepoName; //$NON-NLS-1$
175
		Map properties = new HashMap(1);
172
		Map properties = new HashMap(1);
176
		properties.put(IRepository.PROP_COMPRESSED, compress);
173
		properties.put(IRepository.PROP_COMPRESSED, compress);
177
174
Lines 179-187 Link Here
179
		try {
176
		try {
180
			IMetadataRepository result = manager.createRepository(location, repositoryName, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
177
			IMetadataRepository result = manager.createRepository(location, repositoryName, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
181
			manager.removeRepository(location);
178
			manager.removeRepository(location);
182
			// TODO is this needed?
183
			if (metadataRepoName != null)
184
				result.setName(metadataRepoName);
185
			provider.setMetadataRepository(result);
179
			provider.setMetadataRepository(result);
186
			return;
180
			return;
187
		} catch (ProvisionException e) {
181
		} catch (ProvisionException e) {

Return to bug 231215