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 2016/06/23 23:38:10 UTC
[1/2] git commit: [flex-falcon] [refs/heads/develop] - don't use
global to override variable name prefixes
Repository: flex-falcon
Updated Branches:
refs/heads/develop 3fd7d0e53 -> abc4acca2
don't use global to override variable name prefixes
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/abc4acca
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/abc4acca
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/abc4acca
Branch: refs/heads/develop
Commit: abc4acca2d9209cea2040108e947b2bc887d579f
Parents: f36ceb2
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jun 23 14:23:45 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jun 23 14:23:59 2016 -0700
----------------------------------------------------------------------
.../internal/projects/FlexJSProject.java | 8 +++++-
.../compiler/internal/projects/FlexProject.java | 18 +++++++++++++
.../tree/mxml/MXMLClassDefinitionNode.java | 27 +++++++-------------
3 files changed, 34 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/abc4acca/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java
index bc6ffe7..bbc3c0e 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java
@@ -58,7 +58,6 @@ public class FlexJSProject extends FlexProject
public FlexJSProject(Workspace workspace)
{
super(workspace);
- MXMLClassDefinitionNode.GENERATED_ID_BASE = MXMLFlexJSEmitterTokens.ID_PREFIX.getToken();
}
private HashMap<ICompilationUnit, HashMap<String, String>> interfaces = new HashMap<ICompilationUnit, HashMap<String, String>>();
@@ -325,4 +324,11 @@ public class FlexJSProject extends FlexProject
e.printStackTrace();
}
}
+
+ @Override
+ public String getGeneratedIDBase()
+ {
+ return MXMLFlexJSEmitterTokens.ID_PREFIX.getToken();
+ }
+
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/abc4acca/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java b/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
index ee7fd5c..fcabf87 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
@@ -2178,6 +2178,24 @@ public class FlexProject extends ASProject implements IFlexProject
return this.strictXML = strictXML;
}
+ /**
+ * The base for compiler-generated id's on instance tags that need an id but
+ * don't have one specified in MXML. Compiler-generated ids for instance
+ * tags have the form #0, #1, etc. The old compiler generated an id of the
+ * form "_MyComponent_Button3", but we prefer short names that are the same
+ * in all classes, because these create smaller SWFs. Also, the compiler can
+ * be simpler and faster if it doesn't have to track how many instances of
+ * each type it has seen in a class. Rather than using some weird Unicode
+ * character, we've chosen # as a normal ASCII character that will look OK
+ * in the debugger but not conflict with any developer-specified id, since
+ * it isn't allowed in an ActionScript identifier or MXML id. It also can't
+ * conflict with any dynamic properties, because MXML classes are sealed.
+ */
+ public String getGeneratedIDBase()
+ {
+ return "#";
+ }
+
@Override
public boolean isCompatibleOverrideReturnType(ITypeDefinition overrideDefinition, ITypeDefinition baseDefinition)
{
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/abc4acca/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassDefinitionNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassDefinitionNode.java b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassDefinitionNode.java
index 7c3c9a6..8f73fc5 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassDefinitionNode.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassDefinitionNode.java
@@ -81,20 +81,6 @@ import static org.apache.flex.compiler.mxml.IMXMLLanguageConstants.*;
public class MXMLClassDefinitionNode extends MXMLClassReferenceNodeBase
implements IMXMLClassDefinitionNode, IScopedNode
{
- /**
- * The base for compiler-generated id's on instance tags that need an id but
- * don't have one specified in MXML. Compiler-generated ids for instance
- * tags have the form #0, #1, etc. The old compiler generated an id of the
- * form "_MyComponent_Button3", but we prefer short names that are the same
- * in all classes, because these create smaller SWFs. Also, the compiler can
- * be simpler and faster if it doesn't have to track how many instances of
- * each type it has seen in a class. Rather than using some weird Unicode
- * character, we've chosen # as a normal ASCII character that will look OK
- * in the debugger but not conflict with any developer-specified id, since
- * it isn't allowed in an ActionScript identifier or MXML id. It also can't
- * conflict with any dynamic properties, because MXML classes are sealed.
- */
- public static String GENERATED_ID_BASE = "#";
/**
* Constructor
@@ -124,6 +110,11 @@ public class MXMLClassDefinitionNode extends MXMLClassReferenceNodeBase
private IASScope scope;
/**
+ * The project for this class.
+ */
+ private FlexProject project;
+
+ /**
* A map mapping an id to the instance node with that id.
*/
private Map<String, IMXMLInstanceNode> idMap;
@@ -226,7 +217,7 @@ public class MXMLClassDefinitionNode extends MXMLClassReferenceNodeBase
// Add the dependency between the class this node defines and its superclass,
// as expressed by this tag that created this node.
- FlexProject project = builder.getProject();
+ project = builder.getProject();
IClassDefinition classReference = getClassReference(project);
String qname = classReference.getQualifiedName();
builder.addDependency(qname, DependencyType.INHERITANCE);
@@ -267,6 +258,7 @@ public class MXMLClassDefinitionNode extends MXMLClassReferenceNodeBase
MXMLNodeInfo info)
{
MXMLFileScope fileScope = builder.getFileScope();
+ project = builder.getProject();
MXMLNodeBase childNode = null;
@@ -762,7 +754,7 @@ public class MXMLClassDefinitionNode extends MXMLClassReferenceNodeBase
{
if (generatedIDMap.containsKey(instanceNode))
return;
- String id = GENERATED_ID_BASE + generatedIDCounter++;
+ String id = project.getGeneratedIDBase() + generatedIDCounter++;
generatedIDMap.put(instanceNode, id);
}
}
@@ -798,7 +790,7 @@ public class MXMLClassDefinitionNode extends MXMLClassReferenceNodeBase
{
if (stateDependentNodeMap == null)
stateDependentNodeMap = ArrayListMultimap.create();
-
+
stateDependentNodeMap.put(state, node);
}
@@ -824,7 +816,6 @@ public class MXMLClassDefinitionNode extends MXMLClassReferenceNodeBase
// TODO Should it be the first one in the 'states' property?
initialState = node.getStateName();
}
-
StateDefinition oldState = stateMap.put(node.getStateName(),
(StateDefinition)node.getDefinition());
[2/2] git commit: [flex-falcon] [refs/heads/develop] - add ability to
uncompress a SWF so LZMA compressed SWFs can be dumped with the old Flex SDK
SWFDump which I am more used to reading
Posted by ah...@apache.org.
add ability to uncompress a SWF so LZMA compressed SWFs can be dumped with the old Flex SDK SWFDump which I am more used to reading
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/f36ceb25
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/f36ceb25
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/f36ceb25
Branch: refs/heads/develop
Commit: f36ceb25fafcf183e0d3ffc1a9a0df8b6beb1505
Parents: 3fd7d0e
Author: Alex Harui <ah...@apache.org>
Authored: Wed Jun 22 08:48:20 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jun 23 14:23:59 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/flex/swf/io/SWFDump.java | 36 +++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f36ceb25/compiler/src/main/java/org/apache/flex/swf/io/SWFDump.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/swf/io/SWFDump.java b/compiler/src/main/java/org/apache/flex/swf/io/SWFDump.java
index 2f500ae..6d6c22b 100644
--- a/compiler/src/main/java/org/apache/flex/swf/io/SWFDump.java
+++ b/compiler/src/main/java/org/apache/flex/swf/io/SWFDump.java
@@ -2333,6 +2333,7 @@ public final class SWFDump
static boolean defuncOption = true;
static boolean saveOption = false;
static boolean tabbedGlyphsOption = true;
+ static boolean uncompressOption = false;
/**
* SWFDump will dump a SWF file as XML.
@@ -2371,6 +2372,12 @@ public final class SWFDump
saveOption = true;
outfile = args[index++];
}
+ else if (args[index].equals("-uncompress"))
+ {
+ ++index;
+ uncompressOption = true;
+ outfile = args[index++];
+ }
else if (args[index].equals("-decompile"))
{
decompileOption = true;
@@ -2512,8 +2519,35 @@ public final class SWFDump
in.close();
}
}
+ if (uncompressOption)
+ {
+ final SWFReader swfReader = new SWFReader();
+ final String path = url.getPath();
+ try
+ {
+ SWF swf = (SWF)swfReader.readFrom(
+ new BufferedInputStream(url.openStream()),
+ path);
+
+ ProblemQuery problemQuery = new ProblemQuery();
+ problemQuery.addAll(swfReader.getProblems());
+ if (!problemQuery.hasErrors())
+ {
+ OutputStream fileOut = new BufferedOutputStream(new FileOutputStream(outfile));
+ SWFWriter swfWriter = new SWFWriter(swf, Header.Compression.NONE);
+ swfWriter.writeTo(fileOut);
+ swfWriter.close();
+ }
+ }
+ finally
+ {
+ IOUtils.closeQuietly(swfReader);
+ }
+
+ }
- dumpSwf(out, url, outfile);
+ if (!uncompressOption)
+ dumpSwf(out, url, outfile);
out.flush();
}