use of org.eclipse.tycho.surefire.provisioning.ProvisionedInstallationBuilder in project tycho by eclipse.
the class TestMojo method createProvisionedInstallation.
private EquinoxInstallation createProvisionedInstallation() throws MojoExecutionException {
try {
TestFrameworkProvider provider = providerHelper.selectProvider(getProjectType().getClasspath(project), getMergedProviderProperties(), providerHint);
createSurefireProperties(provider);
ProvisionedInstallationBuilder installationBuilder = provisionedInstallationBuilderFactory.createInstallationBuilder();
Set<Artifact> testHarnessArtifacts = providerHelper.filterTestFrameworkBundles(provider, pluginArtifacts);
for (Artifact testHarnessArtifact : testHarnessArtifacts) {
installationBuilder.addBundleJar(testHarnessArtifact.getFile());
}
RepositoryReferences sources = repositoryReferenceTool.getVisibleRepositories(project, session, RepositoryReferenceTool.REPOSITORIES_INCLUDE_CURRENT_MODULE);
installationBuilder.addMetadataRepositories(sources.getMetadataRepositories());
installationBuilder.addArtifactRepositories(sources.getArtifactRepositories());
installationBuilder.setProfileName(profileName);
installationBuilder.addIUsToBeInstalled(getIUsToInstall(testHarnessArtifacts));
File workingDir = new File(project.getBuild().getDirectory(), "p2temp");
workingDir.mkdirs();
installationBuilder.setWorkingDir(workingDir);
installationBuilder.setDestination(work);
return installationBuilder.install();
} catch (Exception ex) {
throw new MojoExecutionException(ex.getMessage(), ex);
}
}
Aggregations