Search in sources :

Example 1 with DirectoryRepositorySpec

use of org.gradle.vcs.internal.spec.DirectoryRepositorySpec in project gradle by gradle.

the class SimpleVersionControlSystem method populate.

@Override
public File populate(File versionDir, VersionRef ref, VersionControlSpec spec) {
    File sourceDir = ((DirectoryRepositorySpec) spec).getSourceDir();
    File workingDir = new File(versionDir, sourceDir.getName());
    File checkoutFlag = new File(workingDir, "checkedout");
    try {
        if (!checkoutFlag.exists()) {
            GFileUtils.copyDirectory(sourceDir, workingDir);
            checkoutFlag.createNewFile();
        }
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
    return workingDir;
}
Also used : UncheckedIOException(org.gradle.api.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(org.gradle.api.UncheckedIOException) File(java.io.File) DirectoryRepositorySpec(org.gradle.vcs.internal.spec.DirectoryRepositorySpec)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 UncheckedIOException (org.gradle.api.UncheckedIOException)1 DirectoryRepositorySpec (org.gradle.vcs.internal.spec.DirectoryRepositorySpec)1