use of org.shipkit.internal.gradle.git.tasks.CloneGitRepositoryTask in project shipkit by mockito.
the class CloneGitRepositoryTaskFactory method createCloneTask.
/**
* Creates an instance of CloneGitRepositoryTask for given {@param #consumerRepository} in the root project
* or returns already existing one.
*/
public static CloneGitRepositoryTask createCloneTask(final Project project, final String gitHubUrl, final String consumerRepository) {
String taskName = "clone" + repositoryNameToCapitalizedCamelCase(consumerRepository);
Project taskProject = project.getRootProject();
CloneGitRepositoryTask alreadyExistingTask = (CloneGitRepositoryTask) taskProject.getTasks().findByName(taskName);
if (alreadyExistingTask != null) {
return alreadyExistingTask;
}
return TaskMaker.task(taskProject, taskName, CloneGitRepositoryTask.class, new Action<CloneGitRepositoryTask>() {
@Override
public void execute(final CloneGitRepositoryTask task) {
task.setDescription("Clones consumer repo " + consumerRepository + " into a temporary directory.");
task.setRepositoryUrl(gitHubUrl + "/" + consumerRepository);
task.setTargetDir(getConsumerRepoCloneDir(project, consumerRepository));
}
});
}
use of org.shipkit.internal.gradle.git.tasks.CloneGitRepositoryTask in project shipkit by mockito.
the class TestDownstreamTask method createTasks.
private void createTasks(String gitHubRepoUrl) {
String repoName = extractRepoNameFromGitHubUrl(gitHubRepoUrl);
String camelCaseRepoName = repositoryNameToCamelCase(repoName);
CloneGitRepositoryTask clone = CloneGitRepositoryTaskFactory.createCloneTask(getProject(), gitHubUrl, repoName);
createRunTestReleaseTask(camelCaseRepoName, clone);
}
use of org.shipkit.internal.gradle.git.tasks.CloneGitRepositoryTask in project shipkit by mockito.
the class TestDownstreamTask method createRunTestReleaseTask.
private void createRunTestReleaseTask(final String camelCaseRepoName, CloneGitRepositoryTask copy) {
final File buildOutputFile = new File(logsDirectory, camelCaseRepoName + "-build.log");
SilentExecTask run = getProject().getTasks().create("test" + capitalize(camelCaseRepoName), SilentExecTask.class);
run.dependsOn(copy);
run.finalizedBy(uploadGistsTask);
run.setWorkDir(copy.getTargetDir());
dependsOn(run);
// Using Gradle's composite builds ("--include-build") so that we're picking up current version of tools
run.setCommand(asList("./gradlew", "releaseNeeded", "performRelease", "releaseCleanUp", "-PdryRun", "-x", "gitPush", "-x", "bintrayUpload", "--include-build", getProject().getRootDir().getAbsolutePath(), "-s"));
// Build log in separate file instead of including it in the console of the parent build
// Otherwise the output will be really messy
run.setBuildOutputFile(buildOutputFile);
run.doFirst(new Action<Task>() {
@Override
public void execute(Task task) {
LOG.lifecycle(testDownstreamLogMessage(camelCaseRepoName, buildOutputFile, uploadGistsTask.isEnabled(), uploadGistsTask.getName()));
}
});
}
Aggregations