use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration in project tycho by eclipse.
the class TestMojoToolchainTests method setupWithBree.
public void setupWithBree() throws Exception {
setParameter(testMojo, "useJDK", JDKUsage.BREE);
ExecutionEnvironmentConfiguration envConf = mock(ExecutionEnvironmentConfiguration.class);
when(envConf.getProfileName()).thenReturn("myId");
project.setContextValue(TychoConstants.CTX_EXECUTION_ENVIRONMENT_CONFIGURATION, envConf);
}
use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration in project tycho by eclipse.
the class P2DependencyResolver method computePreliminaryTargetPlatform.
@Override
public TargetPlatform computePreliminaryTargetPlatform(MavenSession session, MavenProject project, List<ReactorProject> reactorProjects) {
TargetPlatformConfiguration configuration = TychoProjectUtils.getTargetPlatformConfiguration(project);
ExecutionEnvironmentConfiguration ee = TychoProjectUtils.getExecutionEnvironmentConfiguration(project);
TargetPlatformConfigurationStub tpConfiguration = new TargetPlatformConfigurationStub();
tpConfiguration.setIncludePackedArtifacts(configuration.isIncludePackedArtifacts());
PomDependencyCollector pomDependencies = null;
if (TargetPlatformConfiguration.POM_DEPENDENCIES_CONSIDER.equals(configuration.getPomDependencies())) {
pomDependencies = collectPomDependencies(project, reactorProjects, session);
} else {
// TODO 412416 remove this when the setProjectLocation is no longer needed
pomDependencies = resolverFactory.newPomDependencyCollector();
pomDependencies.setProjectLocation(project.getBasedir());
}
for (ArtifactRepository repository : project.getRemoteArtifactRepositories()) {
addEntireP2RepositoryToTargetPlatform(repository, tpConfiguration);
}
tpConfiguration.setEnvironments(configuration.getEnvironments());
for (File file : configuration.getTargets()) {
addTargetFileContentToTargetPlatform(file, configuration.getTargetDefinitionIncludeSourceMode(), tpConfiguration);
}
tpConfiguration.addFilters(configuration.getFilters());
return reactorRepositoryManager.computePreliminaryTargetPlatform(DefaultReactorProject.adapt(project), tpConfiguration, ee, reactorProjects, pomDependencies);
}
use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration 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);
}
}
use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration in project tycho by eclipse.
the class DefaultTychoResolver method setupProject.
@Override
public void setupProject(MavenSession session, MavenProject project, ReactorProject reactorProject) {
AbstractTychoProject dr = (AbstractTychoProject) projectTypes.get(project.getPackaging());
if (dr == null) {
return;
}
// skip if setup was already done
if (project.getContextValue(TychoConstants.CTX_MERGED_PROPERTIES) != null) {
return;
}
// generic Eclipse/OSGi metadata
dr.setupProject(session, project);
// p2 metadata
Properties properties = new Properties();
properties.putAll(project.getProperties());
// session wins
properties.putAll(session.getSystemProperties());
properties.putAll(session.getUserProperties());
project.setContextValue(TychoConstants.CTX_MERGED_PROPERTIES, properties);
setTychoEnvironmentProperties(properties, project);
TargetPlatformConfiguration configuration = configurationReader.getTargetPlatformConfiguration(session, project);
project.setContextValue(TychoConstants.CTX_TARGET_PLATFORM_CONFIGURATION, configuration);
ExecutionEnvironmentConfiguration eeConfiguration = new ExecutionEnvironmentConfigurationImpl(logger, !configuration.isResolveWithEEConstraints());
dr.readExecutionEnvironmentConfiguration(project, eeConfiguration);
project.setContextValue(TychoConstants.CTX_EXECUTION_ENVIRONMENT_CONFIGURATION, eeConfiguration);
DependencyResolver resolver = dependencyResolverLocator.lookupDependencyResolver(project);
resolver.setupProjects(session, project, reactorProject);
}
use of org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration in project tycho by eclipse.
the class TestMojo method addCustomProfileArg.
private void addCustomProfileArg(EquinoxLaunchConfiguration cli) throws MojoExecutionException {
ExecutionEnvironmentConfiguration eeConfig = TychoProjectUtils.getExecutionEnvironmentConfiguration(project);
if (eeConfig.isCustomProfile()) {
Properties customProfileProps = eeConfig.getFullSpecification().getProfileProperties();
File profileFile = new File(new File(project.getBuild().getDirectory()), "custom.profile");
storeProperties(propertiesAsMap(customProfileProps), profileFile);
cli.addVMArguments("-D" + EquinoxConfiguration.PROP_OSGI_JAVA_PROFILE + "=" + profileFile.toURI());
}
}
Aggregations