[java-sig-commits] [tycho] Set BREE to at least JavaSE-1.6 when building OSGi bundles.

Roland Grunberg rgrunber at fedoraproject.org
Wed May 23 15:08:05 UTC 2012


commit 34928e3a9fb88be90f4a29b4a985834a54ce3284
Author: Roland Grunberg <rgrunber at redhat.com>
Date:   Tue May 22 15:22:54 2012 -0400

    Set BREE to at least JavaSE-1.6 when building OSGi bundles.
    
    Since Fedora 17, we need an Execution Environment of at least JavaSE-1.6
    for Eclipse bundles. Eclipse Juno platform bundles depend on
    javax.annotation. In Fedora this is provided by geronimo-annotation, but
    has a dependency on javax.lang.model (since 1.6).

 tycho-use-custom-resolver.patch |   56 +++++++++++++++++++++++++++++++++++++++
 tycho.spec                      |    7 +++-
 2 files changed, 61 insertions(+), 2 deletions(-)
---
diff --git a/tycho-use-custom-resolver.patch b/tycho-use-custom-resolver.patch
index 3894258..5c6f8b3 100644
--- a/tycho-use-custom-resolver.patch
+++ b/tycho-use-custom-resolver.patch
@@ -82,3 +82,59 @@ index 15b3fff..c8f14df 100644
          List<ArtifactRepository> repositories = new ArrayList<ArtifactRepository>();
          for (MavenProject project : session.getProjects()) {
              repositories.addAll(project.getPluginArtifactRepositories());
+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 8d18453..051913e 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
+@@ -505,6 +505,28 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
+         }
+ 
+         ExecutionEnvironment manifestMinimalEE = Collections.min(envs);
++        ExecutionEnvironment tmp;
++
++        if (System.getProperty("maven.local.mode") != null) {
++            try {
++                // EE must be at least JavaSE-1.6
++                final ExecutionEnvironment javaSE16 = ExecutionEnvironmentUtils.getExecutionEnvironment("JavaSE-1.6");
++                while (!envs.isEmpty()) {
++                    tmp = Collections.min(envs);
++                    if (tmp.compareTo(javaSE16) >= 0) {
++                        manifestMinimalEE = tmp;
++                        break;
++                    }
++                    envs.remove(tmp);
++                }
++
++                if (envs.isEmpty()) {
++                    return javaSE16;
++                }
++            } catch (UnknownEnvironmentException e) {
++                // Continue
++            }
++        }
+ 
+         if (buildMinimalEE == null) {
+             return manifestMinimalEE;
+@@ -515,7 +537,21 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
+ 
+     protected ExecutionEnvironment getExecutionEnvironment(MavenProject project, String profile) {
+         try {
+-            return ExecutionEnvironmentUtils.getExecutionEnvironment(profile);
++            ExecutionEnvironment ee = ExecutionEnvironmentUtils.getExecutionEnvironment(profile);
++
++            if (System.getProperty("maven.local.mode") != null && ee != null) {
++                try {
++                    // EE must be at least JavaSE-1.6
++                    final ExecutionEnvironment javaSE16 = ExecutionEnvironmentUtils.getExecutionEnvironment("JavaSE-1.6");
++                    if (ee.compareTo(javaSE16) < 0) {
++                        ee = javaSE16;
++                    }
++                } catch (UnknownEnvironmentException e) {
++                    // Continue
++                }
++            }
++
++            return ee;
+         } catch (UnknownEnvironmentException e) {
+             throw new RuntimeException("Unknown execution environment specified in build.properties of project "
+                     + project, e);
diff --git a/tycho.spec b/tycho.spec
index 6429d18..b83e7d0 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -1,4 +1,4 @@
-%global bootstrap 0
+%global bootstrap 1
 
 %if %{bootstrap}
 %global snap -SNAPSHOT
@@ -8,7 +8,7 @@
 
 Name:           tycho
 Version:        0.14.1
-Release:        3%{?dist}
+Release:        3.1%{?dist}
 Summary:        Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
 
 Group:          Development/Libraries
@@ -193,6 +193,9 @@ cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}
 %{_javadocdir}/%{name}
 
 %changelog
+* Thu May 17 2012 Roland Grunberg <rgrunber at redhat.com> 0.14.1-3.1
+- Set BREE to be at least JavaSE-1.6 for Eclipse OSGi bundles.
+
 * Wed May 16 2012 Roland Grunberg <rgrunber at redhat.com> 0.14.1-3
 - Non-bootstrap build.
 


More information about the java-sig-commits mailing list