You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/09/11 08:43:28 UTC
[1/4] git commit: [flex-falcon] [refs/heads/develop] - add 'Generated
by...' to headers
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 <ah...@apache.org>
Authored: Thu Sep 10 22:30:53 2015 -0700
Committer: Alex Harui <ah...@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();
}
[3/4] git commit: [flex-falcon] [refs/heads/develop] - nevermind,
don't need this in this package yet
Posted by ah...@apache.org.
nevermind, don't need this in this package yet
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/7dc26304
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/7dc26304
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/7dc26304
Branch: refs/heads/develop
Commit: 7dc26304e4c953ea6fea199f0d43e02b42e28934
Parents: d026165
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 10 23:32:38 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 10 23:32:38 2015 -0700
----------------------------------------------------------------------
build.xml | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7dc26304/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 27cb7e8..61aa7c1 100644
--- a/build.xml
+++ b/build.xml
@@ -693,7 +693,6 @@
<chmod dir="${basedir}/temp/compiler/generated/dist/sdk/bin" excludes="**/*.bat" perm="+x" />
<chmod dir="${basedir}/temp/compiler/generated/dist/sdk/bin-legacy" excludes="**/*.bat" perm="+x" />
- <antcall target="inject-asf-header" />
<antcall target="binary-package-zip"/>
<antcall target="binary-package-tgz"/>
[2/4] git commit: [flex-falcon] [refs/heads/develop] - inject asf
headers into js files
Posted by ah...@apache.org.
inject asf headers into js files
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d026165d
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d026165d
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d026165d
Branch: refs/heads/develop
Commit: d026165dc5f4b76d8384ffe8f7c5adc3ec637608
Parents: 61b2f64
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 10 22:31:14 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 10 22:31:14 2015 -0700
----------------------------------------------------------------------
build.properties | 20 ++++++++++++++++++++
build.xml | 15 +++++++++++++++
2 files changed, 35 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d026165d/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
index 58f7002..704fd2c 100644
--- a/build.properties
+++ b/build.properties
@@ -18,3 +18,23 @@
################################################################################
release.version = 0.5.0
+
+generated.by.match=/\\*\\*. \\* Generated by Apache Flex Cross-Compiler
+generated.by.comment=/**\n\
+\ * Generated by Apache Flex Cross-Compiler
+
+asfheader=/**\n\
+\ * Licensed under the Apache License, Version 2.0 (the 'License');\n\
+\ * you may not use this file except in compliance with the License.\n\
+\ * You may obtain a copy of the License at\n\
+\ *\n\
+\ * http://www.apache.org/licenses/LICENSE-2.0\n\
+\ *\n\
+\ * Unless required by applicable law or agreed to in writing, software\n\
+\ * distributed under the License is distributed on an 'AS IS' BASIS,\n\
+\ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
+\ * See the License for the specific language governing permissions and\n\
+\ * limitations under the License.\n\
+\ */\n
+
+
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d026165d/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 1c50922..27cb7e8 100644
--- a/build.xml
+++ b/build.xml
@@ -693,6 +693,7 @@
<chmod dir="${basedir}/temp/compiler/generated/dist/sdk/bin" excludes="**/*.bat" perm="+x" />
<chmod dir="${basedir}/temp/compiler/generated/dist/sdk/bin-legacy" excludes="**/*.bat" perm="+x" />
+ <antcall target="inject-asf-header" />
<antcall target="binary-package-zip"/>
<antcall target="binary-package-tgz"/>
@@ -833,6 +834,7 @@
<exclude name="README_JX"/>
<exclude name="RELEASE_NOTES_JX"/>
<exclude name="NOTICE.jx"/>
+ <exclude name="NOTICE.base"/>
<exclude name="NOTICE.swfutils"/>
</fileset>
</rat:report>
@@ -946,4 +948,17 @@
</exec>
</target>
+ <!-- may not work on windows -->
+ <target name="inject-asf-header" >
+ <replaceregexp match="${generated.by.match}"
+ replace="${asfheader}${generated.by.comment}"
+ byline="false"
+ flags="s">
+ <fileset dir="${basedir}/temp">
+ <include name="**/*.js" />
+ </fileset>
+ </replaceregexp>
+ </target>
+
+
</project>
[4/4] git commit: [flex-falcon] [refs/heads/develop] - ignore
'Generated By' string in test output since it can have timestamps on the
class name
Posted by ah...@apache.org.
ignore 'Generated By' string in test output since it can have timestamps on the class name
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d0a934eb
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d0a934eb
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d0a934eb
Branch: refs/heads/develop
Commit: d0a934eb6aa86548ea8da0737f5b5a5ed819c2e8
Parents: 7dc2630
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 10 23:43:49 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 10 23:43:49 2015 -0700
----------------------------------------------------------------------
.../flex/compiler/internal/test/TestBase.java | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d0a934eb/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
index cd69242..ad0a401 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
@@ -147,11 +147,24 @@ public class TestBase implements ITestBase
protected void assertOut(String code)
{
- mCode = writer.toString();
+ mCode = removeGeneratedString(writer.toString());
//System.out.println(mCode);
assertThat(mCode, is(code));
}
+ protected String removeGeneratedString(String code)
+ {
+ int c = code.indexOf(" * Generated by Apache Flex Cross-Compiler");
+ if (c != -1)
+ {
+ int c2 = code.indexOf("\n", c);
+ String newString = code.substring(0, c);
+ newString += code.substring(c2 + 1);
+ return newString;
+ }
+ return code;
+ }
+
@Override
public String toString()
{
@@ -539,6 +552,7 @@ public class TestBase implements ITestBase
line = in.readLine();
}
code = code.substring(0, code.length() - 1);
+ code = removeGeneratedString(code);
in.close();
}