@Override public void apply(Project project) { TaskMaker.task(project, IDENTIFY_GIT_BRANCH, IdentifyGitBranchTask.class, new Action<IdentifyGitBranchTask>() { public void execute(final IdentifyGitBranchTask t) { t.setDescription("Identifies current git branch."); } }); }
@Override public void apply(Project project) { TaskMaker.task(project, IDENTIFY_GIT_BRANCH, IdentifyGitBranchTask.class, new Action<IdentifyGitBranchTask>() { public void execute(final IdentifyGitBranchTask t) { t.setDescription("Identifies current git branch."); } }); }
@Override public void apply(Project project) { TaskMaker.task(project, IDENTIFY_GIT_BRANCH, IdentifyGitBranchTask.class, new Action<IdentifyGitBranchTask>() { public void execute(final IdentifyGitBranchTask t) { t.setDescription("Identifies current git branch."); } }); }
private Task createProduceUpgradeTask(final Project project, final String consumerRepository) { return TaskMaker.task(project, "upgrade" + repositoryNameToCapitalizedCamelCase(consumerRepository), ShipkitExecTask.class, new Action<ShipkitExecTask>() { @Override public void execute(final ShipkitExecTask task) { task.setDescription("Performs dependency upgrade in " + consumerRepository); task.execCommand(ExecCommandFactory.execCommand("Upgrading dependency", CloneGitRepositoryTaskFactory.getConsumerRepoCloneDir(project, consumerRepository), GradleWrapper.getWrapperCommand(), "performVersionUpgrade", getDependencyProperty(project))); } }); }
private Task createProduceUpgradeTask(final Project project, final String consumerRepository) { return TaskMaker.task(project, "upgrade" + repositoryNameToCapitalizedCamelCase(consumerRepository), ShipkitExecTask.class, new Action<ShipkitExecTask>() { @Override public void execute(final ShipkitExecTask task) { task.setDescription("Performs dependency upgrade in " + consumerRepository); task.execCommand(ExecCommandFactory.execCommand("Upgrading dependency", CloneGitRepositoryTaskFactory.getConsumerRepoCloneDir(project, consumerRepository), GradleWrapper.getWrapperCommand(), "performVersionUpgrade", getDependencyProperty(project))); } }); }
@Override public void apply(Project project) { ProjectUtil.requireRootProject(project, this.getClass(), "This is needed so that we don't invoke git commands multiple times, per each submodule."); identifyTask = TaskMaker.task(project, IDENTIFY_GIT_ORIGIN_TASK, IdentifyGitOriginRepoTask.class, new Action<IdentifyGitOriginRepoTask>() { public void execute(IdentifyGitOriginRepoTask t) { t.setDescription("Identifies current git origin repo."); } }); //Due to gnarly dependencies between plugins and tasks, we really need to apply this plugin after we declared the task //Trust me, it's all good :-) project.getPlugins().apply(ShipkitConfigurationPlugin.class); }
@Override public void apply(Project project) { ProjectUtil.requireRootProject(project, this.getClass(), "This is needed so that we don't invoke git commands multiple times, per each submodule."); identifyTask = TaskMaker.task(project, IDENTIFY_GIT_ORIGIN_TASK, IdentifyGitOriginRepoTask.class, new Action<IdentifyGitOriginRepoTask>() { public void execute(IdentifyGitOriginRepoTask t) { t.setDescription("Identifies current git origin repo."); } }); //Due to gnarly dependencies between plugins and tasks, we really need to apply this plugin after we declared the task //Trust me, it's all good :-) project.getPlugins().apply(ShipkitConfigurationPlugin.class); }
@Override public void apply(final Project project) { project.getPlugins().apply("com.gradle.plugin-publish"); final Task task = TaskMaker.task(project, DISCOVER_PLUGINS, PluginDiscoveryTask.class, new Action<PluginDiscoveryTask>() { @Override public void execute(final PluginDiscoveryTask task) { task.setDescription("discover gradle plugins"); } }); final Task publishPlugins = project.getTasks().getByName(PUBLISH_PLUGINS_TASK); publishPlugins.dependsOn(task); }
@Override public void apply(final Project project) { project.getPlugins().apply("com.gradle.plugin-publish"); final Task task = TaskMaker.task(project, DISCOVER_PLUGINS, PluginDiscoveryTask.class, new Action<PluginDiscoveryTask>() { @Override public void execute(final PluginDiscoveryTask task) { task.setDescription("discover gradle plugins"); } }); final Task publishPlugins = project.getTasks().getByName(PUBLISH_PLUGINS_TASK); publishPlugins.dependsOn(task); }
@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()); } }); } }
@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()); } }); } }
public void apply(final Project project) { project.getPlugins().apply(GitPlugin.class); project.getPlugins().apply(VersioningPlugin.class); TaskMaker.task(project, PERFORM_VERSION_BUMP, new Action<Task>() { public void execute(Task t) { t.setDescription("Increments version number, commits and pushes changes to Git repository"); t.dependsOn(VersioningPlugin.BUMP_VERSION_FILE_TASK); t.dependsOn(GitPlugin.PERFORM_GIT_PUSH_TASK); } }); } }
@Override public void apply(Project project) { project.getPlugins().apply(GitPlugin.class); project.getPlugins().apply(ReleaseNotesPlugin.class); TaskMaker.task(project, PERFORM_RELEASE_NOTES_UPDATE, new Action<Task>() { public void execute(Task t) { t.setDescription("Updates release notes, commits and pushes changes to Git repository"); t.dependsOn(ReleaseNotesPlugin.UPDATE_NOTES_TASK); t.dependsOn(GitPlugin.PERFORM_GIT_PUSH_TASK); } }); } }
@Override public void apply(Project project) { Task snapshotTask = TaskMaker.task(project, SNAPSHOT_TASK, t -> { t.setDescription("Depends on specific tasks that create local snapshot files."); }); this.isSnapshot = configureTask(snapshotTask, project.getGradle().getStartParameter().getTaskNames()); }
@Override public void apply(final Project project) { project.getPlugins().withId("java", plugin -> { TaskMaker.task(project, VALIDATE_PLUGINS, PluginValidatorTask.class, task -> { task.setDescription("Validates Gradle Plugins and their properties files"); task.setSourceSet(JavaPluginUtil.getMainSourceSet(project)); project.getTasks().getByName(JavaBasePlugin.CHECK_TASK_NAME).dependsOn(task); }); }); } }
@Override public void apply(Project project) { Task snapshotTask = TaskMaker.task(project, SNAPSHOT_TASK, t -> { t.setDescription("Depends on specific tasks that create local snapshot files."); }); this.isSnapshot = configureTask(snapshotTask, project.getGradle().getStartParameter().getTaskNames()); }
@Override public void apply(final Project project) { project.getPlugins().withId("java", plugin -> { TaskMaker.task(project, VALIDATE_PLUGINS, PluginValidatorTask.class, task -> { task.setDescription("Validates Gradle Plugins and their properties files"); task.setSourceSet(JavaPluginUtil.getMainSourceSet(project)); project.getTasks().getByName(JavaBasePlugin.CHECK_TASK_NAME).dependsOn(task); }); }); } }
public void apply(final Project project) { LocalSnapshotPlugin snapshotPlugin = project.getPlugins().apply(LocalSnapshotPlugin.class); final File versionFile = project.file(VERSION_FILE_NAME); final VersionInfo versionInfo = new VersionInfoFactory().createVersionInfo(versionFile, project.getVersion(), snapshotPlugin.isSnapshot()); project.getExtensions().add(VersionInfo.class.getName(), versionInfo); final String version = versionInfo.getVersion(); project.allprojects(project1 -> project1.setVersion(version)); TaskMaker.task(project, BUMP_VERSION_FILE_TASK, BumpVersionFileTask.class, t -> { t.setDescription("Increments version number in " + versionFile.getName()); t.setVersionFile(versionFile); String versionChangeMessage = formatVersionInformationInCommitMessage(version, versionInfo.getPreviousVersion()); GitPlugin.registerChangesForCommitIfApplied(singletonList(versionFile), versionChangeMessage, t); }); }
public void apply(final Project project) { LocalSnapshotPlugin snapshotPlugin = project.getPlugins().apply(LocalSnapshotPlugin.class); final File versionFile = project.file(VERSION_FILE_NAME); final VersionInfo versionInfo = new VersionInfoFactory().createVersionInfo(versionFile, project.getVersion(), snapshotPlugin.isSnapshot()); project.getExtensions().add(VersionInfo.class.getName(), versionInfo); final String version = versionInfo.getVersion(); project.allprojects(project1 -> project1.setVersion(version)); TaskMaker.task(project, BUMP_VERSION_FILE_TASK, BumpVersionFileTask.class, t -> { t.setDescription("Increments version number in " + versionFile.getName()); t.setVersionFile(versionFile); String versionChangeMessage = formatVersionInformationInCommitMessage(version, versionInfo.getPreviousVersion()); GitPlugin.registerChangesForCommitIfApplied(singletonList(versionFile), versionChangeMessage, t); }); }
public void apply(final Project project) { final ShipkitConfiguration conf = project.getPlugins().apply(ShipkitConfigurationPlugin.class).getConfiguration(); final FetchGitHubContributorsTask task = TaskMaker.task(project, FETCH_CONTRIBUTORS, FetchGitHubContributorsTask.class, new Action<FetchGitHubContributorsTask>() { @Override public void execute(final FetchGitHubContributorsTask task) { task.setDescription("Fetch info about all project contributors and store it in file"); task.setOutputFile(contributorsFile(project)); task.setEnabled(conf.getTeam().getContributors().isEmpty()); task.setIgnoredContributors(conf.getTeam().getIgnoredContributors()); } }); task.setDescription("Fetch info about all project contributors from GitHub and store it in file"); task.setApiUrl(conf.getGitHub().getApiUrl()); task.setReadOnlyAuthToken(conf.getGitHub().getReadOnlyAuthToken()); task.setRepository(conf.getGitHub().getRepository()); } }