qickrooms / flex-mojos

Automatically exported from code.google.com/p/flex-mojos
0 stars 0 forks source link

add headlessServer configuration option to the asdoc plugin #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Adobe asdoc compiler defaults to requiring an interactive session unless 
the Java java.awt.headless property is set to true. The flex-compiler-mojo has 
a convenient configuration 
option, headlessServer, that prevents the mxml/as compiler from requiring an 
interactive session. 
Please add this option to the asdoc plugin to support continuous integration 
(headless) server 
builds.

The current work-around is to pass "-Djava.awt.headless=true" as an option to 
mvn (e.g., "mvn -
Djava.awt.headless=true install").

Original issue reported on code.google.com by jon.buff...@gmail.com on 23 Jun 2008 at 5:42

GoogleCodeExporter commented 9 years ago
Unfortunately, I did not set the ticket attributes correctly and unable to edit 
the ticket. I would classify this 
ticket's  attributes as Enhancement/Minor.

Original comment by jon.buff...@gmail.com on 23 Jun 2008 at 5:45

GoogleCodeExporter commented 9 years ago

Original comment by velo...@gmail.com on 23 Jun 2008 at 6:32

GoogleCodeExporter commented 9 years ago
You can also pass the headless flag through MAVEN_OPTS:
export MAVEN_OPTS=-Djava.awt.headless=true

You can also set this in the pom right now with the configFile parameter
            <plugin>
                <groupId>info.rvin.mojo</groupId>
                <artifactId>asdoc</artifactId>
                <configuration>
                    <configFile>src/main/asdoc/asdoc-config.xml</configFile>
                </configuration>
            </plugin>

and then in your asdoc-config.xml:
<?xml version="1.0" encoding="UTF-8"?> 
<flex-config >
<compiler> 
    <headless-server>true</headless-server>
</compiler> 
</flex-config>

Original comment by RedB...@gmail.com on 28 Jun 2008 at 6:57

GoogleCodeExporter commented 9 years ago
patch:

Index: src/main/java/info/rvin/flexmojos/asdoc/AsDocMojo.java
===================================================================
--- src/main/java/info/rvin/flexmojos/asdoc/AsDocMojo.java  (revision 539)
+++ src/main/java/info/rvin/flexmojos/asdoc/AsDocMojo.java  (working copy)
@@ -248,6 +248,18 @@
     */
    protected File[] sourcePaths;

+   /**
+    * Sets the compiler when it runs on a server without a display. This is
+    * equivalent to using the <code>compiler.headless-server</code> option of
+    * the mxmlc or compc compilers.
+    *
+    * that value determines if the compiler is running on a server without a
+    * display.
+    *
+    * @parameter default-value="false"
+    */
+   private boolean headlessServer;
+
    @SuppressWarnings("unchecked")
    protected void setUp() throws MojoExecutionException, MojoFailureException {
        if (sourcePaths == null) {
@@ -395,6 +407,10 @@
        args.add("-exclude-dependencies=" + excludeDependencies);
        args.add("-compiler.fonts.local-fonts-snapshot="
                + fontsSnapshot.getAbsolutePath());
+       if (headlessServer)
+       {
+           args.add("-compiler.headless-server=true");
+       }
        args.add("-load-config=" + configFile.getAbsolutePath());
        args.add("-output=" + output.getAbsolutePath());

Original comment by RedB...@gmail.com on 28 Jun 2008 at 7:08

GoogleCodeExporter commented 9 years ago
fix committed to r541

Original comment by RedB...@gmail.com on 4 Jul 2008 at 1:19