setup.adoc 5.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. = Creating a jMonkeyEngine SDK plugin
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../
  6. :imagesdir: ../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. Note that the creation of a Module Suite is only necessary if you want to upload your plugin to the contribution update center.
  9. == Using jMonkeyEngine SDK for development
  10. * Install the “Netbeans Plugin Development and “NetBeans +++<abbr title="Application Programming Interface">API</abbr>+++ Documentation plugins via Tools→Plugins
  11. * Create a new “Module Suite project (can be any name, this will be your local “collection of plugins that you create)
  12. * If no platform is listed, add one by selecting the SDK application folder
  13. ** Mac users have to right-click the jmonkeyplatform application and select “show contents and then select the jmonkeyplatform folder under Contents/Resources/
  14. * Open the suite, right-click the “Modules folder and select “Add new..
  15. * For “Project Name enter an all-lowercase name without spaces like `my-library`
  16. * Make sure the “Project Location is inside the module suite folder and press “Next
  17. * Enter the base java package for your plugin in “Code Name Base like `com.mycompany.plugins.mylibrary`
  18. * Enter a “Module Display Name for your plugin like “My Library
  19. * Press Finish
  20. * To use core SDK or jME3 functions, add “SDK Core and “SDK Engine via “Module Properties→Library→Add Dependency
  21. * Write your plugin (e.g. <<sdk/development#,create a new editor>> or <<sdk/development/extension_library#,wrap a jar library>>)
  22. == jMonkeyEngine SDK Contributions Update Center
  23. If you want your plugin to appear in the “jMonkeyEngine SDK Contributions Update Center so users can download, install and update it easily via the plugin manager, you can host your plugin in the contributions update center svn repository. The contributions update center is based on a googlecode project for contributed plugins which will be automatically compiled, version-labeled and added to the contributions update center like the core jMonkeyEngine SDK plugins.
  24. Effectively its one large module suite with multiple modules which each represent one plugin, extension library.
  25. === Adding your plugin to the repository
  26. To add your plugin to the repository, do the following:
  27. * Make sure the plugin is part of a “Module Suite and that its located in the folder of the suite (this saves you from problems with the svn and local version not being configured the same)
  28. * In “Module Properties→Sources
  29. ** Set the “Source Level to 1.5 if possible (jMonkeyEngine SDK is compatible to Java 1.5)
  30. * In “Module Properties→+++<abbr title="Application Programming Interface">API</abbr>+++ Versioning
  31. ** Set a specification version for your plugin (like 0.8.1)
  32. ** Set the “implementation version to “0 and select “append implementation versions automatically
  33. * In “Module Properties→Display
  34. ** Enter a purposeful description of your plugin and one of the following categories:
  35. *** For a library plugin: “jME3 - Library
  36. *** For a SDK plugin: “jME3 - SDK Plugin
  37. *** For a model loader plugin: “jME3 - Loader
  38. * In “Module Properties→Build→Packaging
  39. ** Add your name
  40. ** Add a link to your forum post / home page relating to the plugin
  41. ** Add a license, you can use `../license-jme.txt` to insert the default jME BSD license or use a text file you store in the project folder
  42. * Ask the managers or developers for access to the gc project
  43. * Commit *only the module project* to trunk:
  44. ** Right click the Module Project and select “Versioning → Import into Subversion Repository
  45. //** Enter `link:https://jmonkeyplatform-contributions.googlecode.com/svn/trunk[https://jmonkeyplatform-contributions.googlecode.com/svn/trunk]` in the +++<abbr title="Uniform Resource Locator">URL</abbr>+++ field
  46. ** Enter your googlecode username and commit password (different than login pass, you can find your password link:https://code.google.com/hosting/settings[here]!) and press “Next
  47. ** Check that the “Repository Folder is `trunk/mypluginfolder` and enter an import message
  48. ** Press “Finish
  49. And thats it, from now on each time you commit changes to your module it will be built and added to the contributions center automatically and the version number will be extended by the svn revision number (e.g. 0.8.1.1234)
  50. === Building wrapped library jar files on the server
  51. You can just build your library locally and update and commit the jar file and javadoc/sources zip files to the `release/libs` folder of your plugin in the contrib repo. The users plugins will automatically be updated with the new jar files. You can however also build the library project on the server.
  52. As normally only the module project is being built on the server, any projects that create the actual jar files for library plugins (“normal projects from the SDK/NetBeans) have to be built from the module build file. To do that simply add the following ant targets to the module build file (adapt to your project file and folder names):
  53. [source,xml]
  54. ----
  55. <target name="init" depends="basic-init,files-init,build-init,-javac-init,-build-subproject"/>
  56. <target name="-build-subproject">
  57. <ant dir="./AI" inheritall="false" inheritrefs="false" target="clean"/>
  58. <ant dir="./AI" inheritall="false" inheritrefs="false" target="jar"/>
  59. <ant dir="./AI" inheritall="false" inheritrefs="false" target="javadoc"/>
  60. <zip basedir="./AI/dist/javadoc" file="release/libs/jME3-ai-javadoc.zip"/>
  61. <zip basedir="./AI/src" file="release/libs/jME3-ai-sources.zip"/>
  62. <copy file="./AI/dist/jME3-ai.jar" todir="release/libs"/>
  63. </target>
  64. ----
  65. *Note that for the module version number to increase automatically on a commit to the library project, the library project has to be a subfolder of the main module project.*