Search in sources :

Example 1 with UnknownBuildOutcome

use of org.gradle.api.plugins.buildcomparison.outcome.internal.unknown.UnknownBuildOutcome in project gradle by gradle.

the class GradleBuildOutcomeSetTransformer method addFileBuildOutcome.

private void addFileBuildOutcome(GradleFileBuildOutcome outcome, ProjectOutcomes rootProject, Set<BuildOutcome> translatedOutcomes) {
    if (zipArchiveTypes.contains(outcome.getTypeIdentifier())) {
        File originalFile = outcome.getFile();
        String relativePath = GFileUtils.relativePath(rootProject.getProjectDirectory(), originalFile);
        LocallyAvailableResource resource = null;
        if (originalFile.exists()) {
            String filestoreDestination = fileStorePrefix + "/" + outcome.getTaskPath() + "/" + originalFile.getName();
            resource = fileStore.move(filestoreDestination, originalFile);
        }
        BuildOutcome buildOutcome = new GeneratedArchiveBuildOutcome(outcome.getTaskPath(), outcome.getDescription(), resource, relativePath);
        translatedOutcomes.add(buildOutcome);
    } else {
        String outcomeName = outcome.getTaskPath();
        if (isEmpty(outcomeName)) {
            outcomeName = GFileUtils.relativePath(rootProject.getProjectDirectory(), outcome.getFile());
        }
        translatedOutcomes.add(new UnknownBuildOutcome(outcomeName, outcome.getDescription()));
    }
}
Also used : LocallyAvailableResource(org.gradle.internal.resource.local.LocallyAvailableResource) GeneratedArchiveBuildOutcome(org.gradle.api.plugins.buildcomparison.outcome.internal.archive.GeneratedArchiveBuildOutcome) UnknownBuildOutcome(org.gradle.api.plugins.buildcomparison.outcome.internal.unknown.UnknownBuildOutcome) File(java.io.File) GeneratedArchiveBuildOutcome(org.gradle.api.plugins.buildcomparison.outcome.internal.archive.GeneratedArchiveBuildOutcome) GradleBuildOutcome(org.gradle.tooling.model.internal.outcomes.GradleBuildOutcome) UnknownBuildOutcome(org.gradle.api.plugins.buildcomparison.outcome.internal.unknown.UnknownBuildOutcome) BuildOutcome(org.gradle.api.plugins.buildcomparison.outcome.internal.BuildOutcome) GradleFileBuildOutcome(org.gradle.tooling.model.internal.outcomes.GradleFileBuildOutcome)

Aggregations

File (java.io.File)1 BuildOutcome (org.gradle.api.plugins.buildcomparison.outcome.internal.BuildOutcome)1 GeneratedArchiveBuildOutcome (org.gradle.api.plugins.buildcomparison.outcome.internal.archive.GeneratedArchiveBuildOutcome)1 UnknownBuildOutcome (org.gradle.api.plugins.buildcomparison.outcome.internal.unknown.UnknownBuildOutcome)1 LocallyAvailableResource (org.gradle.internal.resource.local.LocallyAvailableResource)1 GradleBuildOutcome (org.gradle.tooling.model.internal.outcomes.GradleBuildOutcome)1 GradleFileBuildOutcome (org.gradle.tooling.model.internal.outcomes.GradleFileBuildOutcome)1