Search in sources :

Example 36 with TargetEnvironment

use of org.eclipse.tycho.core.shared.TargetEnvironment in project tycho by eclipse.

the class P2ResolverImpl method resolveDependencies.

@Override
public List<P2ResolutionResult> resolveDependencies(TargetPlatform targetPlatform, ReactorProject project) {
    setContext(targetPlatform, project);
    if (project != null && PackagingType.TYPE_ECLIPSE_TEST_PLUGIN.equals(project.getPackaging())) {
        addDependenciesForTests();
    }
    ArrayList<P2ResolutionResult> results = new ArrayList<>();
    usedTargetPlatformUnits = new LinkedHashSet<>();
    for (TargetEnvironment environment : environments) {
        results.add(resolveDependencies(project, new ProjectorResolutionStrategy(logger), environment));
    }
    context.reportUsedLocalIUs(usedTargetPlatformUnits);
    usedTargetPlatformUnits = null;
    return results;
}
Also used : ArrayList(java.util.ArrayList) P2ResolutionResult(org.eclipse.tycho.p2.resolver.facade.P2ResolutionResult) TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) ProjectorResolutionStrategy(org.eclipse.tycho.p2.util.resolution.ProjectorResolutionStrategy)

Example 37 with TargetEnvironment

use of org.eclipse.tycho.core.shared.TargetEnvironment in project tycho by eclipse.

the class PublisherActionRunner method setTargetEnvironments.

/**
 * Configure the list of target environments in the {@link PublisherInfo}. This information is
 * for example needed by the ProductAction which generates different configuration IUs for each
 * environment.
 */
private void setTargetEnvironments(PublisherInfo publisherInfo) {
    int writeIx = 0;
    String[] configSpecs = new String[environments.size()];
    for (TargetEnvironment environment : environments) {
        configSpecs[writeIx++] = environment.toConfigSpec();
    }
    publisherInfo.setConfigurations(configSpecs);
}
Also used : TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment)

Example 38 with TargetEnvironment

use of org.eclipse.tycho.core.shared.TargetEnvironment in project tycho by eclipse.

the class DirectorApplicationCommandTest method testAllDirectorApplicationArguments.

@Test
public void testAllDirectorApplicationArguments() {
    subject.addMetadataSources(Arrays.asList(REPO_1, REPO_2));
    subject.addArtifactSources(Arrays.asList(REPO_3));
    subject.addUnitToInstall(UNIT_1);
    subject.addUnitToInstall(UNIT_2);
    subject.setEnvironment(new TargetEnvironment(OS, WS, ARCH));
    subject.setProfileName(PROFILE_NAME);
    subject.setInstallFeatures(true);
    File dest = new File(".").getAbsoluteFile();
    subject.setDestination(dest);
    List<String> result = subject.getDirectorApplicationArguments();
    assertThat(result, hasSequence("-metadataRepository", REPO_1 + "," + REPO_2));
    assertThat(result, hasSequence("-artifactRepository", REPO_3.toString()));
    assertThat(result, hasSequence("-installIU", UNIT_1 + "," + UNIT_2));
    assertThat(result, hasSequence("-profile", PROFILE_NAME));
    assertThat(result, hasSequence("-profileProperties", "org.eclipse.update.install.features=true"));
    assertThat(result, hasSequence(PARAM_OS, OS));
    assertThat(result, hasSequence(PARAM_WS, WS));
    assertThat(result, hasSequence(PARAM_ARCH, ARCH));
    assertThat(result, hasSequence("-destination", dest.toString()));
    assertThat(result, hasItem("-roaming"));
}
Also used : TargetEnvironment(org.eclipse.tycho.core.shared.TargetEnvironment) File(java.io.File) Test(org.junit.Test)

Aggregations

TargetEnvironment (org.eclipse.tycho.core.shared.TargetEnvironment)38 Test (org.junit.Test)14 File (java.io.File)10 ArrayList (java.util.ArrayList)6 TargetPlatformConfiguration (org.eclipse.tycho.core.TargetPlatformConfiguration)6 HashMap (java.util.HashMap)4 LinkedHashMap (java.util.LinkedHashMap)3 LinkedHashSet (java.util.LinkedHashSet)3 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)3 MojoFailureException (org.apache.maven.plugin.MojoFailureException)3 Xpp3Dom (org.codehaus.plexus.util.xml.Xpp3Dom)3 P2ResolutionResult (org.eclipse.tycho.p2.resolver.facade.P2ResolutionResult)3 IOException (java.io.IOException)2 Map (java.util.Map)2 Properties (java.util.Properties)2 MavenSession (org.apache.maven.execution.MavenSession)2 MavenProject (org.apache.maven.project.MavenProject)2 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)2 ArtifactKey (org.eclipse.tycho.ArtifactKey)2 ReactorProject (org.eclipse.tycho.ReactorProject)2