use of org.shipkit.internal.gradle.release.tasks.UploadGistsTask in project shipkit by mockito.
the class UploadGistsPlugin method apply.
@Override
public void apply(final Project project) {
final ShipkitConfiguration conf = project.getPlugins().apply(ShipkitConfigurationPlugin.class).getConfiguration();
TaskMaker.task(project, UPLOAD_GISTS_TASK, UploadGistsTask.class, new Action<UploadGistsTask>() {
@Override
public void execute(UploadGistsTask uploadGistsTask) {
uploadGistsTask.setDescription("Uploads to Gist files provided by 'filesToUpload' task property.");
uploadGistsTask.setGitHubApiUrl(conf.getGitHub().getApiUrl());
uploadGistsTask.setGitHubWriteToken(conf.getLenient().getGitHub().getWriteAuthToken());
}
});
}
use of org.shipkit.internal.gradle.release.tasks.UploadGistsTask 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()));
}
});
}
use of org.shipkit.internal.gradle.release.tasks.UploadGistsTask in project shipkit by mockito.
the class TestDownstreamPlugin method apply.
public void apply(final Project project) {
IncubatingWarning.warn("downstream-testing plugin");
project.getPlugins().apply(UploadGistsPlugin.class);
final ShipkitConfiguration conf = project.getPlugins().apply(ShipkitConfigurationPlugin.class).getConfiguration();
final File logsDirectory = project.getBuildDir();
final UploadGistsTask uploadGistsTask = (UploadGistsTask) project.getTasks().findByName(UploadGistsPlugin.UPLOAD_GISTS_TASK);
uploadGistsTask.setFilesToUpload((ConfigurableFileTree) project.fileTree(logsDirectory).include("*.log"));
boolean shouldUploadLogs = ciContext.isCiBuild() && !StringUtil.isEmpty(conf.getLenient().getGitHub().getWriteAuthToken());
if (shouldUploadLogs) {
LOG.debug(" Skipping UploadGists task execution -> test-downstream plugin will not send logs to Gist (setting uploadGists.enabled=false)." + " It's only enabled when build is run in CI environment and GH_WRITE_TOKEN env property is set.");
}
uploadGistsTask.setEnabled(shouldUploadLogs);
TaskMaker.task(project, TEST_DOWNSTREAM_TASK, TestDownstreamTask.class, new Action<TestDownstreamTask>() {
@Override
public void execute(TestDownstreamTask task) {
task.setDescription("Runs all downstream tests.");
task.setLogsDirectory(logsDirectory);
task.setUploadGistsTask(uploadGistsTask);
task.setGitHubUrl(conf.getGitHub().getUrl());
}
});
}
Aggregations