content/maven/flexjs/latest-dev/build.html (480 lines of code) (raw):

<!DOCTYPE html> <!-- | Generated by Apache Maven Doxia Site Renderer 1.7.1 at 2016-09-27 | Rendered using Apache Maven Fluido Skin 1.5 --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20160927" /> <meta http-equiv="Content-Language" content="en" /> <title>Maven &#x2013; </title> <link rel="stylesheet" href="./css/apache-maven-fluido-1.5.min.css" /> <link rel="stylesheet" href="./css/site.css" /> <link rel="stylesheet" href="./css/print.css" media="print" /> <script type="text/javascript" src="./js/apache-maven-fluido-1.5.min.js"></script> </head> <body class="topBarDisabled"> <div class="container-fluid"> <div id="banner"> <div class="pull-left"> <a href="http://flex.apache.org/" id="bannerLeft"> <img src="http://flex.apache.org/images/logo_01_fullcolor-sm.png" alt="Apache Flex"/> </a> </div> <div class="pull-right"> </div> <div class="clear"><hr/></div> </div> <div id="breadcrumbs"> <ul class="breadcrumb"> <li id="publishDate">Last Published: 2016-09-27 <span class="divider">|</span> </li> <li id="projectVersion">Version: 0.8.0-SNAPSHOT </li> <li class="pull-right"> <span class="divider">|</span> <a href="https://cwiki.apache.org/confluence/display/FLEX/Apache+Flex+Wiki" class="externalLink" title="Apache Flex Wiki"> Apache Flex Wiki</a> </li> <li class="pull-right"> <a href="http://flex.apache.org/" class="externalLink" title="Apache Flex Homepage"> Apache Flex Homepage</a> </li> </ul> </div> <div class="row-fluid"> <div id="leftColumn" class="span2"> <div class="well sidebar-nav"> <ul class="nav nav-list"> <li class="nav-header">FlexJS</li> <li> <a href="index.html" title="Introduction"> <span class="none"></span> Introduction</a> </li> <li class="active"> <a href="#"><span class="none"></span>Building from Source</a> </li> <li> <a href="structure.html" title="Build structure"> <span class="none"></span> Build structure</a> </li> <li class="nav-header">Project Documentation</li> <li> <a href="project-info.html" title="Project Information"> <span class="icon-chevron-right"></span> Project Information</a> </li> <li> <a href="project-reports.html" title="Project Reports"> <span class="icon-chevron-right"></span> Project Reports</a> </li> <li class="nav-header">Modules</li> <li> <a href="compiler/index.html" title="Apache Flex - FlexJS: Compiler: Compiler"> <span class="none"></span> Apache Flex - FlexJS: Compiler: Compiler</a> </li> <li> <a href="compiler-jx/index.html" title="Apache Flex - FlexJS: Compiler: Compiler-JX"> <span class="none"></span> Apache Flex - FlexJS: Compiler: Compiler-JX</a> </li> <li> <a href="compiler-test-utils/index.html" title="Apache Flex - FlexJS: Compiler: Test Utils"> <span class="none"></span> Apache Flex - FlexJS: Compiler: Test Utils</a> </li> <li> <a href="debugger/index.html" title="Apache Flex - FlexJS: Compiler: Debugger"> <span class="none"></span> Apache Flex - FlexJS: Compiler: Debugger</a> </li> <li> <a href="flex-compiler-oem/index.html" title="Apache Flex - FlexJS: Compiler: OEM Layer"> <span class="none"></span> Apache Flex - FlexJS: Compiler: OEM Layer</a> </li> <li> <a href="flexjs-ant-tasks/index.html" title="Apache Flex - FlexJS: FlexJS Ant Tasks"> <span class="none"></span> Apache Flex - FlexJS: FlexJS Ant Tasks</a> </li> <li> <a href="flexjs-maven-plugin/index.html" title="Apache Flex - FlexJS: FlexJS Maven Plugin"> <span class="none"></span> Apache Flex - FlexJS: FlexJS Maven Plugin</a> </li> </ul> <hr /> <div id="poweredBy"> <div class="clear"></div> <div class="clear"></div> <div class="clear"></div> <div class="clear"></div> <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /> </a> </div> </div> </div> <div id="bodyColumn" class="span10" > <h1>Building FlexJS from source</h1> <div id="toc" class="toc"> <div id="toctitle">Table of Contents</div> <ul class="sectlevel1"> <li><a href="#_prerequisites">Prerequisites</a> <ul class="sectlevel2"> <li><a href="#_windows">Windows</a></li> <li><a href="#_linux-mac">Linux / Mac</a></li> </ul> </li> <li><a href="#_building-flexjs">Building FlexJS</a> <ul class="sectlevel2"> <li><a href="#_building-the-compiler">Building the Compiler</a></li> <li><a href="#_building-the-typedefs">Building the typedefs</a></li> <li><a href="#_building-the-framework">Building the framework</a></li> </ul> </li> </ul> </div> <div id="preamble"> <div class="sectionbody"> <div class="paragraph"> <p>This document will guide you through the process of building FlexJS from source.</p> </div> </div> </div> <div class="sect1"> <h2 id="_prerequisites"><a class="anchor" href="#_prerequisites"></a>Prerequisites</h2> <div class="sectionbody"> <div class="paragraph"> <p>In order to build FlexJS you require the following software installed on your machine:</p> </div> <div class="ulist"> <ul> <li> <p>A Java JDK 1.6 or higher (a simple Java runtime is not enough) (<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" class="bare">http://www.oracle.com/technetwork/java/javase/downloads/index.html</a>)</p> </li> <li> <p>Apache Maven 3.3.1 or higher (<a href="http://maven.apache.org" class="bare">http://maven.apache.org</a>)</p> </li> <li> <p>The Flash Player projector content debugger (<a href="https://www.adobe.com/support/flashplayer/debug_downloads.html" class="bare">https://www.adobe.com/support/flashplayer/debug_downloads.html</a>)</p> </li> </ul> </div> <div class="paragraph"> <p>Make sure the following environment variable is set to the exact location of the Flash Player projector content debugger:</p> </div> <div class="listingblock"> <div class="content"> <pre>FLASHPLAYER_DEBUGGER={Absolute path to the executable}</pre> </div> </div> <div class="paragraph"> <p>On a Mac you have to point to the executable itself, not the app-directory</p> </div> <div class="listingblock"> <div class="content"> <pre>FLASHPLAYER_DEBUGGER="{Absolute path the the App directory}/Flash Player.app/Contents/MacOS/Flash Player Debugger"</pre> </div> </div> <div class="paragraph"> <p>If you are using the commandline you need to make sure the following environment variables are set:</p> </div> <div class="listingblock"> <div class="content"> <pre>JAVA_HOME={Absolute path to the JDK installation directory} MAVEN_HOME={Absolute path to the Maven installation directory}</pre> </div> </div> <div class="paragraph"> <p>The following elements have to be added to your systems PATH variable:</p> </div> <div class="listingblock"> <div class="content"> <pre>{JAVA_HOME}/bin {MAVEN_HOME}/bin</pre> </div> </div> <div class="paragraph"> <p>The following setup has proven to be usefull:</p> </div> <div class="sect2"> <h3 id="_windows"><a class="anchor" href="#_windows"></a>Windows</h3> <div class="listingblock"> <div class="content"> <pre>JAVA_HOME={Absolute path to the JDK installation directory} MAVEN_HOME={Absolute path to the Maven installation directory} FLASHPLAYER_DEBUGGER={Absolute path to the executable} PATH=%PATH%;%JAVA_HOME%\bin;%MAVEN_HOME%\bin</pre> </div> </div> </div> <div class="sect2"> <h3 id="_linux-mac"><a class="anchor" href="#_linux-mac"></a>Linux / Mac</h3> <div class="listingblock"> <div class="content"> <pre>JAVA_HOME={Absolute path to the JDK installation directory} MAVEN_HOME={Absolute path to the Maven installation directory} FLASHPLAYER_DEBUGGER={Absolute path to the executable} PATH=${PATH}:${JAVA_HOME}/bin;${MAVEN_HOME}/bin</pre> </div> </div> </div> </div> </div> <div class="sect1"> <h2 id="_building-flexjs"><a class="anchor" href="#_building-flexjs"></a>Building FlexJS</h2> <div class="sectionbody"> <div class="paragraph"> <p>Currently you need to checkout and run builds in 3 different repositories. This is due to the fact that every part of the FlexJS SDK (Compiler, typedefs and framework) should be released separately. Also there is a technical reason for this, as the compiler part contains a plugin which is used by the typedefs and the framework. As Maven resolves all the plugins before starting to build we would have a hen-eg-problem. This is particularly hard to handle during Maven releases.</p> </div> <div class="paragraph"> <p>In order to build, the compiler and the typedefs need a set of plugins which are not available as standard maven plugins. Therefore the compiler build contains a compiler-build-tools project which is a Maven plugin that provides all the additional logic needed to build all parts of FlexJS. This needs to be built and released only once. As soon as that&#8217;s done we will continue to reference the released version in the rest of the build. This module only needs to be built if there are changes to the tools.</p> </div> <div class="paragraph"> <p>Another thing the user should keep in mind, that an important part of the build is the <code>flex-sdk-converter-maven-extension</code>. This takes care of automatically providing the Maven artifacts for the old FDK, Air and Flash resources. Unfortunately this has not been released yet and therefore is only available in the Apache Snapshot Repo. Maven doesn&#8217;t know about that therefore we have to tell it to. The best way would be to add the apache- snapshot-repo to your <code>~/.m2/settings.xml</code></p> </div> <div class="listingblock"> <div class="content"> <pre> &lt;!-- Profile that adds the apache snapshot repo to maven --&gt; &lt;profiles&gt; &lt;profile&gt; &lt;id&gt;apache-snapshots-enabled&lt;/id&gt; &lt;!--Enable snapshots for the built in central repo and plugin repo --&gt; &lt;repositories&gt; &lt;repository&gt; &lt;id&gt;apache-snapshots&lt;/id&gt; &lt;url&gt;http://repository.apache.org/snapshots/&lt;/url&gt; &lt;releases&gt; &lt;enabled&gt;false&lt;/enabled&gt; &lt;/releases&gt; &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/snapshots&gt; &lt;/repository&gt; &lt;/repositories&gt; &lt;pluginRepositories&gt; &lt;pluginRepository&gt; &lt;id&gt;apache-snapshots&lt;/id&gt; &lt;url&gt;http://repository.apache.org/snapshots/&lt;/url&gt; &lt;releases&gt; &lt;enabled&gt;false&lt;/enabled&gt; &lt;/releases&gt; &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;/snapshots&gt; &lt;/pluginRepository&gt; &lt;/pluginRepositories&gt; &lt;/profile&gt; &lt;/profiles&gt; &lt;!-- Activate the apache-snapshots-enabled profile --&gt; &lt;activeProfiles&gt; &lt;activeProfile&gt;apache-snapshots-enabled&lt;/activeProfile&gt; &lt;/activeProfiles&gt;</pre> </div> </div> <div class="paragraph"> <p>For your convenience, we added a file called "settings-template.xml" to each of the three repositories. You could simply copy one to your <code>~/.m2</code> directory and name it <code>settings.xml</code> or you tell maven to use the template, by using the <code>-s</code> parameter instead:</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn -s settings-template.xml</pre> </div> </div> <div class="paragraph"> <p>So for the rest of this documentation we will be assuming you have defined the Apache Snapshot Repository in the default Maven settings.xml. In all other cases you simply have to add <code>-s settings-template.xml</code> to every Maven call.</p> </div> <div class="sect2"> <h3 id="_building-the-compiler"><a class="anchor" href="#_building-the-compiler"></a>Building the Compiler</h3> <div class="paragraph"> <p>The compiler block is the main part of the build. You can easily build it using the following command: (run it in the flex-falcon repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install</pre> </div> </div> <div class="paragraph"> <p>This contains a large set of unit- and integrationtests. If you just want to build the compiler, the following command will take care of this without running the unit- and integrationtests: (run it in the flex-falcon repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install -DskipTests</pre> </div> </div> <div class="paragraph"> <p>If you want to run the unittests, but skip the integrationtests: (run it in the flex-falcon repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install -DskipITs</pre> </div> </div> <div class="paragraph"> <p>Maven also takes care of building the project website and documentation. This is handled as part of the Maven <code>site</code> lifecycle. If you want to build the documentation for the compiler, the following command will take care of this: (run it in the flex-falcon repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn site</pre> </div> </div> <div class="paragraph"> <p>This will create the documentation for each module inside the corresponding modules <code>target/site</code> directory. However if you open the <code>index.html</code> of the root project, the links to the sub-modules will not work as the local directory structure differs from the structure the deployed documentation would have. In order to locally read and test the documentation, the following command will wrap all parts into the <code>target/staging</code> directory of the project root. (run it in the flex-falcon repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn site:stage</pre> </div> </div> <div class="paragraph"> <p>You can of course wrap all together into one big build: (run it in the flex-falcon repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install site site:stage</pre> </div> </div> </div> <div class="sect2"> <h3 id="_building-the-typedefs"><a class="anchor" href="#_building-the-typedefs"></a>Building the typedefs</h3> <div class="paragraph"> <p>The second block of the FlexJS SDK are the typedefs (aka externs). These are located in a separate repo (flex-typedefs).</p> </div> <div class="paragraph"> <p>Building the typedefs is quite straight-forward. All you need to do, is run the following command: (run it in the flex-typedefs repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install</pre> </div> </div> </div> <div class="sect2"> <h3 id="_building-the-framework"><a class="anchor" href="#_building-the-framework"></a>Building the framework</h3> <div class="paragraph"> <p>The framework is the last building block and is located in the <code>flex-asjs</code> repo. This contains all the modules that make up the framework of FlexJS. It also contains a set of examples as well as the Maven assembly to build a local FlexJS SDK distribution, which can be configured in any IDE to build FlexJS applications.</p> </div> <div class="paragraph"> <p>Building the framework is quite straight-forward. All you need to do, is run the following command: (run it in the flex-asjs repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install</pre> </div> </div> <div class="paragraph"> <p>As compiling the examples takes quite a while, you have to enable the building of examples by activating the <code>build-examples</code> profile: (run it in the flex-asjs repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install -P build-examples</pre> </div> </div> <div class="paragraph"> <p>Building the distribution also takes a little while, so it is also not built in the default profile. In order to build the distribution, run the following build: (run it in the flex-asjs repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install -P build-distribution</pre> </div> </div> <div class="paragraph"> <p>However this doesn&#8217;t automatically build the directory distribution. It builds a zip and a tar.gz version of the FlexJS SDK, without any of the Adobe dependencies. This is the part that is for example used by the Flex Installer to install a local FDK.</p> </div> <div class="paragraph"> <p>If you want to have a FlexJS SDK (including Air, Flash, Fontkit, etc.) you need to tell the build where to put it by providing a property to the build: (run it in the flex-asjs repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install -P build-distribution -DdistributionTargetFolder={some directory}</pre> </div> </div> <div class="paragraph"> <p>If you want to build everything: (run it in the flex-asjs repo)</p> </div> <div class="listingblock"> <div class="content"> <pre>mvn clean install -P build-examples,build-distribution -DdistributionTargetFolder={some directory}</pre> </div> </div> </div> </div> </div> </div> </div> </div> <hr/> <footer> <div class="container-fluid"> <div class="row-fluid"> <p >Copyright &copy; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved. </p> </div> </div> </footer> </body> </html>