*/
private static ArtifactSet finishPermutation(TreeLogger logger, Permutation perm,
PersistenceBackedObject<PermutationResult> resultFile, Set<PermutationResult> libraries,
StandardLinkerContext linkerContext, ArtifactSet generatedArtifacts)
throws UnableToCompleteException {
PermutationResult permResult = resultFile.newInstance(logger);
StandardCompilationResult compilation =
new StandardCompilationResult(permResult, libraries);
addSelectionPermutations(compilation, perm, linkerContext);
logScriptSize(logger, perm.getId(), compilation);
ArtifactSet permArtifacts = new ArtifactSet(generatedArtifacts);
permArtifacts.addAll(permResult.getArtifacts());
permArtifacts.add(compilation);
permArtifacts.freeze();
return linkerContext.invokeLinkForOnePermutation(logger, compilation,
permArtifacts);
}