Package org.gradle.api.plugins.buildcomparison.outcome.internal.archive

Examples of org.gradle.api.plugins.buildcomparison.outcome.internal.archive.GeneratedArchiveBuildOutcome


    private BuildOutcome infer(BuildOutcome outcome) {
        if (outcome instanceof UnknownBuildOutcome) {
            return new UnknownBuildOutcome(outcome.getName(), outcome.getDescription());
        } else if (outcome instanceof GeneratedArchiveBuildOutcome) {
            GeneratedArchiveBuildOutcome archiveBuildOutcome = (GeneratedArchiveBuildOutcome) outcome;
            File file = new File(baseDir, archiveBuildOutcome.getRootRelativePath());
            String rootRelativePath = archiveBuildOutcome.getRootRelativePath();

            // TODO - we are relying on knowledge that the name of the outcome is the task path
            String taskPath = outcome.getName();

            LocallyAvailableResource resource = null;
            if (file.exists()) {
                String filestoreDestination = String.format("%s/%s/%s", fileStorePrefix, taskPath, file.getName());
                resource = fileStore.move(filestoreDestination, file);
            }

            return new GeneratedArchiveBuildOutcome(outcome.getName(), outcome.getDescription(), resource, rootRelativePath);
        } else {
            throw new IllegalStateException(String.format("Unhandled build outcome type: %s", outcome.getClass().getName()));
        }
    }
View Full Code Here


            if (originalFile.exists()) {
                String filestoreDestination = String.format("%s/%s/%s", fileStorePrefix, outcome.getTaskPath(), originalFile.getName());
                resource = fileStore.move(filestoreDestination, originalFile);
            }

            BuildOutcome buildOutcome = new GeneratedArchiveBuildOutcome(outcome.getTaskPath(), outcome.getDescription(), resource, relativePath);
            translatedOutcomes.add(buildOutcome);
        } else {
            translatedOutcomes.add(new UnknownBuildOutcome(outcome.getTaskPath(), outcome.getDescription()));
        }
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.plugins.buildcomparison.outcome.internal.archive.GeneratedArchiveBuildOutcome

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.