diff --git a/.devtoolset-4-tycho-extras.metadata b/.devtoolset-4-tycho-extras.metadata new file mode 100644 index 0000000..ed9e836 --- /dev/null +++ b/.devtoolset-4-tycho-extras.metadata @@ -0,0 +1 @@ +bbdf39196c2ce66b047a4d68f8e3e331bdd3efdb SOURCES/org.eclipse.tycho.extras-tycho-extras-0.23.0.tar.xz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36b7dfd --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/org.eclipse.tycho.extras-tycho-extras-0.23.0.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Update-to-JGit-4.0.patch b/SOURCES/0001-Update-to-JGit-4.0.patch new file mode 100644 index 0000000..c111fa2 --- /dev/null +++ b/SOURCES/0001-Update-to-JGit-4.0.patch @@ -0,0 +1,106 @@ +From f7c05e9cd2e7cb72b16fb2a93ce699b58943443d Mon Sep 17 00:00:00 2001 +From: Alexander Kurtakov +Date: Tue, 9 Jun 2015 19:17:30 +0300 +Subject: [PATCH] Update to JGit 4.0 + +--- + pom.xml | 2 +- + .../buildtimestamp/jgit/JGitBuildTimestampProvider.java | 15 +++++++-------- + .../tycho/extras/buildtimestamp/jgit/PathFilter.java | 10 +++++----- + 3 files changed, 13 insertions(+), 14 deletions(-) + +diff --git a/pom.xml b/pom.xml +index c476294..717e6ee 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -74,7 +74,7 @@ + UTF-8 + 3.0 + 3.3 +- 3.5.3.201412180710-r ++ 4.0.0.201506020755-rc3 + + ${project.version} + 1.7 +diff --git a/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java b/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java +index ae5b7fa..fb0d785 100644 +--- a/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java ++++ b/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java +@@ -152,12 +152,10 @@ public class JGitBuildTimestampProvider implements BuildTimestampProvider { + logger.warn("Fallback to default timestamp provider"); + return defaultTimestampProvider.getTimestamp(session, project, execution); + } else { +- throw new MojoExecutionException( +- message +- + "\n" +- + "You are trying to use tycho-buildtimestamp-jgit on a directory that has uncommitted changes (see details above)." +- + "\nEither commit all changes/add files to .gitignore, or enable fallback to default timestamp provider by configuring " +- + "\njgit.dirtyWorkingTree=warning for tycho-packaging-plugin"); ++ throw new MojoExecutionException(message + "\n" ++ + "You are trying to use tycho-buildtimestamp-jgit on a directory that has uncommitted changes (see details above)." ++ + "\nEither commit all changes/add files to .gitignore, or enable fallback to default timestamp provider by configuring " ++ + "\njgit.dirtyWorkingTree=warning for tycho-packaging-plugin"); + } + } + } +@@ -172,12 +170,13 @@ public class JGitBuildTimestampProvider implements BuildTimestampProvider { + // When dirtyBehaviour==ignore and no commit was ever done, + // the commit is null, so we fallback to the defaultTimestampProvider + if (commit == null) { +- logger.info("Fallback to default timestamp provider, because no commit could be found for that project (Shared but not commited yet)."); ++ logger.info( ++ "Fallback to default timestamp provider, because no commit could be found for that project (Shared but not commited yet)."); + return defaultTimestampProvider.getTimestamp(session, project, execution); + } + return new Date(commit.getCommitTime() * 1000L); + } finally { +- walk.release(); ++ walk.close(); + } + } finally { + repository.close(); +diff --git a/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java b/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java +index ce349e9..96e6c51 100644 +--- a/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java ++++ b/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/PathFilter.java +@@ -18,7 +18,7 @@ import java.util.StringTokenizer; + + import org.eclipse.jgit.errors.IncorrectObjectTypeException; + import org.eclipse.jgit.errors.MissingObjectException; +-import org.eclipse.jgit.ignore.IgnoreRule; ++import org.eclipse.jgit.ignore.FastIgnoreRule; + import org.eclipse.jgit.lib.Constants; + import org.eclipse.jgit.treewalk.TreeWalk; + import org.eclipse.jgit.treewalk.filter.TreeFilter; +@@ -27,16 +27,16 @@ public class PathFilter extends TreeFilter { + + private final byte[] basedir; + +- private final List rules; ++ private final List rules; + + public PathFilter(String basedir, String filters) { + this.basedir = Constants.encode(basedir); + + if (filters != null) { + StringTokenizer st = new StringTokenizer(filters, "\n\r\f", false); +- List rules = new ArrayList(); ++ List rules = new ArrayList(); + while (st.hasMoreTokens()) { +- rules.add(new IgnoreRule(st.nextToken().trim())); ++ rules.add(new FastIgnoreRule(st.nextToken().trim())); + } + this.rules = Collections.unmodifiableList(rules); + } else { +@@ -53,7 +53,7 @@ public class PathFilter extends TreeFilter { + + if (!tw.isSubtree() && rules != null) { + String path = tw.getPathString(); +- for (IgnoreRule rule : rules) { ++ for (FastIgnoreRule rule : rules) { + if (rule.isMatch(path, tw.isSubtree())) { + return !rule.getResult(); + } +-- +2.4.2 + diff --git a/SOURCES/tycho-extras-fix-build.patch b/SOURCES/tycho-extras-fix-build.patch new file mode 100644 index 0000000..beb06c5 --- /dev/null +++ b/SOURCES/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/SOURCES/tycho-extras-use-custom-resolver.patch b/SOURCES/tycho-extras-use-custom-resolver.patch new file mode 100644 index 0000000..e5bc919 --- /dev/null +++ b/SOURCES/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/SPECS/tycho-extras.spec b/SPECS/tycho-extras.spec new file mode 100644 index 0000000..c0eb51e --- /dev/null +++ b/SPECS/tycho-extras.spec @@ -0,0 +1,98 @@ +%global pkg_name tycho-extras +%{?scl:%scl_package %{pkg_name}} +# If Eclipse not in buildroot, then JGit not in buildroot +# In this case set the bootstrap flag +%global bootstrap 0 +# When building version under development (non-release) +# %%global snap -SNAPSHOT +%global snap %{nil} + +Name: %{?scl_prefix}tycho-extras +Version: 0.23.0 +Release: 2.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: %{pkg_name}-fix-build.patch +Patch1: %{pkg_name}-use-custom-resolver.patch +Patch2: 0001-Update-to-JGit-4.0.patch + +BuildArch: noarch + +%if ! %{bootstrap} +BuildRequires: %{?scl_prefix}jgit +%endif +BuildRequires: %{?scl_prefix_java_common}maven-local +BuildRequires: %{?scl_prefix}tycho >= 0.22.0-3 + +%if ! %{bootstrap} +Requires: %{?scl_prefix}jgit +%endif +Requires: %{?scl_prefix}tycho >= 0.22.0-3 + + +%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 %{pkg_name} +Group: Documentation + +%description javadoc +This package contains the API documentation for %{pkg_name}. + +%prep +%setup -q -n org.eclipse.tycho.extras-tycho-extras-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} +# 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 + +%if %{bootstrap} +%pom_disable_module tycho-sourceref-jgit +%pom_disable_module tycho-buildtimestamp-jgit +%endif + +%{?scl:EOF} + +%build +# To run tests, we need : +# maven-properties-plugin (unclear licensing) +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} +%mvn_build -f +%{?scl:EOF} + +%install +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} +%mvn_install +%{?scl:EOF} + +%files -f .mfiles +%dir %{_javadir}/%{pkg_name} +%dir %{_mavenpomdir}/%{pkg_name} + +%files javadoc -f .mfiles-javadoc + +%changelog +* Tue Jun 30 2015 Mat Booth - 0.23.0-2.2 +- Non bootstrap build + +* Sun Jun 28 2015 Roland Grunberg - 0.23.0-2.1 +- SCL-ize. +- Re-introduce a bootstrap mode to avoid jgit dependency. + +* Sun Jun 28 2015 Roland Grunberg - 0.23.0-2.1 +- Initial import of tycho-extras-0.23.0-2.fc23.