extension_library.html 5.1 KB

12345678910111213141516
  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"><title>Creating an extension library plugin</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/development/extension_library.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/development/"><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>Creating an extension library plugin</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></div></div><div id="content"><div class="paragraph"><p>This page describes how you can wrap any jar library into a plugin that a jMonkeyEngine SDK user can download, install and then use the contained library in his own game projects.</p></div>
  4. <div class="paragraph"><p>Make sure you have your SDK set up for plugin development <a href="../../sdk/development/setup.html">as described here</a>.</p></div>
  5. <div class="paragraph"><p>Creating the plugin project (in jMonkeyEngine SDK):</p></div>
  6. <div class="ulist"><ul><li><p>Create a new Module Suite (or use an existing one)</p></li><li><p>Open the suite, right-click the “Modules folder and select “Add new..</p></li><li><p>For “Project Name enter an all-lowercase name without spaces like <code>my-library</code></p></li><li><p>Make sure the “Project Location is inside the module suite folder and press “Next</p></li><li><p>Enter the base java package for your plugin in “Code Name Base like <code>com.mycompany.plugins.mylibrary</code></p></li><li><p>Enter a “Module Display Name for your plugin like “My Library</p></li><li><p>Press Finish</p></li></ul></div>
  7. <div class="paragraph"><p>Adding the library:</p></div>
  8. <div class="ulist"><ul><li><p>Right click the Module Project and select “New→Other</p></li><li><p>Under “Module Development select the “Java SE Library Descriptor template and press “Next</p></li><li><p>If you dont have the external library registered in the jMonkeyEngine SDK yet, click “Manage Libraries and do the following:</p><div class="ulist"><ul><li><p>Click “New Library, enter a name for the library and press OK</p></li><li><p>In the “Classpath tab, press “Add JAR/Folder and select the jar file(s) needed for the library</p></li><li><p>In the “JavaDoc tab, press “Add ZIP/Folder and add the javadoc for the library (zipped or folder)</p></li><li><p>In the “Sources tab you can add a folder or jar file containing the source files of the library if available</p></li><li><p>Press OK</p></li></ul></div></li><li><p>Select the external library from the list and press “Next</p></li><li><p>Enter a name for the Library (used as filename for the description file)</p></li><li><p>Enter a display name for the Library (This is the name the user later sees in his library list)</p></li><li><p>Press OK</p></li></ul></div>
  9. <div class="paragraph"><p>You will notice a new file “MyLibrary.xml is created in the plugins base package and linked to in the layer.xml file. Additionally the jar file and sources /javadoc are copied into a “release folder in the project root. This is basically it, you can configure a version number, license file (should be placed in Module root folder) and more via the Module Properties.</p></div>
  10. <div class="paragraph"><p>Note that the files in the release folder are <strong>not</strong> automatically updated when the library changes, you have to pack and replace the jar and zip files manually. See the build script extension in the link below on how you can make your module build script do that automatically.</p></div>
  11. <div class="paragraph"><p>After you are done, you can <a href="../../sdk/development/setup.html#jmonkeyengine_sdk_contributions_update_center">contribute the plugin in the jMonkeyEngine SDK contribution update center</a>.</p></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2018-02-28 16:23:40 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
  12. apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
  13. indexName: 'jmonkeyengine',
  14. inputSelector: '#doc-search',
  15. debug: false // Set debug to true if you want to inspect the dropdown
  16. });</script></body></html>