use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironment in project tycho by eclipse.
the class AbstractOsgiCompilerMojo method configureSourceAndTargetLevel.
private void configureSourceAndTargetLevel(CompilerConfiguration compilerConfiguration) throws MojoExecutionException {
ExecutionEnvironment ee = getTargetExecutionEnvironment();
compilerConfiguration.setSourceVersion(getSourceLevel(ee));
compilerConfiguration.setTargetVersion(getTargetLevel(ee));
}
use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironment in project tycho by eclipse.
the class EquinoxResolverTest method test_bundleRuntimeExecutionEnvironment.
public void test_bundleRuntimeExecutionEnvironment() throws Exception {
File basedir = getBasedir("projects/bree");
Properties properties = new Properties();
properties.put("tycho-version", TychoVersion.getTychoVersion());
List<MavenProject> projects = getSortedProjects(basedir, properties, null);
assertEquals(6, projects.size());
assertEquals("executionenvironment.manifest-minimal", projects.get(2).getArtifactId());
ExecutionEnvironment ee = TychoProjectUtils.getExecutionEnvironmentConfiguration(projects.get(2)).getFullSpecification();
assertEquals("CDC-1.0/Foundation-1.0", ee.getProfileName());
Properties platformProperties = subject.getPlatformProperties(projects.get(2), ee);
assertEquals("javax.microedition.io", platformProperties.get(Constants.FRAMEWORK_SYSTEMPACKAGES));
}
use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironment in project tycho by eclipse.
the class DependencyComputerTest method testExportPackage.
@Test
public void testExportPackage() throws Exception {
File basedir = getBasedir("projects/exportpackage");
Map<File, MavenProject> basedirMap = MavenSessionUtils.getBasedirMap(getSortedProjects(basedir, null));
MavenProject project = basedirMap.get(new File(basedir, "bundle"));
DependencyArtifacts platform = (DependencyArtifacts) project.getContextValue(TychoConstants.CTX_DEPENDENCY_ARTIFACTS);
ExecutionEnvironment executionEnvironment = TychoProjectUtils.getExecutionEnvironmentConfiguration(project).getFullSpecification();
State state = resolver.newResolvedState(project, executionEnvironment, false, platform);
BundleDescription bundle = state.getBundleByLocation(project.getBasedir().getAbsolutePath());
List<DependencyEntry> dependencies = dependencyComputer.computeDependencies(state.getStateHelper(), bundle);
Assert.assertEquals(3, dependencies.size());
Assert.assertEquals("dep", dependencies.get(0).desc.getSymbolicName());
Assert.assertEquals("dep2", dependencies.get(1).desc.getSymbolicName());
Assert.assertEquals("dep3", dependencies.get(2).desc.getSymbolicName());
Assert.assertTrue(dependencies.get(2).rules.isEmpty());
}
use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironment in project tycho by eclipse.
the class OsgiBundleProject method readExecutionEnvironmentConfiguration.
@Override
public void readExecutionEnvironmentConfiguration(MavenProject project, ExecutionEnvironmentConfiguration sink) {
// read packaging-type independent configuration
super.readExecutionEnvironmentConfiguration(project, sink);
// only in plugin projects, the profile may also be ...
// ... specified in build.properties (for PDE compatibility)
String pdeProfile = getEclipsePluginProject(DefaultReactorProject.adapt(project)).getBuildProperties().getJreCompilationProfile();
if (pdeProfile != null) {
sink.setProfileConfiguration(pdeProfile.trim(), "build.properties");
} else {
// ... derived from BREE in bundle manifest
StandardExecutionEnvironment[] manifestBREEs = getManifest(project).getExecutionEnvironments();
if (manifestBREEs.length > 0) {
TargetPlatformConfiguration tpConfiguration = TychoProjectUtils.getTargetPlatformConfiguration(project);
switch(tpConfiguration.getBREEHeaderSelectionPolicy()) {
case first:
sink.setProfileConfiguration(manifestBREEs[0].getProfileName(), "Bundle-RequiredExecutionEnvironment (first entry)");
break;
case minimal:
ExecutionEnvironment manifestMinimalEE = Collections.min(Arrays.asList(manifestBREEs));
sink.setProfileConfiguration(manifestMinimalEE.getProfileName(), "Bundle-RequiredExecutionEnvironment (minimal entry)");
}
}
}
}
use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironment in project tycho by eclipse.
the class OsgiBundleProject method getResolverState.
private State getResolverState(MavenProject project, DependencyArtifacts artifacts) {
try {
ExecutionEnvironmentConfiguration eeConfiguration = TychoProjectUtils.getExecutionEnvironmentConfiguration(project);
ExecutionEnvironment executionEnvironment = eeConfiguration.getFullSpecification();
return resolver.newResolvedState(project, executionEnvironment, eeConfiguration.isIgnoredByResolver(), artifacts);
} catch (BundleException e) {
throw new RuntimeException(e);
}
}
Aggregations