diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ef69b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/org.eclipse.tycho.extras-tycho-extras-*.tar.xz diff --git a/dead.package b/dead.package deleted file mode 100644 index 3245441..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -This project was merged upstream with the main tycho repo. The tycho-extras RPM was subsumed by the tycho RPM diff --git a/fix-xmvn-pomless-builddep.patch b/fix-xmvn-pomless-builddep.patch new file mode 100644 index 0000000..8718af3 --- /dev/null +++ b/fix-xmvn-pomless-builddep.patch @@ -0,0 +1,109 @@ +From d33893c3e3ea8f4be7636439a8f9011bb179a8e9 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Mon, 13 Jun 2016 13:14:03 +0200 +Subject: [PATCH] Set location for pomless models + +Core Maven model reader sets location and some tools depend on these +values. These tools won't work with tycho-pomless unless it also sets +the location. + +Signed-off-by: Mikolaj Izdebski +Change-Id: I4da47c995c1333db0bb0ddb31f7309b08bf5ff39 +--- + +diff --git a/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoModelReader.java b/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoModelReader.java +index 349c776..e8a4f92 100644 +--- a/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoModelReader.java ++++ b/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoModelReader.java +@@ -24,6 +24,8 @@ + import javax.xml.parsers.DocumentBuilderFactory; + import javax.xml.parsers.ParserConfigurationException; + ++import org.apache.maven.model.InputLocation; ++import org.apache.maven.model.InputSource; + import org.apache.maven.model.Model; + import org.apache.maven.model.Parent; + import org.apache.maven.model.building.ModelProcessor; +@@ -81,6 +83,7 @@ + String bundleVersion = getRequiredHeaderValue("Bundle-Version", headers, manifestFile); + model.setVersion(getPomVersion(bundleVersion)); + model.setPackaging(getPackagingType(bundleSymbolicName)); ++ setLocation(model, manifestFile); + return model; + } + +@@ -109,6 +112,7 @@ + model.setVersion(getPomVersion(featureVersionNode.getValue())); + model.setPackaging("eclipse-feature"); + // groupId is inherited from parent pom ++ setLocation(model, featureXml); + return model; + } + +@@ -192,4 +196,11 @@ + parentReference.setVersion(version); + return parentReference; + } ++ ++ private void setLocation(Model model, File modelSource) { ++ InputSource inputSource = new InputSource(); ++ inputSource.setLocation(modelSource.toString()); ++ inputSource.setModelId(model.getParent().getGroupId() + ":" + model.getArtifactId() + ":" + model.getVersion()); ++ model.setLocation("", new InputLocation(0, 0, inputSource)); ++ } + } +diff --git a/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoModelReaderTest.java b/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoModelReaderTest.java +index 05cf0c2..a40e738 100644 +--- a/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoModelReaderTest.java ++++ b/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoModelReaderTest.java +@@ -19,6 +19,8 @@ + import java.util.HashMap; + import java.util.Map; + ++import org.apache.maven.model.InputLocation; ++import org.apache.maven.model.InputSource; + import org.apache.maven.model.Model; + import org.apache.maven.model.Parent; + import org.apache.maven.model.building.ModelProcessor; +@@ -43,6 +45,7 @@ + assertEquals("0.1.0-SNAPSHOT", model.getVersion()); + assertEquals("eclipse-plugin", model.getPackaging()); + assertParent(model.getParent()); ++ assertLocation("bundle1/META-INF/MANIFEST.MF", model.getLocation("")); + } + + public void testReadTestBundle() throws Exception { +@@ -52,6 +55,7 @@ + assertEquals("1.0.1", model.getVersion()); + assertEquals("eclipse-test-plugin", model.getPackaging()); + assertParent(model.getParent()); ++ assertLocation("bundle1.tests/META-INF/MANIFEST.MF", model.getLocation("")); + } + + public void testReadFeature() throws Exception { +@@ -61,6 +65,7 @@ + assertEquals("1.0.0-SNAPSHOT", model.getVersion()); + assertEquals("eclipse-feature", model.getPackaging()); + assertParent(model.getParent()); ++ assertLocation("feature/feature.xml", model.getLocation("")); + } + + public void testMissingManifestOrFeature() throws Exception { +@@ -148,6 +153,17 @@ + assertEquals("0.0.1-SNAPSHOT", parent.getVersion()); + } + ++ private void assertLocation(String expectedLocation, InputLocation location) { ++ assertNotNull(location); ++ assertEquals(0, location.getLineNumber()); ++ assertEquals(0, location.getColumnNumber()); ++ InputSource source = location.getSource(); ++ assertNotNull(source); ++ assertEquals(new File(getPolyglotTestDir(), expectedLocation).toString(), source.getLocation()); ++ assertNotNull(source.getModelId()); ++ assertTrue(source.getModelId().matches("^testParent.groupId:.*:.*")); ++ } ++ + private Map createReaderOptions(File buildProperties) { + Map options = new HashMap<>(); + options.put(ModelProcessor.SOURCE, buildProperties.getAbsolutePath()); diff --git a/sources b/sources new file mode 100644 index 0000000..152e9df --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (org.eclipse.tycho.extras-tycho-extras-1.0.0.tar.xz) = a09620162b97ceaf0e3dbf4237e8a03886b4226884700970e9d410b2d81b60a5c91de11e2de235fa53efc56123e418cab25c30facfb56156c8c3e58b0b81f8fc diff --git a/tycho-extras-fix-build.patch b/tycho-extras-fix-build.patch new file mode 100644 index 0000000..beb06c5 --- /dev/null +++ b/tycho-extras-fix-build.patch @@ -0,0 +1,31 @@ +diff --git a/tycho-source-feature-plugin/src/main/java/org/eclipse/tycho/extras/sourcefeature/SourceFeatureMojo.java b/tycho-source-feature-plugin/src/main/java/org/eclipse/tycho/extras/sourcefeature/SourceFeatureMojo.java +index 05baf87..2c62fb0 100644 +--- a/tycho-source-feature-plugin/src/main/java/org/eclipse/tycho/extras/sourcefeature/SourceFeatureMojo.java ++++ b/tycho-source-feature-plugin/src/main/java/org/eclipse/tycho/extras/sourcefeature/SourceFeatureMojo.java +@@ -515,15 +515,19 @@ public class SourceFeatureMojo extends AbstractMojo { + } + + private String getAttribute(PlexusConfiguration dom, String attrName) { +- String attr = dom.getAttribute(attrName); +- if (attr == null) { +- return null; +- } +- attr = attr.trim(); +- if (attr.length() == 0) { ++ try { ++ String attr = dom.getAttribute(attrName); ++ if (attr == null) { ++ return null; ++ } ++ attr = attr.trim(); ++ if (attr.length() == 0) { ++ return null; ++ } ++ return attr; ++ } catch (Exception e) { + return null; + } +- return attr; + } + + } diff --git a/tycho-extras-use-custom-resolver.patch b/tycho-extras-use-custom-resolver.patch new file mode 100644 index 0000000..e5bc919 --- /dev/null +++ b/tycho-extras-use-custom-resolver.patch @@ -0,0 +1,52 @@ +From 1136a52447b28da1dfa29c46b8ba025435a798be Mon Sep 17 00:00:00 2001 +From: Roland Grunberg +Date: Mon, 6 May 2013 14:20:58 -0400 +Subject: [PATCH] Use custom resolver for tycho-eclipserun-plugin. + +Add various system local OSGi bundle locations to the target platform +used by tycho-eclipserun-plugin. + +Change-Id: Ifd0aae3f32c8077cd0ae33e70f40698c1129788d +--- + tycho-eclipserun-plugin/pom.xml | 5 +++++ + .../org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java | 10 ++++++++++ + 2 files changed, 15 insertions(+) + +diff --git a/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java b/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java +index 4c4baf0..18db847 100644 +--- a/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java ++++ b/tycho-eclipserun-plugin/src/main/java/org/eclipse/tycho/extras/eclipserun/EclipseRunMojo.java +@@ -13,6 +13,7 @@ package org.eclipse.tycho.extras.eclipserun; + + import java.io.File; + import java.net.MalformedURLException; ++import java.net.URI; + import java.util.ArrayList; + import java.util.List; + import java.util.Map; +@@ -51,6 +52,7 @@ import org.eclipse.tycho.p2.resolver.facade.P2Resolver; + import org.eclipse.tycho.p2.resolver.facade.P2ResolverFactory; + import org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub; + import org.eclipse.tycho.plugins.p2.extras.Repository; ++import org.fedoraproject.p2.EclipseSystemLayout; + + /** + * Launch an eclipse process with arbitrary commandline arguments. The eclipse installation is +@@ -187,6 +189,14 @@ public class EclipseRunMojo extends AbstractMojo { + TargetPlatformConfigurationStub tpConfiguration = new TargetPlatformConfigurationStub(); + // we want to resolve from remote repos only + tpConfiguration.setForceIgnoreLocalArtifacts(true); ++ ++ // Add Fedora Local P2 Repository when running in local mode ++ if (System.getProperty("TYCHO_MVN_LOCAL") != null || System.getProperty("TYCHO_MVN_RPMBUILD") != null) { ++ for (URI uri : EclipseSystemLayout.getRepositories()) { ++ tpConfiguration.addP2Repository(new MavenRepositoryLocation(uri.getPath(), uri)); ++ } ++ } ++ + for (Repository repository : repositories) { + tpConfiguration.addP2Repository(new MavenRepositoryLocation(repository.getId(), repository.getLocation())); + } +-- +1.9.3 + diff --git a/tycho-extras.spec b/tycho-extras.spec new file mode 100644 index 0000000..7949c2d --- /dev/null +++ b/tycho-extras.spec @@ -0,0 +1,203 @@ +# When building version under development (non-release) +# %%global snap -SNAPSHOT +%global snap %{nil} + +Name: tycho-extras +Version: 1.0.0 +Release: 2%{?dist} +Summary: Additional plugins for Tycho + +License: EPL +URL: http://eclipse.org/tycho/ +Source0: http://git.eclipse.org/c/tycho/org.eclipse.tycho.extras.git/snapshot/org.eclipse.tycho.extras-tycho-extras-%{version}.tar.xz +Patch0: %{name}-fix-build.patch +Patch1: %{name}-use-custom-resolver.patch +Patch2: tycho-maven-archiver-3.0.1.patch +#https://git.eclipse.org/r/#/c/75453/ +Patch3: fix-xmvn-pomless-builddep.patch + +BuildArch: noarch + +BuildRequires: maven-local +BuildRequires: mvn(io.takari.polyglot:polyglot-common) +BuildRequires: mvn(org.apache.commons:commons-lang3) +BuildRequires: mvn(org.apache.maven:maven-archiver) +BuildRequires: mvn(org.apache.maven:maven-core) +BuildRequires: mvn(org.apache.maven:maven-model) +BuildRequires: mvn(org.apache.maven:maven-model-builder) +BuildRequires: mvn(org.apache.maven:maven-plugin-api) +BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) +BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations) +BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata) +BuildRequires: mvn(org.eclipse.jgit:org.eclipse.jgit) +BuildRequires: mvn(org.eclipse.sisu:org.eclipse.sisu.plexus) +BuildRequires: mvn(org.eclipse.tycho:org.eclipse.tycho.core.shared) +BuildRequires: mvn(org.eclipse.tycho:org.eclipse.tycho.p2.resolver.shared) +BuildRequires: mvn(org.eclipse.tycho:sisu-equinox-launching) +BuildRequires: mvn(org.eclipse.tycho:tycho-core) +BuildRequires: mvn(org.eclipse.tycho:tycho-p2-facade) +BuildRequires: mvn(org.eclipse.tycho:tycho-packaging-plugin) +BuildRequires: mvn(org.fedoraproject.p2:org.fedoraproject.p2) + +Obsoletes: tycho-pomless < 0.0.1-0.4 + +%description +A small set of plugins that work with Tycho to provide additional functionality +when building projects of an OSGi nature. + + +%package javadoc +Summary: Java docs for %{name} + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q -n org.eclipse.tycho.extras-tycho-extras-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p0 +%patch3 -p1 + +# maven-properties-plugin is only needed for tests +%pom_remove_plugin org.eclipse.m2e:lifecycle-mapping +%pom_remove_plugin org.sonatype.plugins:maven-properties-plugin tycho-p2-extras-plugin +# remove org.apache.maven:apache-maven zip +%pom_remove_dep org.apache.maven:apache-maven tycho-p2-extras-plugin +%pom_add_dep org.fedoraproject.p2:org.fedoraproject.p2 tycho-eclipserun-plugin/pom.xml + +%mvn_alias :{*} org.eclipse.tycho:@1 + +%build +# To run tests, we need : +# maven-properties-plugin (unclear licensing) +%mvn_build -f + +%install +%mvn_install + +# Install extension JAR with deps into XMvn ext directory +install -d -m 755 %{buildroot}%{_datadir}/xmvn/lib/ext/ +ln -s %{_javadir}/%{name}/tycho-pomless.jar %{buildroot}%{_datadir}/xmvn/lib/ext/ +ln -s %{_javadir}/tesla-polyglot/polyglot-common.jar %{buildroot}%{_datadir}/xmvn/lib/ext/ + +%files -f .mfiles +%{_datadir}/xmvn/lib/ext/* + +%files javadoc -f .mfiles-javadoc + +%changelog +* Thu Jul 27 2017 Fedora Release Engineering - 1.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Thu Apr 20 2017 Mat Booth - 1.0.0-1 +- Update to 1.0.0 + +* Sat Feb 11 2017 Fedora Release Engineering - 0.26.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Nov 02 2016 Mat Booth - 0.26.0-1 +- Update to latest upstream release + +* Mon Jul 4 2016 Alexander Kurtakov 0.25.0-4 +- Add patch to fix NPE in xmvn builddep. + +* Wed Jun 15 2016 Mikolaj Izdebski - 0.25.0-3 +- Add missing build-requires + +* Thu Apr 28 2016 Mikolaj Izdebski - 0.25.0-2 +- Obsolete tycho-pomless + +* Thu Apr 21 2016 Mat Booth - 0.25.0-1 +- Update to latest upstream release + +* Thu Apr 14 2016 Mat Booth - 0.23.0-4 +- Fix build against new maven-archiver, which removed some deprecated methods + that tycho was using + +* Fri Feb 05 2016 Fedora Release Engineering - 0.23.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jun 19 2015 Fedora Release Engineering - 0.23.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Jun 9 2015 Alexander Kurtakov 0.23.0-1 +- Update to upstream 0.23. + +* Fri Dec 5 2014 Mikolaj Izdebski - 0.22.0-2 +- Port to latest fedoraproject-p2 + +* Mon Dec 01 2014 Mat Booth - 0.22.0-1 +- Update to tagged release +- Fix directory ownership problem + +* Tue Nov 25 2014 Roland Grunberg - 0.22.0-0.1.gitef068a +- Update to 0.22.0 pre-release. + +* Wed Sep 03 2014 Roland Grunberg - 0.21.0-3 +- Use fedoraproject-p2 to do OSGi bundle discovery. + +* Thu Aug 21 2014 Roland Grunberg - 0.21.0-2 +- Integrate fedoraproject-p2 functionality. + +* Fri Jul 25 2014 Roland Grunberg - 0.21.0-1 +- Update to 0.21.0 Release. + +* Sun Jun 08 2014 Fedora Release Engineering - 0.20.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Mar 25 2014 Roland Grunberg - 0.20.0-1 +- Update to 0.20.0 Release. + +* Tue Mar 11 2014 Michael Simacek - 0.19.0-3 +- Use mvn_build and mvn_install. +- Drop manual requires. + +* Thu Feb 27 2014 Roland Grunberg - 0.19.0-2 +- Change R:java to R:java-headless (Bug 1068575). + +* Fri Oct 25 2013 Roland Grunberg - 0.19.0-1 +- Update to 0.19.0 Release. + +* Mon Jul 29 2013 Roland Grunberg 0.18.1-1 +- Update to 0.18.1 Release. + +* Thu May 30 2013 Roland Grunberg 0.18.0-1 +- Update to 0.18.0 Release. + +* Tue May 7 2013 Roland Grunberg 0.17.0-2 +- tycho-eclipserun-plugin should use the system local p2 repo. + +* Tue Apr 2 2013 Roland Grunberg 0.17.0-1 +- Update to 0.17.0 Release. + +* Mon Feb 25 2013 Roland Grunberg 0.17.0-0.1.git0a9370 +- Update to latest 0.17.0-SNAPSHOT. + +* Thu Feb 21 2013 Roland Grunberg - 0.16.0-5 +- Fix PlexusConfiguration class issues identically across branches. + +* Wed Feb 20 2013 Roland Grunberg - 0.16.0-4 +- Fix build issues relating to PlexusConfiguration. + +* Fri Feb 15 2013 Fedora Release Engineering - 0.16.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Dec 13 2012 Roland Grunberg 0.16.0-3 +- Fix upstream Bug 393686. + +* Fri Oct 19 2012 Roland Grunberg 0.16.0-2 +- Update to 0.16.0 Release. + +* Mon Jul 30 2012 Roland Grunberg 0.16.0-1.e58861 +- Update to 0.16.0 SNAPSHOT. + +* Fri Jul 27 2012 Roland Grunberg 0.15.0-1 +- Update to 0.15.0. + +* Sun Jul 22 2012 Fedora Release Engineering - 0.14.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Apr 16 2012 Roland Grunberg - 0.14.0-1 +- Initial packaging of tycho extras. diff --git a/tycho-maven-archiver-3.0.1.patch b/tycho-maven-archiver-3.0.1.patch new file mode 100644 index 0000000..e2a2820 --- /dev/null +++ b/tycho-maven-archiver-3.0.1.patch @@ -0,0 +1,22 @@ +--- tycho-custom-bundle-plugin/src/main/java/org/eclipse/tycho/extras/custombundle/CustomBundleMojo.java.orig 2016-04-14 17:47:08.696823870 +0100 ++++ tycho-custom-bundle-plugin/src/main/java/org/eclipse/tycho/extras/custombundle/CustomBundleMojo.java 2016-04-14 17:47:44.587408737 +0100 +@@ -108,7 +108,7 @@ + archiver.getArchiver().addFileSet(fileSet); + } + +- archiver.createArchive(project, archive); ++ archiver.createArchive(null, project, archive); + + projectHelper.attachArtifact(project, outputJarFile, classifier); + } catch (Exception e) { +--- tycho-source-feature-plugin/src/main/java/org/eclipse/tycho/extras/sourcefeature/SourceFeatureMojo.java.orig 2016-04-14 17:55:04.755317466 +0100 ++++ tycho-source-feature-plugin/src/main/java/org/eclipse/tycho/extras/sourcefeature/SourceFeatureMojo.java 2016-04-14 17:55:34.339975270 +0100 +@@ -221,7 +221,7 @@ + archiver.getArchiver() + .addArchivedFileSet(licenseFeatureHelper.getLicenseFeatureFileSet(licenseFeature)); + } +- archiver.createArchive(project, archive); ++ archiver.createArchive(null, project, archive); + + projectHelper.attachArtifact(project, outputJarFile, SOURCES_FEATURE_CLASSIFIER); + } catch (MojoExecutionException e) {