Compare commits

...

7 Commits
master ... f19

Author SHA1 Message Date
Roland Grunberg 63663621f9 Improve artifact resolution using XMvn Resolver. (Bug 986900) 2013-07-30 16:55:04 -04:00
Roland Grunberg 3256ab5769 Fix Tycho file locking to work in Fedora.
- Skip validateConsistentTychoVersion by default. (Bug 987271)
2013-07-29 13:23:26 -04:00
Roland Grunberg e78f26a176 Non-bootstrap build. 2013-07-29 13:23:07 -04:00
Roland Grunberg d351d154a0 Use MavenSession and Plexus to determine state.
- Fix bootstrap build.
2013-07-29 13:21:44 -04:00
Roland Grunberg f0a74e40b5 Make changes to ensure intermediary build succeeds.
- Remove %Patch6 in favour of call to sed.
2013-07-18 12:15:05 -04:00
Krzysztof Daniel 1cf8b50d36 Update to 0.18.1. 2013-07-18 12:14:36 -04:00
Roland Grunberg 68d7847ffe Look for maven artifacts using XMvn Resolver. 2013-07-18 12:12:39 -04:00
9 changed files with 397 additions and 311 deletions

View File

@ -1,2 +1,2 @@
9cb3258a724ba3b141be77d7c7ffde23 maven-repo.tar.xz
09a6a99b626ca52ecc3d65c574f8d087 tycho-0.18.x.tar.bz2
2519253ad74fd2613f1ce3250a646d8a org.eclipse.tycho-tycho-0.18.x.tar.bz2
42dfaf1a7768e5ddb6268ae7e4ad2e11 maven-repo.tar.xz

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 4bd0fb083b6329ddc8df7b09dcfded3a45113a2f Mon Sep 17 00:00:00 2001
From 446e73cd3c2ef5ed8d5dc57615d88ef36445bafa Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
Date: Mon, 19 Nov 2012 10:33:43 -0500
Subject: [PATCH] Minor fixes of limited scope to get a Tycho bootstrapped
@ -50,7 +50,7 @@ index 47423e5..4b4c600 100644
jetty.addConnector(connector);
diff --git a/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target b/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
index 2063db2..bd011fe 100644
index 2a04214..400117a 100644
--- a/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
+++ b/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
@@ -2,16 +2,16 @@
@ -58,15 +58,14 @@ index 2063db2..bd011fe 100644
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="false" type="InstallableUnit">
-<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.0.v20130521-0416"/>
-<unit id="org.eclipse.sdk.ide" version="4.3.0.I20130526-0500"/>
-<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.8.0.v20130526-0335"/>
-<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.8.0.v20130515-2026"/>
-<unit id="org.eclipse.sdk.ide" version="4.3.0.I20130605-2000"/>
-<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.8.0.v20130604-2046"/>
-<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.8.0.v20130529-1710"/>
+<unit id="org.eclipse.equinox.executable.feature.group"/>
+<unit id="org.eclipse.sdk.ide"/>
+<unit id="org.eclipse.equinox.p2.sdk.feature.group"/>
+<unit id="org.eclipse.equinox.core.sdk.feature.group"/>
-<repository location="http://download.eclipse.org/eclipse/updates/4.3-I-builds/I20130526-0500/"/>
+<repository location="http://download.eclipse.org/eclipse/updates/4.3milestones/S-4.3M6-201303141330/"/>
<repository location="http://download.eclipse.org/releases/kepler/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="false" type="InstallableUnit">
<!-- required for surefire junit3 provider -->
@ -133,7 +132,7 @@ index 1aec480..0eeb0fa 100644
throw new OsgiManifestParserException(location, e);
}
diff --git a/tycho-surefire/pom.xml b/tycho-surefire/pom.xml
index 7dd7c41..62d5610 100644
index 7b9697c..43ab800 100644
--- a/tycho-surefire/pom.xml
+++ b/tycho-surefire/pom.xml
@@ -41,7 +41,7 @@

