You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jo...@apache.org on 2014/02/28 10:48:43 UTC

[46/50] git commit: [flex-falcon] [refs/heads/maven] - Copy assets for SDK classes, but only for classes in the org.apache.flex namespace.

Copy assets for SDK classes, but only for classes in the org.apache.flex namespace.

Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d2d5f3fe
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d2d5f3fe
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d2d5f3fe

Branch: refs/heads/maven
Commit: d2d5f3fe99bf88a5206f3894ea25e6f9dcc01068
Parents: c252ce9
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Thu Feb 27 16:40:57 2014 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Thu Feb 27 16:40:57 2014 +0100

----------------------------------------------------------------------
 .../compiler/internal/graph/GoogDepsWriter.java | 38 ++++++++++++++++++++
 1 file changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d2d5f3fe/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java b/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
index 566fb0e..8a3209d 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
@@ -239,6 +239,44 @@ public class GoogDepsWriter {
     			// copy source to output
     			try {
     				FileUtils.copyFile(f, destFile);
+    				
+    				// (erikdebruin) copy class assets files
+    				if (className.indexOf("org.apache.flex") > -1)
+    				{
+    				    File assetsDir = new File(f.getParentFile(), "assets");
+    				    if (assetsDir.exists())
+    				    {
+    				        String nameOfClass = className.substring(className.lastIndexOf('.') + 1);
+    				        
+    				        File[] assetsList = assetsDir.listFiles();
+    				        for (int i = 0; i < assetsList.length; i++) 
+    				        {
+    				            File assetFile = assetsList[i];
+    				            String assetFileName = assetFile.getName();
+    				            
+    				            if (assetFile.isFile() && assetFileName.indexOf(nameOfClass) == 0) 
+    				            {
+    				                String pathOfClass = "";
+    				                pathOfClass = className.substring(0, className.lastIndexOf('.'));
+    				                pathOfClass = pathOfClass.replace(".", File.separator);
+    				                
+                                    destFile = new File(outputFolderPath + 
+                                            File.separator + pathOfClass + 
+                                            File.separator + "assets" + 
+                                            File.separator + assetFileName);
+                                    FileUtils.copyFile(assetFile, destFile);
+                                    
+                                    destFile = new File(outputFolderPath.replace("js-debug", "js-release") + 
+                                            File.separator + pathOfClass + 
+                                            File.separator + "assets" + 
+                                            File.separator + assetFileName);
+                                    FileUtils.copyFile(assetFile, destFile);
+                                    
+    	                            System.out.println("Copied assets of the '" + nameOfClass + "' class");
+    				            }
+    				        }
+    				    }
+    				}
     			} catch (IOException e) {
     				System.out.println("Error copying file for class: " + className);
     			}