Modified:
trunk/maven-flex2-plugin/src/main/java/net/israfil/mojo/flex2/AbstractFlexCompilerMojo.java
Log:
remove comments, remove logic for included libs which is only partially
there and does nothing (presently), remove the (now obsolete) manual
assembly of .swcs from /frameworks, and add back in linking in .swcs
from dependencies.
Modified: trunk/maven-flex2-plugin/src/main/java/net/israfil/mojo/flex2/AbstractFlexCompilerMojo.java
==============================================================================
---
trunk/maven-flex2-plugin/src/main/java/net/israfil/mojo/flex2/AbstractFlexCompilerMojo.java (original)
+++
trunk/maven-flex2-plugin/src/main/java/net/israfil/mojo/flex2/AbstractFlexCompilerMojo.java
Fri Jan 11 10:54:55 2008
@@ -35,6 +35,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -54,7 +55,10 @@
*/
public abstract class AbstractFlexCompilerMojo extends
AbstractFlexMojo {
-
+ private static final String SWF_SUFFIX = ".swf";
+ private static final String[] FLEX_FRAMEWORKS =
{ "automation","framework","playerglobal","flex","utilities","rpc" };
+ private static final String[] FLEX_OPTIONAL_FRAMEWORKS =
{ "charts", "automation_charts", "fds" };
+
/**
* Resolve extra libraries (such as charts or fds) from
* ${flex.home}/frameworks/libs. Default is false, in which case
@@ -195,34 +199,9 @@
}
}
+
+ // Add in dependency .swfs.
Set linkedLibraryPaths = new HashSet();
- File fwLibDir = new File(flexHome,"frameworks/libs");
- try {
- linkedLibraryPaths.add(new File(fwLibDir,"framework.swc").getCanonicalFile().getAbsolutePath());
- linkedLibraryPaths.add(new File(fwLibDir,"playerglobal.swc").getCanonicalFile().getAbsolutePath());
- linkedLibraryPaths.add(new File(fwLibDir,"flex.swc").getCanonicalFile().getAbsolutePath());
- linkedLibraryPaths.add(new File(fwLibDir,"utilities.swc").getCanonicalFile().getAbsolutePath());
- linkedLibraryPaths.add(new File(fwLibDir,"rpc.swc").getCanonicalFile().getAbsolutePath());
- if (resolveExtraSwcsFromFlexFrameworksLibs) {
- if (new File(fwLibDir,"charts.swc").exists())
- //javaParms.add("-include-libraries+=" + new File(fwLibDir,"charts.swc").getCanonicalFile().getAbsolutePath());
- linkedLibraryPaths.add(new File(fwLibDir,"charts.swc").getCanonicalFile().getAbsolutePath());
- if (new File(fwLibDir,"fds.swc").exists())
- linkedLibraryPaths.add(new File(fwLibDir,"fds.swc").getCanonicalFile().getAbsolutePath());
- }
- } catch (IOException e) {
- throw new MojoExecutionException("IOException trying to add to
included libraries.",e);
- }
-
-
- // external-library-path path-element [...]
- // Specifies a list of SWC files or directories to exclude from
linking when compiling a SWF file. This option provides compile-time
link checking for external components that are dynamically linked.
- // For more information about dynamic linking, see About linking.
- // You can use the += operator to append the new SWC file to the
list of external libraries.
-
- // runtime-shared-libraries (deployed runtime lib location - 1 for each)
-
- // Process
Set artifacts = project.getArtifacts();
getLog().debug("Dependency artifacts: " + artifacts);
Iterator depsIterator = artifacts.iterator();
@@ -251,43 +230,19 @@
}
- // FIXME: What do we do with include-libraries???
- // add included library paths.
- Set includedLibraryPaths = new HashSet();
- Iterator inclLibsIter = includedLibraryPaths.iterator();
- while (inclLibsIter.hasNext())
- parameters.add("-include-libraries+=" + inclLibsIter.next());
-
+ // FIXME: What do we do with include-libraries???
+ // add included library paths.
+ // Set includedLibraryPaths = new HashSet();
+ // Iterator inclLibsIter = includedLibraryPaths.iterator();
+ // while (inclLibsIter.hasNext())
+ // parameters.add("-include-libraries+=" + inclLibsIter.next());
+
+ // add linked library paths.
+ Iterator linkedLibsIter = linkedLibraryPaths.iterator();
+ while (linkedLibsIter.hasNext())
+ parameters.add("-library-path+=" + linkedLibsIter.next());
-
-
- /*
- -benchmark
- -compiler.accessible
- -compiler.actionscript-file-encoding <string>
- -compiler.context-root <context-path>
- -compiler.fonts.max-glyphs-per-face <string>
- -compiler.include-libraries [library] [...]
-
- -compiler.namespaces.namespace <uri> <manifest>
- -compiler.source-path [path-element] [...]
- -compiler.theme [filename] [...]
- -compiler.use-resource-bundle-metadata
- -file-specs [path-element] [...]
- -help [keyword] [...]
- -metadata.contributor <name>
- -metadata.creator <name>
- -metadata.date <text>
- -metadata.description <text>
- -metadata.language <code>
- -metadata.localized-description <text> <lang>
- -metadata.localized-title <title> <lang>
- -metadata.publisher <name>
- -metadata.title <text>
- -runtime-shared-libraries [url] [...]
- */
-
return parameters;
}