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 160528 Details for
Bug 243582
Support embedding repository information in released bundles
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]
patch
scm-cvs-urls.patch (text/plain), 10.34 KB, created by
Darin Wright
on 2010-03-01 15:37:17 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2010-03-01 15:37:17 EST
Size:
10.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.build >Index: src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java,v >retrieving revision 1.14 >diff -u -r1.14 CVSFetchTaskFactory.java >--- src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java 25 May 2009 15:45:36 -0000 1.14 >+++ src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java 1 Mar 2010 20:36:20 -0000 >@@ -59,6 +59,9 @@ > private static final String PROP_FILETOCHECK = "fileToCheck"; //$NON-NLS-1$ > private static final String PROP_ELEMENTNAME = "elementName"; //$NON-NLS-1$ > >+ //Associated repository provider >+ private static final String CVS_DIRECTIVES = ";type:=psf;provider:=\"org.eclipse.team.cvs.core.cvsnature\""; //$NON-NLS-1$ >+ > private void generateAuthentificationAntTask(Map entryInfos, IAntScript script) { > String password = (String) entryInfos.get(KEY_PASSWORD); > String cvsPassFileLocation = (String) entryInfos.get(KEY_CVSPASSFILE); >@@ -139,7 +142,7 @@ > String tag = (String) entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG); > String cvsRoot = (String) entryInfos.get(KEY_CVSROOT); > String dest = "true".equalsIgnoreCase((String) entryInfos.get(KEY_PREBUILT)) ? destination.removeLastSegments(1).toString() : destination.toString(); //$NON-NLS-1$ >- printCVSTask("export -r " + tag + ' ' + filePath.toString(), cvsRoot, dest, null, null, "true", Utils.getPropertyFormat(PROP_REALLYQUIET), null, null, "${fetch.failonerror}", script); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-5$ >+ printCVSTask("export -r " + tag + ' ' + filePath.toString(), cvsRoot, dest, null, null, "true", Utils.getPropertyFormat(PROP_REALLYQUIET), null, null, "${fetch.failonerror}", script); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ > script.println("<move file=\"" + destination + '/' + filePath + "\"" + " tofile=\"" + destination.append(file) + "\" failonerror=\"false\" />"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ > } > } >@@ -180,6 +183,7 @@ > int index = arg.indexOf('='); > if (index == -1) { > legacyParseMapFileEntry(arguments, overrideTags, entryInfos); >+ addProjectReference(entryInfos); > return; > } > String key = arg.substring(0, index); >@@ -197,6 +201,64 @@ > entryInfos.put(KEY_PASSWORD, table.get(KEY_PASSWORD)); > entryInfos.put(KEY_PATH, table.get(KEY_PATH)); > entryInfos.put(KEY_PREBUILT, table.get(KEY_PREBUILT)); >+ addProjectReference(entryInfos); >+ } >+ >+ private void addProjectReference(Map entryInfos) { >+ String repoLocation = (String) entryInfos.get(KEY_CVSROOT); >+ String module = (String) entryInfos.get(KEY_PATH); >+ String projectName = (String) entryInfos.get(KEY_ELEMENT_NAME); >+ String tag = (String) entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG); >+ >+ if (repoLocation != null && projectName != null) { >+ String sourceURLs = asReference(repoLocation, module != null ? module : projectName, projectName, tag); >+ if (sourceURLs != null) { >+ entryInfos.put(Constants.KEY_SOURCE_REFERENCES, sourceURLs + CVS_DIRECTIVES); >+ } >+ } >+ } >+ >+ /** >+ * Creates an SCMURL reference to the associated source. >+ * >+ * @param repoLocation >+ * @param module >+ * @param projectName >+ * @return project reference string or <code>null</code> if none >+ */ >+ private String asReference(String repoLocation, String module, String projectName, String tagName) { >+ // parse protocol, host, repository root from repoLocation >+ String sep = repoLocation.substring(0, 1); >+ String[] split = repoLocation.substring(1).split(sep); >+ if (split.length == 3) { >+ String protocol = split[0]; >+ String host = split[1]; >+ int index = host.indexOf('@'); >+ if (index >= 0 && index < host.length() - 2) { >+ host = host.substring(index + 1); >+ } >+ String root = split[2]; >+ StringBuffer buffer = new StringBuffer(); >+ buffer.append("scm:cvs:"); //$NON-NLS-1$ >+ buffer.append(protocol); >+ buffer.append(':'); >+ buffer.append(host); >+ buffer.append(':'); >+ buffer.append(root); >+ >+ buffer.append(':'); >+ buffer.append(module); >+ >+ buffer.append(";project="); //$NON-NLS-1$ >+ buffer.append(projectName); >+ >+ if (tagName != null) { >+ buffer.append(";tag="); //$NON-NLS-1$ >+ buffer.append(tagName); >+ } >+ return buffer.toString(); >+ } >+ return null; > } > > /** >#P org.eclipse.pde.build.tests >Index: src/org/eclipse/pde/build/internal/tests/FetchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/FetchTests.java,v >retrieving revision 1.13 >diff -u -r1.13 FetchTests.java >--- src/org/eclipse/pde/build/internal/tests/FetchTests.java 13 Jan 2010 16:53:39 -0000 1.13 >+++ src/org/eclipse/pde/build/internal/tests/FetchTests.java 1 Mar 2010 20:36:21 -0000 >@@ -17,6 +17,7 @@ > import org.eclipse.core.runtime.*; > import org.eclipse.pde.build.tests.BuildConfiguration; > import org.eclipse.pde.build.tests.PDETestCase; >+import org.eclipse.pde.internal.build.IPDEBuildConstants; > > /** > * These tests are not included in the main test suite unless the "pde.build.includeFetch" system property >@@ -40,32 +41,32 @@ > > public void testGetUnpack() throws Exception { > IFolder buildFolder = newTest("testGetUnpack"); >- >+ > StringBuffer buffer = new StringBuffer(); > buffer.append("plugin@javax.xml.rpc,1.1.0=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/bundles/javax.xml.rpc_1.1.0.v200905122109.zip,unpack=true\n"); > buffer.append("plugin@com.ibm.icu.base,3.6.0=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/updateSite/plugins/com.ibm.icu.base_3.6.0.v20080530.jar,unpack=true,dest=${buildDirectory}/plugins/com.ibm.icu.base_3.6.0/.zip\n"); > buffer.append("plugin@com.ibm.icu.base,3.6.1=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/updateSite/plugins/com.ibm.icu.base_3.6.1.v20080530.jar,unpack=true\n"); > Utils.writeBuffer(buildFolder.getFile("directory.txt"), buffer); >- >+ > Utils.generateFeature(buildFolder, "org.eclipse.pde.build.container.feature", null, new String[] {"javax.xml.rpc", "com.ibm.icu.base;version=3.6.0.qualifier", "com.ibm.icu.base;version=3.6.1.qualifier"}); >- >+ > Properties fetchProperties = new Properties(); > fetchProperties.put("buildDirectory", buildFolder.getLocation().toOSString()); > fetchProperties.put("type", "feature"); > fetchProperties.put("id", "org.eclipse.pde.build.container.feature"); >- >+ > URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null); > String buildXMLPath = FileLocator.toFileURL(resource).getPath(); > runAntScript(buildXMLPath, new String[] {"fetchElement"}, buildFolder.getLocation().toOSString(), fetchProperties); >- >+ > assertResourceFile(buildFolder.getFile("plugins/javax.xml.rpc_1.1.0.v200905122109/META-INF/MANIFEST.MF")); > assertResourceFile(buildFolder.getFile("plugins/com.ibm.icu.base_3.6.0/META-INF/MANIFEST.MF")); > assertResourceFile(buildFolder.getFile("plugins/com.ibm.icu.base_3.6.1.v20080530/META-INF/MANIFEST.MF")); > } >- >+ > public void testFetchFeature() throws Exception { > IFolder buildFolder = newTest("fetchFeature"); >- >+ > StringBuffer buffer = new StringBuffer(); > buffer.append("feature@org.eclipse.cvs=v20090619,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,,org.eclipse.cvs-feature\n"); > buffer.append("plugin@org.eclipse.cvs=v20090520,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,,org.eclipse.sdk-feature/plugins/org.eclipse.cvs\n"); >@@ -73,17 +74,24 @@ > buffer.append("plugin@org.eclipse.team.cvs.ssh2=I20090508-2000,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,\n"); > buffer.append("plugin@org.eclipse.team.cvs.ui=I20090521-1750,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,\n"); > Utils.writeBuffer(buildFolder.getFile("directory.txt"), buffer); >- >+ > Properties fetchProperties = new Properties(); > fetchProperties.put("buildDirectory", buildFolder.getLocation().toOSString()); > fetchProperties.put("type", "feature"); > fetchProperties.put("id", "org.eclipse.cvs"); >- >+ > URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null); > String buildXMLPath = FileLocator.toFileURL(resource).getPath(); > runAntScript(buildXMLPath, new String[] {"fetchElement"}, buildFolder.getLocation().toOSString(), fetchProperties); >+ >+ IFile sourceRefsFile = buildFolder.getFile(IPDEBuildConstants.DEFAULT_SOURCE_REFERENCES_FILENAME_DESCRIPTOR); >+ assertResourceFile(sourceRefsFile); >+ Properties sourceRefs = Utils.loadProperties(sourceRefsFile); >+ assertEquals(sourceRefs.get("org.eclipse.cvs,0.0.0"), "scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.sdk-feature/plugins/org.eclipse.cvs;project=org.eclipse.cvs,tag=v20090520"); >+ assertEquals(sourceRefs.get("org.eclipse.team.cvs.core,0.0.0"), "scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.core:project=org.eclipse.team.cvs.core;tag=I20090430-0408"); >+ assertEquals(sourceRefs.get("org.eclipse.team.cvs.ssh2,0.0.0"), "scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.ssh2:project=org.eclipse.team.cvs.ssh2;tag=I20090508-2000"); > } >- >+ > public void testBug248767_2() throws Exception { > IFolder buildFolder = newTest("248767_2"); > IFolder base = Utils.createFolder(buildFolder, "base"); >@@ -136,7 +144,7 @@ > assertResourceFile(buildFolder, "plugins/com.ibm.icu.base_3.6.1.v20080530.jar"); > assertResourceFile(buildFolder, "plugins/com.ibm.icu.base_3.6.0.v20080530.jar"); > } >- >+ > public void testP2Get() throws Exception { > IFolder buildFolder = newTest("p2.get"); > Utils.createFolder(buildFolder, "plugins"); >@@ -148,7 +156,7 @@ > Map replacements = new HashMap(); > replacements.put("repoLocation", repoLocation.toExternalForm()); > Utils.transferAndReplace(mapFile, buildFolder.getFile("directory.txt"), replacements); >- >+ > //org.eclipse.pde.build.container.feature is special in that the fetch won't try > //to fetch it, and will just fetch everything it includes. > Properties fetchProperties = new Properties();
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 243582
:
158774
|
160008
|
160150
| 160528 |
160673
|
160676
|
160857