default_build_script.html 6.6 KB

12345678910111213141516171819202122232425
  1. <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="Asciidoctor 1.5.4"><meta name="keywords" content="documentation, sdk, builds, project, deployment"><title>Default Build Script</title><link rel="stylesheet" href="./asciidoctor.css">
  2. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  3. <link rel="stylesheet" href="./coderay-asciidoctor.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css"></head><body class="article toc2 toc-left"><div id="header"><div id="toolbar"><a href="https://github.com/jMonkeyEngine/wiki/edit/master/src/docs/asciidoc/sdk/default_build_script.adoc"><i class="fa fa-pencil-square" aria-hidden="true"></i></a><a href="https://github.com/jMonkeyEngine/wiki/new/master/src/docs/asciidoc/sdk/"><i class="fa fa-plus-square" aria-hidden="true"></i></a><input dir="auto" style="position: relative; vertical-align: top;" spellcheck="false" autocomplete="off" class="searchbox__input aa-input" id="doc-search" name="search" placeholder="Search in the doc" required="required" type="search"></div><h1>Default Build Script</h1><div class="details"><span class="author" id="author"></span><br><span id="revnumber">version ,</span> <span id="revdate">2016/03/17 20:48</span></div><div id="toc" class="toc2"><div id="toctitle">Table of Contents</div><ul class="sectlevel1"><li><a href="#default-targets">Default Targets</a></li><li><a href="#browsing-the-build-script">Browsing the Build Script</a></li><li><a href="#adding-custom-targets">Adding Custom Targets</a></li></ul></div></div><div id="content"><div id="preamble"><div class="sectionbody"><div class="paragraph"><p>If you use jMonkeyEngine libraries together with the jMonkeyEngine SDK (recommended) then you benefit from the provided build script. Every new project comes with a default Ant script. The toolbar buttons and clean/build/run actions in the jMonkeyEngine SDK are already pre-configured.</p></div></div></div>
  4. <div class="sect1"><h2 id="default-targets">Default Targets</h2><div class="sectionbody"><div class="paragraph"><p>The build script includes targets for the following tasks:</p></div>
  5. <div class="ulist"><ul><li><p>clean – deletes the built classes and executables in the dist directory.</p></li><li><p>jar – compiles the classes, bundles the assets, builds the executable JAR in the dist directory, copies libraries.</p></li><li><p>run – builds and runs the executable JAR (e.g. for the developers to test it).</p></li><li><p>javadoc – compiles javadoc from your java files into html files.</p></li><li><p>debug – used by the jMonkeyEngine SDK Debugger plugin.</p></li><li><p>test – Used by the jMonkeyEngine SDK JUnit Test plugin.</p></li></ul></div>
  6. <div class="paragraph"><p>You can call these targets on the command line using default Ant commands:</p></div>
  7. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code>ant clean
  8. ant jar
  9. ant run</code></pre></div></div>
  10. <div class="admonitionblock tip"><table><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content"><div class="paragraph"><p>We recommended to use the user-friendly menu items, F-keys, or toolbar buttons in the jMonkeyEngine SDK to trigger clean, build, and run actions.</p></div></td></tr></table></div></div></div>
  11. <div class="sect1"><h2 id="browsing-the-build-script">Browsing the Build Script</h2><div class="sectionbody"><div class="paragraph"><p>To see the build script and the predefined tasks</p></div>
  12. <div class="olist arabic"><ol class="arabic"><li><p>Open your project in the jMonkeyEngine SDK if it isn&#8217;t already open (File &gt; Open Project…)</p></li><li><p>Open the Files window (Window &gt; Files)</p></li><li><p>Open the project node. You see <code>build.xml</code> listed.</p><div class="olist loweralpha"><ol class="loweralpha" type="a"><li><p>Double-click <code>build.xml</code> to see how the jme3-specify build targets were defined. You typically do not need to edit the existing ones, but you can.</p></li><li><p>Click the triangle next to <code>build.xml</code> to see all targets.</p><div class="olist lowerroman"><ol class="lowerroman" type="i"><li><p>Double-click a target in the Files window, or the Navigator, to see how the target was defined.<br>
  13. You will notice that the file <code>nbproject/build-impl.xml</code> opens. It contains very generic targets that you typically will never need to edit. Note that <code>build.xml</code> includes <code>build-impl.xml</code>!</p></li></ol></div></li></ol></div></li></ol></div></div></div>
  14. <div class="sect1"><h2 id="adding-custom-targets">Adding Custom Targets</h2><div class="sectionbody"><div style="text-align: right;" class="imageblock"><div class="content"><img src="../sdk/build-impl.png" alt="build-impl.png" width="" height=""></div></div>
  15. <div class="paragraph"><p>The build script is a non-proprietary Apache Ant script. It will work out-of-the-box, but if necessary, you can extend and customize it.</p></div>
  16. <div class="paragraph"><p>Read the comments in <code>build.xml</code>, they explain how to override targets, or extend them, to customize the build process without breaking the existing functionality.</p></div>
  17. <div class="paragraph"><p>Additionally, you can manually override the targets in the <code>*-impl.xml</code> files that are created when you change the deployment settings:</p></div>
  18. <div class="ulist"><ul><li><p>linuxlauncher-impl.xml,</p></li><li><p>macapp-impl.xml,</p></li><li><p>mobile-impl.xml,</p></li><li><p>jnlp-impl.xml, etc.</p></li></ul></div>
  19. <div class="paragraph"><p>Simply copy&amp;paste a target from these files into the main build.xml and that will be run instead with all modifications.</p></div>
  20. <div class="paragraph"><p>* Don&#8217;t edit the base <code>-impl.xml</code> files directly, if you deactivate and reactivate a deployment setting, the SDK resets these files, so you have to copy the whole target and its dependencies, else your build script will become invalid when you disable the deployment option.</p></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2018-01-15 05:30:44 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
  21. apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
  22. indexName: 'jmonkeyengine',
  23. inputSelector: '#doc-search',
  24. debug: false // Set debug to true if you want to inspect the dropdown
  25. });</script></body></html>