Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
chanseokoh committed Feb 12, 2021
1 parent c6c0ab0 commit 877d1d0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,18 @@ private void createSourceContextTask() {
}

// inject source-context into the META-INF directory of a jar or war
private void configureArchiveTask(String taskName) {
private void configureArchiveTask(String archiveTaskName) {
try {
TaskContainer tasks = project.getTasks();
TaskProvider<AbstractArchiveTask> archiveTask =
tasks.withType(AbstractArchiveTask.class).named(taskName);
archiveTask.configure(
task -> {
task.dependsOn(tasks.named("_createSourceContext"));
task.from(extension.getOutputDirectory(), copySpec -> copySpec.into("WEB-INF/classes"));
});
tasks
.withType(AbstractArchiveTask.class)
.named(archiveTaskName)
.configure(
task -> {
task.dependsOn(tasks.named("_createSourceContext"));
task.from(
extension.getOutputDirectory(), copySpec -> copySpec.into("WEB-INF/classes"));
});

} catch (UnknownTaskException ex) {
// Do nothing if the task doesn't exist.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,22 @@ private void createExplodeWarTask() {
tasks.register(
EXPLODE_WAR_TASK_NAME,
ExplodeWarTask.class,
explodeWarTask -> {
explodeWarTask.setExplodedAppDirectory(explodedWarDir);
explodeWarTask.dependsOn(WarPlugin.WAR_TASK_NAME);
explodeWarTask.setGroup(APP_ENGINE_STANDARD_TASK_GROUP);
explodeWarTask.setDescription("Explode a war into a directory");
task -> {
task.setExplodedAppDirectory(explodedWarDir);
task.dependsOn(WarPlugin.WAR_TASK_NAME);
task.setGroup(APP_ENGINE_STANDARD_TASK_GROUP);
task.setDescription("Explode a war into a directory");
});

project.afterEvaluate(
project -> {
explodeWar.configure(
task ->
task.setWarFile(
tasks
.withType(War.class)
.getByName((WarPlugin.WAR_TASK_NAME))
.getArchivePath()));
});
project ->
explodeWar.configure(
task ->
task.setWarFile(
tasks
.withType(War.class)
.getByName((WarPlugin.WAR_TASK_NAME))
.getArchivePath())));

tasks.named(BasePlugin.ASSEMBLE_TASK_NAME).configure(task -> task.dependsOn(explodeWar));
}
Expand All @@ -174,21 +173,20 @@ private void createStageTask() {
tasks.register(
STAGE_TASK_NAME,
StageStandardTask.class,
stageTask -> {
stageTask.setGroup(APP_ENGINE_STANDARD_TASK_GROUP);
stageTask.setDescription(
task -> {
task.setGroup(APP_ENGINE_STANDARD_TASK_GROUP);
task.setDescription(
"Stage an App Engine standard environment application for deployment");
stageTask.dependsOn(BasePlugin.ASSEMBLE_TASK_NAME);
task.dependsOn(BasePlugin.ASSEMBLE_TASK_NAME);
});

project.afterEvaluate(
project -> {
stage.configure(
task -> {
task.setAppCfg(cloudSdkOperations.getAppcfg());
task.setStageStandardExtension(stageExtension);
});
});
project ->
stage.configure(
task -> {
task.setAppCfg(cloudSdkOperations.getAppcfg());
task.setStageStandardExtension(stageExtension);
}));

// All deployment tasks depend on the stage task.
Arrays.asList(
Expand Down

0 comments on commit 877d1d0

Please sign in to comment.