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

Roland Grunberg rgrunber at fedoraproject.org
Wed May 30 19:25:16 UTC 2012


commit c6e0bc76a54c1a5c7052e770fa03919f674255b1
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                      |    9 ++++--
 2 files changed, 62 insertions(+), 3 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 32da57c..ae53548 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -1,5 +1,5 @@
 %global eclipsedir %{_libdir}/eclipse
-%global bootstrap 0
+%global bootstrap 1
 
 %if %{bootstrap}
 %global snap -SNAPSHOT
@@ -9,7 +9,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
@@ -191,7 +191,10 @@ cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}
 %{_javadocdir}/%{name}
 
 %changelog
-* Tue May 22 2012 Roland Grunberg <rgrunber at redhat.com> 0.14.1-3
+* 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.
 
 * Wed Apr 25 2012 Roland Grunberg <rgrunber at redhat.com> 0.14.1-2.1


More information about the java-sig-commits mailing list