Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B6DA10DDF for ; Fri, 28 Feb 2014 09:48:39 +0000 (UTC) Received: (qmail 34755 invoked by uid 500); 28 Feb 2014 09:48:13 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 34623 invoked by uid 500); 28 Feb 2014 09:48:09 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 34233 invoked by uid 99); 28 Feb 2014 09:48:01 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 09:48:01 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A2FB59304ED; Fri, 28 Feb 2014 09:47:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: josebarragan@apache.org To: commits@flex.apache.org Date: Fri, 28 Feb 2014 09:48:43 -0000 Message-Id: <89f6f241ffb441019282cb22fc4b83ef@git.apache.org> In-Reply-To: <9e6db14e39d744439e67f278e1e84202@git.apache.org> References: <9e6db14e39d744439e67f278e1e84202@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [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 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 Authored: Thu Feb 27 16:40:57 2014 +0100 Committer: Erik de Bruin 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); }