package com.divae.ageto.hybris.install.task;

import java.io.File;
import java.util.Arrays;
import java.util.Collections;

/**
 * @author khauschild
 * @date 24.03.2016
 */
public class RestructureExtensionTask extends AbstractWorkDirectoryTask {

    private final String extensionDirectory;
    private final String extensionName;
    private final String binary;

    public RestructureExtensionTask(final String extensionDirectory, final String extensionName, final String binary) {
        this.extensionDirectory = extensionDirectory;
        this.extensionName = extensionName;
        this.binary = binary;
    }

    @Override
    protected void execute(final TaskContext taskContext, final File workDirectory) {
        final String sourcesDirectory = String.format("%s/src/main/java", extensionName);
        final String testSourcesDirectory = String.format("%s/src/test/java", extensionName);
        final String resourcesDirectory = String.format("%s/src/main/resources", extensionName);
        new TaskChainTask(Arrays.<InstallTask>asList( //
                new CreatePomTask(String.format("com/divae/ageto/hybris/install/%s.pom.xml", extensionName), extensionName,
                        Collections.<String, String>emptyMap()), //
                new CreateDirectoryTask(sourcesDirectory), //
                new CreateDirectoryTask(resourcesDirectory), //
                new DecompileTask(String.format("bin/platform/%s/bin/%s", extensionDirectory, binary), sourcesDirectory), //
                new CopyFilesTask(String.format("bin/platform/%s", extensionDirectory), resourcesDirectory), //
                new CopyFilesTask(String.format("bin/platform/%s/resources", extensionDirectory), resourcesDirectory), //
                new MoveTestSourcesTask(sourcesDirectory, testSourcesDirectory) //
                )).execute(taskContext);
    }

}

@@ -135,10 +135,15 @@
 hor 
-kh
+Klaus H
 ausc
@@ -151,28 +151,8 @@
 ild%0A
- * @date 24.03.2016%0A
  */%0A

remove unknown javadoc-tag