[Title] added last builder
authorTaeyoung Son <taeyoung2.son@samsung.com>
Thu, 9 May 2013 08:08:34 +0000 (17:08 +0900)
committerTaeyoung Son <taeyoung2.son@samsung.com>
Thu, 9 May 2013 08:08:34 +0000 (17:08 +0900)
[Desc.]
[Issue]

Change-Id: Ie66acb9b02c848d408b29f78c749a5cfbd2a8a39

org.tizen.cli/src/org/tizen/cli/exec/web/build/Main.java

index 64a2fee..cb8aeb4 100755 (executable)
@@ -41,7 +41,6 @@ import org.tizen.cli.exec.Help;
 import org.tizen.common.builder.BuildProcess;
 import org.tizen.common.builder.Resource;
 import org.tizen.common.builder.ResourceLayer;
-import org.tizen.common.builder.core.FSBuilder;
 import org.tizen.common.core.command.Executor;
 import org.tizen.common.core.command.zip.ZipCommand;
 import org.tizen.common.file.FileHandler;
@@ -50,6 +49,8 @@ import org.tizen.common.file.VirtualFileHandler;
 import org.tizen.common.util.FileUtil;
 import org.tizen.common.util.FilenameUtil;
 import org.tizen.web.builder.JavaScriptMinifier;
+import org.tizen.web.builder.WorkingCopyBuilder;
+import org.tizen.web.common.WebConstant;
 
 /**
  * Command Line Interface for optimization of web resources
@@ -72,9 +73,6 @@ extends AbstractLauncher
     protected static final String RESOURCE_LAYER_OPTIMIZE = "optimize";
     protected static final String RESOURCE_LAYER_END = "end";
 
-    private static final String RESOURCE_LAYER_EXTRACT_TO_FS = null;
-
-
     /**
      * Entry point for cli main
      * 
@@ -151,7 +149,7 @@ extends AbstractLauncher
         ResourceLayer startLayer = new ResourceLayer("start", new VirtualFileHandler());
         BuildProcess buildProcess = new BuildProcess();
 
-        generateBuilders(buildProcess, startLayer);
+        generateBuilders(cmdLine, buildProcess, startLayer);
 
         Resource[] resources = getResources(baseDir, startLayer);
 
@@ -161,7 +159,7 @@ extends AbstractLauncher
         }
     }
 
-    private void generateBuilders(BuildProcess buildProcess, ResourceLayer parentLayer) {
+    private void generateBuilders(CommandLine cmdLine, BuildProcess buildProcess, ResourceLayer parentLayer) {
         addOptimizingBuilders(buildProcess, parentLayer);
         addLastbuilder(buildProcess
                 , buildProcess.getLastBuilder().getResourceLayer());
@@ -178,12 +176,10 @@ extends AbstractLauncher
         return result;
     }
 
-    private void addLastbuilder(BuildProcess buildProcess, ResourceLayer resourceLayer) {
+    private void addLastbuilder(BuildProcess buildProcess, ResourceLayer parentLayer) {
         // add file output builder
-        ResourceLayer toFSLayer = new ResourceLayer(RESOURCE_LAYER_EXTRACT_TO_FS
-                                                        , resourceLayer
-                                                        , getFileHandler());
-        FSBuilder toFSBuilder = new FSBuilder(toFSLayer);
+        WorkingCopyBuilder toFSBuilder = new WorkingCopyBuilder(WebConstant.TEMP_BUILD_DIRECTORY
+                                                                            , parentLayer);
         buildProcess.addBuilder(toFSBuilder);
     }