/*
 * Copyright (c) 2016 Google Inc. All Right Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.google.cloud.tools.gradle.appengine.standard;

import java.io.File;
import org.gradle.api.Action;
import org.gradle.api.DefaultTask;
import org.gradle.api.file.CopySpec;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.TaskAction;

/** Expand a war. */
public class ExplodeWarTask extends DefaultTask {

  private File warFile;
  private File explodedAppDirectory;

  @InputFile
  public File getWarFile() {
    return warFile;
  }

  @OutputDirectory
  public File getExplodedAppDirectory() {
    return explodedAppDirectory;
  }

  public void setWarFile(File warFile) {
    this.warFile = warFile;
  }

  public void setExplodedAppDirectory(File explodedAppDirectory) {
    this.explodedAppDirectory = explodedAppDirectory;
  }

  /** Task entrypoint : expand the war. */
  @TaskAction
  public void explodeApp() {
    getProject().delete(explodedAppDirectory);
    getProject()
        .copy(
            new Action<CopySpec>() {
              @Override
              public void execute(CopySpec copySpec) {
                copySpec.from(getProject().zipTree(warFile));
                copySpec.into(explodedAppDirectory);
              }
            });
  }
}

@@ -726,359 +726,84 @@
 api.
-Action;%0Aimport org.gradle.api.DefaultTask;%0Aimport org.gradle.api.file.CopySpec;%0Aimport org.gradle.api.tasks.InputFile;%0Aimport org.gradle.api.tasks.OutputDirectory;%0Aimport org.gradle.api.tasks.TaskAction;%0A%0A/** Expand a war. */%0Apublic class ExplodeWarTask extends DefaultTask %7B%0A%0A  private File warFile;%0A  private File explodedAppDirectory;%0A%0A  @InputFile
+tasks.Sync;%0A%0A/** Expand a war. */%0Apublic class ExplodeWarTask extends Sync %7B
 %0A  p
@@ -808,22 +808,22 @@
  public 
-File g
+void s
 etWarFil
@@ -828,203 +828,63 @@
 ile(
-) %7B%0A    return warFile;%0A  %7D%0A%0A  @OutputDirectory%0A  public File getExplodedAppDirectory() %7B%0A    return explodedAppDirectory;%0A  %7D%0A%0A  public void setWarFile(File warFile) %7B%0A    this.warFile = 
+File warFile) %7B%0A    from(getProject().zipTree(
 warFile
+))
 ;%0A  
@@ -961,488 +961,33 @@
     
-this.explodedAppDirectory = explodedAppDirectory;%0A  %7D%0A%0A  /** Task entrypoint : expand the war. */%0A  @TaskAction%0A  public void explodeApp() %7B%0A    getProject().delete(explodedAppDirectory);%0A    getProject()%0A        .copy(%0A            new Action%3CCopySpec%3E() %7B%0A              @Override%0A              public void execute(CopySpec copySpec) %7B%0A                copySpec.from(getProject().zipTree(warFile));%0A                copySpec.into(explodedAppDirectory);%0A              %7D%0A            %7D
+into(explodedAppDirectory
 );%0A 

Use sync instead of copy on the explodeWar task (#162)