コード例 #1
0
  public TargetPlatform computeTargetPlatform(
      MavenSession session, MavenProject project, List<ReactorProject> reactorProjects) {
    TargetPlatformConfiguration configuration =
        TychoProjectUtils.getTargetPlatformConfiguration(project);

    ExecutionEnvironment ee =
        projectTypes.get(project.getPackaging()).getExecutionEnvironment(project);

    TargetPlatformBuilder tpBuilder =
        resolverFactory.createTargetPlatformBuilder( //
            ee != null ? ee.getProfileName() : null, configuration.isDisableP2Mirrors());
    tpBuilder.setProjectLocation(project.getBasedir());

    addReactorProjectsToTargetPlatform(reactorProjects, tpBuilder);

    if (TargetPlatformConfiguration.POM_DEPENDENCIES_CONSIDER.equals(
        configuration.getPomDependencies())) {
      addPomDependenciesToTargetPlatform(project, tpBuilder, reactorProjects, session);
    }

    for (ArtifactRepository repository : project.getRemoteArtifactRepositories()) {
      addEntireP2RepositoryToTargetPlatform(repository, tpBuilder, session);
    }

    if (configuration.getTarget() != null) {
      addTargetFileContentToTargetPlatform(configuration, tpBuilder, session);
    }

    tpBuilder.addFilters(configuration.getFilters());

    return tpBuilder.buildTargetPlatform();
  }
コード例 #2
0
  /** Returns the configured environments in a format suitable for the p2 tools facade. */
  private List<TargetEnvironment> getEnvironmentsForFacade() {
    // TODO use shared class everywhere?

    List<org.eclipse.tycho.core.TargetEnvironment> original =
        TychoProjectUtils.getTargetPlatformConfiguration(project).getEnvironments();
    List<TargetEnvironment> converted = new ArrayList<TargetEnvironment>(original.size());
    for (org.eclipse.tycho.core.TargetEnvironment env : original) {
      converted.add(new TargetEnvironment(env.getWs(), env.getOs(), env.getArch()));
    }
    return converted;
  }
コード例 #3
0
  public DependencyArtifacts resolveDependencies(
      final MavenSession session,
      final MavenProject project,
      TargetPlatform resolutionContext,
      List<ReactorProject> reactorProjects,
      DependencyResolverConfiguration resolverConfiguration) {

    // TODO 364134 For compatibility reasons, target-platform-configuration includes settings for
    // the dependency resolution
    // --> split this information logically, e.g. through two distinct interfaces
    TargetPlatformConfiguration configuration =
        TychoProjectUtils.getTargetPlatformConfiguration(project);

    P2Resolver osgiResolverImpl = resolverFactory.createResolver();

    return doResolvePlatform(
        session,
        project,
        reactorProjects,
        resolverConfiguration,
        resolutionContext,
        osgiResolverImpl,
        configuration);
  }
コード例 #4
0
 List<TargetEnvironment> getEnvironments() {
   TargetPlatformConfiguration configuration =
       TychoProjectUtils.getTargetPlatformConfiguration(project);
   return configuration.getEnvironments();
 }