Search in sources :

Example 1 with ExecutionEnvironmentConfiguration

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);
}
Also used : ExecutionEnvironmentConfiguration(org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration)

Example 2 with ExecutionEnvironmentConfiguration

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);
}
Also used : TargetPlatformConfigurationStub(org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub) ExecutionEnvironmentConfiguration(org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration) PomDependencyCollector(org.eclipse.tycho.p2.target.facade.PomDependencyCollector) ArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository) TargetPlatformConfiguration(org.eclipse.tycho.core.TargetPlatformConfiguration) File(java.io.File)

Example 3 with ExecutionEnvironmentConfiguration

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);
    }
}
Also used : StandardExecutionEnvironment(org.eclipse.tycho.core.ee.StandardExecutionEnvironment) ExecutionEnvironment(org.eclipse.tycho.core.ee.shared.ExecutionEnvironment) ExecutionEnvironmentConfiguration(org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration) BundleException(org.osgi.framework.BundleException)

Example 4 with ExecutionEnvironmentConfiguration

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);
}
Also used : ExecutionEnvironmentConfiguration(org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration) AbstractTychoProject(org.eclipse.tycho.core.osgitools.AbstractTychoProject) Properties(java.util.Properties) TargetPlatformConfiguration(org.eclipse.tycho.core.TargetPlatformConfiguration) ExecutionEnvironmentConfigurationImpl(org.eclipse.tycho.core.ee.ExecutionEnvironmentConfigurationImpl) DependencyResolver(org.eclipse.tycho.core.DependencyResolver)

Example 5 with ExecutionEnvironmentConfiguration

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());
    }
}
Also used : ExecutionEnvironmentConfiguration(org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration) Properties(java.util.Properties) File(java.io.File)

Aggregations

ExecutionEnvironmentConfiguration (org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration)5 File (java.io.File)2 Properties (java.util.Properties)2 TargetPlatformConfiguration (org.eclipse.tycho.core.TargetPlatformConfiguration)2 ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)1 DependencyResolver (org.eclipse.tycho.core.DependencyResolver)1 ExecutionEnvironmentConfigurationImpl (org.eclipse.tycho.core.ee.ExecutionEnvironmentConfigurationImpl)1 StandardExecutionEnvironment (org.eclipse.tycho.core.ee.StandardExecutionEnvironment)1 ExecutionEnvironment (org.eclipse.tycho.core.ee.shared.ExecutionEnvironment)1 AbstractTychoProject (org.eclipse.tycho.core.osgitools.AbstractTychoProject)1 PomDependencyCollector (org.eclipse.tycho.p2.target.facade.PomDependencyCollector)1 TargetPlatformConfigurationStub (org.eclipse.tycho.p2.target.facade.TargetPlatformConfigurationStub)1 BundleException (org.osgi.framework.BundleException)1