flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/4] git commit: [flex-falcon] [refs/heads/develop] - add 'Generated by...' to headers
Date Fri, 11 Sep 2015 06:43:28 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 5961345fa -> d0a934eb6


add 'Generated by...' to headers


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

Branch: refs/heads/develop
Commit: 61b2f6450c43be7ef0ccc4f2131fc89d352f7038
Parents: 5961345
Author: Alex Harui <aharui@apache.org>
Authored: Thu Sep 10 22:30:53 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Sep 10 22:30:53 2015 -0700

----------------------------------------------------------------------
 .../internal/codegen/js/jx/PackageHeaderEmitter.java  | 14 ++++++++++++++
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java        | 13 ++++++++++++-
 .../driver/js/flexjs/JSCSSCompilationSession.java     |  1 +
 3 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/61b2f645/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
index f5fe623..8fd60fb 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
@@ -19,7 +19,9 @@
 
 package org.apache.flex.compiler.internal.codegen.js.jx;
 
+import java.io.File;
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
 import org.apache.flex.compiler.codegen.ISubEmitter;
@@ -59,8 +61,20 @@ public class PackageHeaderEmitter extends JSSubEmitter implements
                 .getAllLocalDefinitions());
         if (type == null)
             return;
+        
+        FlexJSProject project = (FlexJSProject) getProject();
+        List<File> sourcePaths = project.getSourcePath();
+        String sourceName = definition.getSourcePath();
+        for (File sourcePath : sourcePaths)
+        {
+            if (sourceName.startsWith(sourcePath.getAbsolutePath())) 
+            {
+            	sourceName = sourceName.substring(sourcePath.getAbsolutePath().length() + 1);
       	
+            }
+        }
 
         writeNewline("/**");
+        writeNewline(" * Generated by Apache Flex Cross-Compiler from " + sourceName);
         writeNewline(" * " + type.getQualifiedName());
         writeNewline(" *");
         writeNewline(" * @fileoverview");

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/61b2f645/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
index a7bf8b8..6a7b634 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
@@ -20,6 +20,7 @@
 package org.apache.flex.compiler.internal.codegen.mxml.flexjs;
 
 
+import java.io.File;
 import java.io.FilterWriter;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -1764,7 +1765,18 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         String cname = node.getFileNode().getName();
         String bcname = node.getBaseClassName();
 
+        FlexJSProject project = (FlexJSProject) getMXMLWalker().getProject();
+        List<File> sourcePaths = project.getSourcePath();
+        String sourceName = node.getSourcePath();
+        for (File sourcePath : sourcePaths)
+        {
+            if (sourceName.startsWith(sourcePath.getAbsolutePath())) 
+            {
+            	sourceName = sourceName.substring(sourcePath.getAbsolutePath().length() + 1);
       	
+            }
+        }
         writeNewline("/**");
+        writeNewline(" * Generated by Apache Flex Cross-Compiler from " + sourceName);
         writeNewline(" * " + cname);
         writeNewline(" *");
         writeNewline(" * @fileoverview");
@@ -1794,7 +1806,6 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
                 writtenInstances.add(name);
             }
         }
-        FlexJSProject project = (FlexJSProject) getMXMLWalker().getProject();
         ASProjectScope projectScope = (ASProjectScope) project.getScope();
         IDefinition cdef = node.getDefinition();
         ICompilationUnit cu = projectScope

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/61b2f645/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
b/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
index 6add07b..c55351d 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
@@ -69,6 +69,7 @@ public class JSCSSCompilationSession extends CSSCompilationSession
     {
         final ICSSDocument css = synthesisNormalizedCSS();
         StringBuilder sb = new StringBuilder();
+        sb.append("/* Generated by Apache Flex Cross-Compiler */\n");
         walkCSS(css, sb);
         return sb.toString();
     }


Mime
View raw message