View File

@ -1,4 +1,4 @@
From 8c4a712700b4ef835bd40dd4061246679d4fe435 Mon Sep 17 00:00:00 2001
From 1c9fe22c06bfa298f17e9aa35e8fffb031824a21 Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
Date: Tue, 12 Jun 2012 09:56:38 -0400
Subject: [PATCH] Fix the Tycho build to work on Fedora.
@ -12,10 +12,7 @@ Tycho upstream currently depends upon 0.15.0 when building
Fedora we depend on the previously built version which has that version
checking. We must keep previous build version strings different to avoid
a cyclic dependency, but doing so causes the version checking to fail,
so we must provide a way to disable it. (skipTychoVersionCheck)
As of Eclipse Kepler, the bundle 'org.junit4' is no longer provided.
Packages requiring JUnit 4 must use proper versioning on 'org.junit'.
so we must provide a way to disable it. Disable by default.
Update to using Jetty 9 API.
@ -35,14 +32,13 @@ Change-Id: Ic8c0514c1fa10ee53580d2654ac6a363ccd66814
.../maven/plugin/CompilationFailureException.java | 4 +--
.../core/maven/TychoMavenLifecycleParticipant.java | 4 ++-
.../tycho/test/AbstractTychoIntegrationTest.java | 11 +++---
.../tycho/testing/EmptyLifecycleExecutor.java | 8 +++++
13 files changed, 53 insertions(+), 49 deletions(-)
12 files changed, 45 insertions(+), 49 deletions(-)
diff --git a/pom.xml b/pom.xml
index 3b57368..2651c9b 100644
index 76d5d1d..5e398a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -208,12 +208,12 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
@@ -219,12 +219,12 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
@ -57,7 +53,7 @@ index 3b57368..2651c9b 100644
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
@@ -226,11 +226,6 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
@@ -237,11 +237,6 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
<version>${jdtVersion}</version>
</dependency>
<dependency>
@ -70,7 +66,7 @@ index 3b57368..2651c9b 100644
<artifactId>surefire-booter</artifactId>
<version>2.10</version>
diff --git a/tycho-artifactcomparator/pom.xml b/tycho-artifactcomparator/pom.xml
index 84613d1..48139c9 100644
index 39a45fd..d558b16 100644
--- a/tycho-artifactcomparator/pom.xml
+++ b/tycho-artifactcomparator/pom.xml
@@ -24,7 +24,7 @@
@ -131,7 +127,7 @@ index 57b4e10..47423e5 100644
jetty.addConnector(connector);
diff --git a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product
index 02d1dd1..ba9471a 100644
index 9185cd4..27f16f5 100644
--- a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product
+++ b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product
@@ -42,7 +42,6 @@
@ -155,7 +151,7 @@ index 62b354d..11f65fb 100644
<plugin id="org.eclipse.equinox.frameworkadmin"/>
<plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
diff --git a/tycho-compiler-jdt/pom.xml b/tycho-compiler-jdt/pom.xml
index f2c321f..75f4cd7 100644
index 20671c8..a71bd8b 100644
--- a/tycho-compiler-jdt/pom.xml
+++ b/tycho-compiler-jdt/pom.xml
@@ -38,10 +38,6 @@
@ -356,7 +352,7 @@ index 78dc4d8..8b73147 100644
sb.append(compilerError).append(LS);
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
index 3efb896..cccb6ff 100644
index 3efb896..3568d3b 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
@@ -84,7 +84,9 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
@ -364,7 +360,7 @@ index 3efb896..cccb6ff 100644
private void validate(List<MavenProject> projects) throws MavenExecutionException {
- validateConsistentTychoVersion(projects);
+ if (System.getProperty("skipTychoVersionCheck") == null) {
+ if (System.getProperty("tycho.enableVersionCheck") != null) {
+ validateConsistentTychoVersion(projects);
+ }
validateUniqueBaseDirs(projects);
@ -392,25 +388,6 @@ index df63b2f..510db0a 100644
}
return verifier;
diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/EmptyLifecycleExecutor.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/EmptyLifecycleExecutor.java
index a9d80d3..3ddbe9c 100644
--- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/EmptyLifecycleExecutor.java
+++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/EmptyLifecycleExecutor.java
@@ -37,6 +37,14 @@ public class EmptyLifecycleExecutor implements LifecycleExecutor {
return null;
}
+ public MavenExecutionPlan calculateExecutionPlan(MavenSession session, boolean bool, String... tasks)
+ throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
+ MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
+ PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
+ PluginVersionResolutionException {
+ return null;
+ }
+
public MavenExecutionPlan calculateExecutionPlan(MavenSession session, String... tasks)
throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
--
1.8.1.4

View File

@ -395,7 +395,7 @@ index e75a51f..1b5ac72 100644
+ jars/surefire-api-2.13.jar,
+ jars/maven-surefire-common-2.13.jar,
+ jars/plexus-utils-3.0.jar
Bundle-Version: 0.18.0
Bundle-Version: 0.18.1
Bundle-Name: Tycho Surefire OSGi Booter Eclipse Application (Incubation)
Bundle-ManifestVersion: 2
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml

View File

@ -1,20 +0,0 @@
diff --git a/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target b/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
index 2063db2..44b60d2 100644
--- a/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
+++ b/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
@@ -2,15 +2,10 @@
<?pde version="3.8"?><target name="Target platform for Tycho's bundles" sequenceNumber="16">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="false" type="InstallableUnit">
-<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.0.v20130521-0416"/>
-<unit id="org.eclipse.sdk.ide" version="4.3.0.I20130526-0500"/>
-<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.8.0.v20130526-0335"/>
-<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.8.0.v20130515-2026"/>
<repository location="http://download.eclipse.org/eclipse/updates/4.3-I-builds/I20130526-0500/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="false" type="InstallableUnit">
<!-- required for surefire junit3 provider -->
-<unit id="org.junit" version="3.8.2.v3_8_2_v20100427-1100"/>
<repository location="http://download.eclipse.org/releases/indigo"/>
</location>
</locations>

View File

@ -1,13 +0,0 @@
diff --git a/pom.xml b/pom.xml
index fd9920b..8a469d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -145,7 +145,7 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
<jdtAptVersion>1.0.600.v20130227-1643</jdtAptVersion>
<!-- version of tycho used by this build -->
- <tychoBootstrapVersion>0.16.0</tychoBootstrapVersion>
+ <tychoBootstrapVersion>0.18.0-SNAPSHOT</tychoBootstrapVersion>
</properties>
<dependencyManagement>

View File

@ -1,4 +1,4 @@
From 6f5e04370e6aec093b9f1df2a5afa5c40eccc666 Mon Sep 17 00:00:00 2001
From 92cdfc9a21142cc866265b45b37e85547145d15d Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
Date: Tue, 12 Jun 2012 10:38:51 -0400
Subject: [PATCH] Implement a custom resolver for Tycho in local mode.
@ -19,21 +19,29 @@ has a dependency on javax.lang.model (since 1.6).
Use the defined target environments in local mode when the property
tycho.local.keepTarget is set.
In situations where Tycho must resolve maven artifacts, upstream's
implementation only looks in the reactor cache. In Fedora, maven
artifacts may be located on the system using repository layouts
understood by XMvn. Therefore, when an artifact is not found in the
reactor cache, resolution should be attempted using the XMvn Resolver.
Change-Id: Ia1ece07ece2412bc4a88901631f3f651ad2b634b
---
.../tycho/p2/target/TargetDefinitionResolver.java | 11 +++--
.../tycho/p2/target/TargetPlatformBuilderImpl.java | 55 ++++++++++++++++++++--
.../tycho/p2/repository/LocalRepositoryReader.java | 31 +++++++++++-
tycho-core/pom.xml | 5 ++
.../core/maven/TychoMavenLifecycleParticipant.java | 16 +++++++
.../eclipse/tycho/core/locking/FileLockerImpl.java | 24 +++++++---
.../core/maven/TychoMavenLifecycleParticipant.java | 28 +++++++++++
.../tycho/core/osgitools/AbstractTychoProject.java | 24 ++++++++++
.../tycho/core/osgitools/OsgiBundleProject.java | 29 +++++++++++-
.../DefaultTargetPlatformConfigurationReader.java | 6 ++-
.../osgi/runtime/TychoOsgiRuntimeLocator.java | 17 +++++++
.../p2/resolver/P2TargetPlatformResolver.java | 11 +++++
9 files changed, 164 insertions(+), 10 deletions(-)
11 files changed, 223 insertions(+), 18 deletions(-)
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
index 2dc91ff..34c48ff 100644
index 2dc91ff..8395f82 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.CoreException;
@ -52,7 +60,7 @@ index 2dc91ff..34c48ff 100644
- artifactRepositories.add(repository.getLocation());
- metadataRepositories.add(loadRepository(repository));
+ // We cannot resolve a non-file URI in local mode
+ if ((System.getenv("TYCHO_MVN_LOCAL") == null && System.getenv("TYCHO_MVN_RPMBUILD") == null)
+ if ((System.getProperty("TYCHO_MVN_LOCAL") == null && System.getProperty("TYCHO_MVN_RPMBUILD") == null)
+ || URIUtil.isFileURI(repository.getLocation())) {
+ repositoryIdManager.addMapping(repository.getId(), repository.getLocation());
+ artifactRepositories.add(repository.getLocation());
@ -62,7 +70,7 @@ index 2dc91ff..34c48ff 100644
IQueryable<IInstallableUnit> locationUnits = new CompoundQueryable<IInstallableUnit>(
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
index 5b61351..be3c47f 100644
index 5b61351..b81f6be 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
@@ -38,6 +38,9 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent;
@ -80,7 +88,7 @@ index 5b61351..be3c47f 100644
IArtifactRepository artifactRepository = null;
+ // We cannot resolve a non-file URI in local mode while offline
+ if (System.getenv("TYCHO_MVN_RPMBUILD") != null && !URIUtil.isFileURI(location.getURL())) {
+ if (System.getProperty("TYCHO_MVN_RPMBUILD") != null && !URIUtil.isFileURI(location.getURL())) {
+ return;
+ }
+
@ -96,7 +104,7 @@ index 5b61351..be3c47f 100644
- for (IMetadataRepository repository : metadataRepositories) {
- IQueryResult<IInstallableUnit> matches = repository.query(QueryUtil.ALL_UNITS, sub.newChild(100));
- result.addAll(matches.toUnmodifiableSet());
+ if (System.getenv("TYCHO_MVN_LOCAL") != null) {
+ if (System.getProperty("TYCHO_MVN_LOCAL") != null) {
+ final String uri = "file:" + System.getProperty("user.dir") + "/.m2/p2/repo";
+ final IExpression notmatchIU_ID = ExpressionUtil.parse("id != $0");
+ IMetadataRepository systemLocalP2Repo = null;
@ -142,8 +150,56 @@ index 5b61351..be3c47f 100644
if (includeLocalMavenRepo && logger.isDebugEnabled()) {
IQueryResult<IInstallableUnit> locallyInstalledIUs = localMetadataRepository.query(QueryUtil.ALL_UNITS,
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalRepositoryReader.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalRepositoryReader.java
index 8d36462..eb05eff 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalRepositoryReader.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/repository/LocalRepositoryReader.java
@@ -11,6 +11,7 @@
package org.eclipse.tycho.p2.repository;
import java.io.File;
+import java.lang.reflect.Method;
public class LocalRepositoryReader implements RepositoryReader {
@@ -21,7 +22,33 @@ public class LocalRepositoryReader implements RepositoryReader {
}
public File getLocalArtifactLocation(GAV gav, String classifier, String extension) {
- return new File(localMavenRepositoryRoot, RepositoryLayoutHelper.getRelativePath(gav, classifier, extension));
- }
+ File file = new File(localMavenRepositoryRoot, RepositoryLayoutHelper.getRelativePath(gav, classifier, extension));
+ // In Fedora the artifact may be in an XMvn-defined repository location (not in reactor cache)
+ if (!file.exists()) {
+ try {
+ // Use plexus container to add, and lookup the resolver
+ Class pclazz = Class.forName("org.codehaus.plexus.DefaultPlexusContainer");
+ Object plexus = pclazz.newInstance();
+
+ // The resolver
+ Class rclazz = Class.forName("org.fedoraproject.maven.resolver.DefaultResolver");
+
+ // Add the resolver to the plexus container
+ Method mAdd = pclazz.getMethod("addComponent", Object.class, String.class);
+ mAdd.invoke(plexus, rclazz.newInstance(), "org.fedoraproject.maven.resolver.Resolver");
+ // Retrieve the resolver from the plexus container
+ Method mLookup = pclazz.getMethod("lookup", String.class);
+ Object reader = mLookup.invoke(plexus, "org.fedoraproject.maven.resolver.Resolver");
+
+ // Invoke "resolve" method of the resolver
+ Method mResolve = reader.getClass().getMethod("resolve", String.class, String.class, String.class, String.class);
+ file = (File) mResolve.invoke(reader, gav.getGroupId(), gav.getArtifactId(), gav.getVersion(), extension);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return file;
+
+ }
}
diff --git a/tycho-core/pom.xml b/tycho-core/pom.xml
index 25ef342..72c5bb5 100644
index d1289b6..53cdc7a 100644
--- a/tycho-core/pom.xml
+++ b/tycho-core/pom.xml
@@ -146,6 +146,11 @@
@ -158,8 +214,53 @@ index 25ef342..72c5bb5 100644
<dependency>
<groupId>org.eclipse.tycho</groupId>
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockerImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockerImpl.java
index 86253bd..247b2b2 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockerImpl.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockerImpl.java
@@ -27,22 +27,34 @@ public class FileLockerImpl implements FileLocker {
final File lockMarkerFile;
public FileLockerImpl(File file, Location anyLocation) {
+ File lockFileCandidate = null;
try {
if (file.isDirectory()) {
- this.lockMarkerFile = new File(file, LOCKFILE_SUFFIX).getCanonicalFile();
+ lockFileCandidate = new File(file, LOCKFILE_SUFFIX).getCanonicalFile();
} else {
- this.lockMarkerFile = new File(file.getParentFile(), file.getName() + LOCKFILE_SUFFIX)
- .getCanonicalFile();
+ lockFileCandidate = new File(file.getParentFile(), file.getName() + LOCKFILE_SUFFIX).getCanonicalFile();
}
- if (lockMarkerFile.isDirectory()) {
- throw new RuntimeException("Lock marker file " + lockMarkerFile + " already exists and is a directory");
+
+ if (lockFileCandidate.isDirectory()) {
+ throw new RuntimeException("Lock marker file " + lockFileCandidate + " already exists and is a directory");
}
- File parentDir = lockMarkerFile.getParentFile();
+ File parentDir = lockFileCandidate.getParentFile();
if (!parentDir.isDirectory() && !parentDir.mkdirs()) {
throw new RuntimeException("Could not create parent directory " + parentDir + " of lock marker file");
}
+
+ String reactorCache = System.getProperty("user.dir") + "/.m2/";
+ // In Fedora we can only assume reactor cache is safe for read/write.
+ if (!lockFileCandidate.getAbsolutePath().startsWith(reactorCache)) {
+ String lockFileDir = reactorCache + LOCKFILE_SUFFIX;
+ String lockFileName = file.getAbsolutePath().replace("/", "-").replaceFirst("-", "/") + LOCKFILE_SUFFIX;
+ lockFileCandidate = new File(lockFileDir, lockFileName);
+ }
+
+ this.lockMarkerFile = lockFileCandidate;
this.lockFileLocation = anyLocation.createLocation(null, null, false);
this.lockFileLocation.set(lockMarkerFile.toURL(), false, lockMarkerFile.getAbsolutePath());
+
} catch (MalformedURLException e) {
throw new RuntimeException(e);
} catch (IOException e) {
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
index cccb6ff..fb8bf78 100644
index 3568d3b..dc77848 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
@@ -11,6 +11,7 @@
@ -170,12 +271,24 @@ index cccb6ff..fb8bf78 100644
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -73,6 +74,21 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
@@ -73,6 +74,33 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
registerExecutionListener(session);
configureComponents(session);
+ try {
+ if (plexus.lookup("org.fedoraproject.maven.resolver.Resolver") != null) {
+ if (session.isOffline()) {
+ System.setProperty("TYCHO_MVN_RPMBUILD", "");
+ } else {
+ System.setProperty("TYCHO_MVN_LOCAL", "");
+ }
+ }
+ } catch (ComponentLookupException e) {
+ // No XMvn (Upstream Maven in use)
+ }
+
+ // Create a system p2 repository for local dependency resolution
+ if (System.getenv("TYCHO_MVN_LOCAL") != null || System.getenv("TYCHO_MVN_RPMBUILD") != null) {
+ if (System.getProperty("TYCHO_MVN_LOCAL") != null || System.getProperty("TYCHO_MVN_RPMBUILD") != null) {
+ try {
+ String[] cmd = new String[] { "/usr/share/java/tycho/copy-platform-all",
+ System.getProperty("user.dir") + "/.m2/p2/repo" };
@ -193,7 +306,7 @@ index cccb6ff..fb8bf78 100644
resolver.setupProject(session, project, DefaultReactorProject.adapt(project));
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java
index 695133d..ad25d9c 100644
index 695133d..542a0f7 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractTychoProject.java
@@ -20,6 +20,9 @@ import org.eclipse.tycho.artifacts.TargetPlatform;
@ -227,7 +340,7 @@ index 695133d..ad25d9c 100644
+ try {
+ ExecutionEnvironment ee = ExecutionEnvironmentUtils.getExecutionEnvironment(profile);
+
+ if (System.getenv("TYCHO_MVN_LOCAL") != null || System.getenv("TYCHO_MVN_RPMBUILD") != null) {
+ if (System.getProperty("TYCHO_MVN_LOCAL") != null || System.getProperty("TYCHO_MVN_RPMBUILD") != null) {
+ // EE must be at least JavaSE-1.6
+ final ExecutionEnvironment javaSE16 = ExecutionEnvironmentUtils.getExecutionEnvironment("JavaSE-1.6");
+ if (! ee.isCompatibleCompilerTargetLevel(javaSE16.getCompilerTargetLevelDefault())) {
@ -246,7 +359,7 @@ index 695133d..ad25d9c 100644
return (TargetPlatform) project.getContextValue(TychoConstants.CTX_TARGET_PLATFORM);
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
index ab40599..3e64271 100644
index ab40599..4adb5da 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
@@ -45,7 +45,9 @@ import org.eclipse.tycho.core.BundleProject;
@ -276,7 +389,7 @@ index ab40599..3e64271 100644
+ ExecutionEnvironment manifestMinimalEE = Collections.min(envs);
+ ExecutionEnvironment tmp;
+
+ if (System.getenv("TYCHO_MVN_LOCAL") != null || System.getenv("TYCHO_MVN_RPMBUILD") != null) {
+ if (System.getProperty("TYCHO_MVN_LOCAL") != null || System.getProperty("TYCHO_MVN_RPMBUILD") != null) {
+ try {
+ // EE must be at least JavaSE-1.6
+ final ExecutionEnvironment javaSE16 = ExecutionEnvironmentUtils.getExecutionEnvironment("JavaSE-1.6");
@ -301,7 +414,7 @@ index ab40599..3e64271 100644
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java
index edfc57b..d65b464 100644
index edfc57b..287cbca 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java
@@ -64,7 +64,11 @@ public class DefaultTargetPlatformConfigurationReader {
@ -310,7 +423,7 @@ index edfc57b..d65b464 100644
- addTargetEnvironments(result, project, configuration);
+ // Use the defined environments only in local mode with tycho.local.keepTarget
+ if ((System.getenv("TYCHO_MVN_LOCAL") == null && System.getenv("TYCHO_MVN_RPMBUILD") == null)
+ if ((System.getProperty("TYCHO_MVN_LOCAL") == null && System.getProperty("TYCHO_MVN_RPMBUILD") == null)
+ || System.getProperty("tycho.local.keepTarget") != null) {
+ addTargetEnvironments(result, project, configuration);
+ }
@ -360,7 +473,7 @@ index 1e878e5..2de11ad 100644
request.setArtifact(artifact);
request.setResolveRoot(true).setResolveTransitively(false);
diff --git a/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java b/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
index f6f56ac..5abfd79 100644
index f6f56ac..b9b8cba 100644
--- a/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
+++ b/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
@@ -189,6 +189,17 @@ public class P2TargetPlatformResolver extends AbstractTargetPlatformResolver imp
@ -369,7 +482,7 @@ index f6f56ac..5abfd79 100644
tpBuilder.setFailOnDuplicateIUs(failOnDuplicateIUs);
+
+ // Add Fedora Local P2 Repository when running in local mode
+ if (System.getenv("TYCHO_MVN_LOCAL") != null || System.getenv("TYCHO_MVN_RPMBUILD") != null) {
+ if (System.getProperty("TYCHO_MVN_LOCAL") != null || System.getProperty("TYCHO_MVN_RPMBUILD") != null) {
+ String uri = "file:" + System.getProperty("user.dir") + "/.m2/p2/repo";
+ try {
+ tpBuilder.addP2Repository(new MavenRepositoryLocation(uri, new URI(uri)));

View File

@ -8,15 +8,15 @@
%define __requires_exclude osgi*
Name: tycho
Version: 0.18.0
Release: 3%{?dist}
Version: 0.18.1
Release: 4%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
Group: Development/Libraries
# license file is missing but all files having some licensing information are ASL 2.0
License: ASL 2.0
URL: http://tycho.sonatype.org/
Source0: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/snapshot/tycho-0.18.x.tar.bz2
Source0: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/snapshot/org.eclipse.tycho-tycho-0.18.x.tar.bz2
# this is a workaround for maven-plugin-plugin changes that happened after
# version 2.4.3 (impossible to have empty mojo created as aggregate). This
@ -39,11 +39,6 @@ Patch3: %{name}-use-custom-resolver.patch
# a different version from the nonbootstrapped. Otherwise there will
# be cyclic dependencies.
Patch4: %{name}-bootstrap.patch
# Maven local mode will look in reactor cache for exact version (path lookup)
# Set the built intermediary version of Tycho to be found in the reactor cache
Patch5: %{name}-set-reactor-cache-version.patch
# These units cannot be found during a regular build
Patch6: %{name}-remove-units.patch
# Additional changes needed just for bootstrap build
Patch7: %{name}-fix-bootstrap-build.patch
@ -141,7 +136,7 @@ Requires: jpackage-utils
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{name}-0.18.x
%setup -q -n org.eclipse.tycho-%{name}-0.18.x
%patch0 -p1
%patch1 -p1
@ -162,6 +157,11 @@ popd
%if %{bootstrap}
tar -xf %{SOURCE4}
# EXACT version in reactor cache to build against when bootstrapping
# If we built our own Tycho locally and put it into reactor cache instead
# of using upstream's then we need to make sure the build finds it.
sed -i 's/<tychoBootstrapVersion>0.16.0<\/tychoBootstrapVersion>/<tychoBootstrapVersion>0.18.0<\/tychoBootstrapVersion>/' pom.xml
# gid:aid used by bootstrapped build dependencies
mkdir -p .m2/org/ow2/asm/asm-debug-all/4.0/
pushd .m2/org/ow2/asm/asm-debug-all/4.0/
@ -171,10 +171,14 @@ popd
%patch7 -p1
# Tycho can't use cached composite repository metadata so use other type
sed -i 's/releases\/kepler\//releases\/kepler\/201306260900/' tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
# Non-Bootstrap Build
%else
%patch6 -p1
# These units cannot be found during a regular build
sed -i '/^<unit id=.*$/d' tycho-bundles/tycho-bundles-target/tycho-bundles-target.target
# installed version of Tycho
sysVer=`grep -C 1 "<artifactId>tycho</artifactId>" %{_mavenpomdir}/JPP.tycho-main.pom | grep "version" | sed 's/.*>\(.*\)<.*/\1/'`
@ -193,7 +197,9 @@ echo "Performing intermediary build"
mvn-rpmbuild -Dmaven.local.depmap.file=%{SOURCE2} -DskipTychoVersionCheck -Dmaven.test.skip=true install javadoc:aggregate
%patch4 -p1 -R
%patch5 -p1
# EXACT version in reactor cache to build against (%%{version}-SNAPSHOT)
sed -i 's/<tychoBootstrapVersion>0.16.0<\/tychoBootstrapVersion>/<tychoBootstrapVersion>0.18.1-SNAPSHOT<\/tychoBootstrapVersion>/' pom.xml
fi
%endif
@ -284,6 +290,30 @@ install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar
%{_javadocdir}/%{name}
%changelog
* Tue Jul 30 2013 Roland Grunberg <rgrunber@redhat.com> - 0.18.1-4
- Improve artifact resolution using XMvn Resolver. (Bug 986900)
* Mon Jul 29 2013 Roland Grunberg <rgrunber@redhat.com> - 0.18.1-3
- Fix Tycho file locking to work in Fedora.
- Skip validateConsistentTychoVersion by default. (Bug 987271)
* Wed Jul 24 2013 Roland Grunberg <rgrunber@redhat.com> - 0.18.1-2
- Non-bootstrap build.
* Wed Jul 24 2013 Roland Grunberg <rgrunber@redhat.com> - 0.18.1-1.1
- Use MavenSession and Plexus to determine state.
- Fix bootstrap build.
* Thu Jul 18 2013 Roland Grunberg <rgrunber@redhat.com> 0.18.1-1
- Make changes to ensure intermediary build succeeds.
- Remove %%Patch6 in favour of call to sed.
* Thu Jul 18 2013 Krzysztof Daniel <kdaniel@redhat.com> 0.18.1-1
- Update to 0.18.1.
* Tue Jul 16 2013 Roland Grunberg <rgrunber@redhat.com> - 0.18.0-4
- Look for maven artifacts using XMvn Resolver.
* Fri Jul 5 2013 Alexander Kurtakov <akurtako@redhat.com> 0.18.0-3
- Use _jnidir too when building local p2 repo.
@ -294,7 +324,7 @@ install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar
* Tue May 28 2013 Roland Grunberg <rgrunber@redhat.com> 0.18.0-1
- Update to 0.18.0 Release.
* Tue Apr 11 2013 Roland Grunberg <rgrunber@redhat.com> 0.17.0-1
* Thu Apr 11 2013 Roland Grunberg <rgrunber@redhat.com> 0.17.0-1
- Fix bootstrap build for potential future use.
* Tue Apr 2 2013 Roland Grunberg <rgrunber@redhat.com> 0.17.0-1