Difference between revisions of "Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions"

From Slicer Wiki
Jump to: navigation, search
m
m
Line 1: Line 1:
 
<noinclude>{{documentation/versioncheck}}</noinclude>
 
<noinclude>{{documentation/versioncheck}}</noinclude>
 +
 +
== Conventions ==
 +
 +
* Terminal command - Block like the one below indicates that the command should be executed in a terminal.
 +
 +
<ol style="list-style-type:none; border-left:thick solid darkgreen; padding-left:1em;"> 
 +
<li>On '''Windows''', Git Bash is expected (not the Windows command line). [https://help.github.com/articles/set-up-git#platform-windows Need help ?]</li>
 +
</ol>
 +
 +
{{pre2|<nowiki>$ echo "This is a command"</nowiki>}}
 +
 +
 
== Step-by-step: How to create, publish and distribute an extension ? ==
 
== Step-by-step: How to create, publish and distribute an extension ? ==
  
Line 12: Line 24:
 
<li><p>Use the Wizard to create an extension bundling one Command line module:</p>
 
<li><p>Use the Wizard to create an extension bundling one Command line module:</p>
  
{|width = "100%"
 
! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Linux or MacOSX
 
! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Windows
 
|-
 
| valign="top" |
 
Start a terminal.
 
| valign="top" |
 
Start Git Bash (not the Windows command line). [https://help.github.com/articles/set-up-git#platform-windows Need help ?]
 
|-
 
|colspan="2"|
 
 
{{pre2|<nowiki>
 
{{pre2|<nowiki>
 
$ cd Slicer-SuperBuild/Slicer-build
 
$ cd Slicer-SuperBuild/Slicer-build
Line 36: Line 38:
 
: the Wizard and creating other types of module, click [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|here]].
 
: the Wizard and creating other types of module, click [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|here]].
 
: the different type of modules, click [[Documentation/{{documentation/version}}/Developers/Modules|here]].
 
: the different type of modules, click [[Documentation/{{documentation/version}}/Developers/Modules|here]].
 
|}
 
  
 
</li>
 
</li>
Line 45: Line 45:
 
<li><p>Save the source code of your extension by publishing it on Github</p>
 
<li><p>Save the source code of your extension by publishing it on Github</p>
  
{|width = "100%"
+
{{pre2|<nowiki>$ bin/slicerExtensionWizard --publish ~/Slicer-MyExtension/</nowiki>}}
! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Linux or MacOSX
+
 
! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Windows
 
|-
 
| valign="top" |
 
Start a terminal.
 
| valign="top" |
 
Start Git Bash (not the Windows command line). [https://help.github.com/articles/set-up-git#platform-windows Need help ?]
 
|-
 
|colspan="2"|
 
{{pre2|<nowiki>
 
$ bin/slicerExtensionWizard --publish ~/Slicer-MyExtension/
 
</nowiki>}}
 
|}
 
 
</li>
 
</li>
  
Line 109: Line 97:
 
<li><p>Check that the extension can be installed by starting the Slicer executable from <code>/path/to/Slicer-Superbuild/Slicer-build</code> and installing your extension as explained [[Documentation/{{documentation/version}}/SlicerApplication/ExtensionsManager|here]].</p></li>
 
<li><p>Check that the extension can be installed by starting the Slicer executable from <code>/path/to/Slicer-Superbuild/Slicer-build</code> and installing your extension as explained [[Documentation/{{documentation/version}}/SlicerApplication/ExtensionsManager|here]].</p></li>
  
<li>
+
<li><p>If you consider your extension is ready for distribution, contribute it to the ExtensionsIndex:</p>
  <p>If you consider your extension ready for distribution, follow [[Documentation/{{documentation/version}}/Developers/Tutorials/Contribute_Extension_Description_File|these instructions.]] to contribute the already generated description file.</p>
+
 
 +
  {{pre2|<nowiki>$ bin/slicerExtensionWizard --contribute ~/Slicer-MyExtension/</nowiki>}}
 +
 
 
   <ol style="list-style-type:none; border-left:thick solid darkgreen; padding-left:1em;">   
 
   <ol style="list-style-type:none; border-left:thick solid darkgreen; padding-left:1em;">   
     <li>The generated extension description file file is named <code>&lt;MyExtension&gt;.s4ext</code> and is located in the extension build directory <code>~/MyExtension-build</code></li>
+
     <li>To contribute an extensions build against Slicer {{Documentation/currentversion}}. See [[Documentation/{{documentation/version}}/Developers/Tutorials/Contribute_Extension_Description_File_using_Extension_Wizard|here]].</li>
     <li>Details about the extension description file formet are available [[Documentation/{{documentation/version}}/Developers/Extensions/DescriptionFile|here]]</li>
+
     <li>To learn about extension description file format. See [[Documentation/{{documentation/version}}/Developers/Extensions/DescriptionFile|here]]</li>
 
   </ol>
 
   </ol>
 +
 
</li>
 
</li>
  
 
</ol>
 
</ol>
 
<!--
 
<noinclude>
 
{{:Documentation/{{documentation/version}}/Developers/FAQ/Extensions|Extensions}}
 
</noinclude>
 
-->
 

Revision as of 04:22, 4 June 2014

Home < Documentation < Nightly < Developers < Tutorials < BuildTestPackageDistributeExtensions


For the latest Slicer documentation, visit the read-the-docs.


Conventions

  • Terminal command - Block like the one below indicates that the command should be executed in a terminal.
  1. On Windows, Git Bash is expected (not the Windows command line). Need help ?
$ echo "This is a command"


Step-by-step: How to create, publish and distribute an extension ?

  1. Scan through the user and developer extension FAQs

  2. (Optionally) Present your extension(s) on the slicer developers list to check if other developer are working on a similar project, to seek for advice or to reach out for potential collaborator.

  3. Build Slicer application in Release

  4. Use the Wizard to create an extension bundling one Command line module:

    $ cd Slicer-SuperBuild/Slicer-build
    
    $ bin/slicerExtensionWizard --create Slicer-MyExtension --addModule cli:MyCLI ~
    
    1. By specifying ~ as destination, the extension will be created into your home directory.
    2. Read our FAQ to learn about extension naming convention.

    To learn more about:

    the Wizard and creating other types of module, click here.
    the different type of modules, click here.
  5. If not already done, join Github and setup Git

  6. Save the source code of your extension by publishing it on Github

    $ bin/slicerExtensionWizard --publish ~/Slicer-MyExtension/
  7. Implement your extension. Hack, hack, hack :). Make sure to commit often using meaningful commit message.

  8. Create a documentation page for your extension.

  9. Create an account on the extension server and obtain an API Key. You will then use your midas login and api key to substitute <YOUR-MIDAS-LOGIN> and <YOUR-MIDAS-APIKEY> in the examples.

  10. If not already done, go to NA-MIC community and click on Join community

  11. If not already done, send an email on the slicer developers list asking to be granted write permission on the experimental folder.

    To: slicer-devel@bwh.harvard.edu
    Subject: Extension NAME-OF-YOUR-EXTENSION - Asking permission to write to the Experimental folder
    Hi, 
    
    This extension will allow to [...]
    
    Could you grant user YourUserName write access to the Experimental folder ?
    
    
  12. Assuming the source code of your extension is located in folder MyExtension, you could upload your extension doing:

    Linux or MacOSX (Makefile) Windows (Visual Studio)
    $ mkdir MyExtension-build
    
    $ cd MyExtension-build
    
    $ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DMIDAS_PACKAGE_EMAIL:STRING=<YOUR-MIDAS-LOGIN> -DMIDAS_PACKAGE_API_KEY:STRING=<YOUR-MIDAS-APIKEY> -DSlicer_DIR:PATH=/path/to/Slicer-Superbuild/Slicer-build ../MyExtension
    
    $ make ExperimentalUpload
    
    1. Start CMake, select source and build directory
    2. Add Slicer_DIR, MIDAS_PACKAGE_EMAIL and MIDAS_PACKAGE_API_KEY entries to the cache
    3. Slicer Extensions Configure Windows.png
    4. Click on Configure, select Generator, then click on Generate button.
    5. Open MyExtension.sln (1), select Release configuration (2), select ExperimentalUpload (3) and Build (4).
    6. Slicer Extension ExperimentalUpload Windows VS2008.png

  13. Check submission results on the dashboard: http://slicer.cdash.org/index.php?project=Slicer4#Extensions-Experimental

    1. You should expect the test MyCLITest to fail with error of the form:
      [nrrd] nrrdIoStateDataFileIterNext: couldn't open "~/MyExtension-build/MyCLI/Data/Baseline/CLIModuleTemplateTest.raw"
      This is explained by the fact the *.nhdr file available on midas and downloaded locally still reference CLIModuleTemplateTest.raw
  14. Check that the extension can be installed by starting the Slicer executable from /path/to/Slicer-Superbuild/Slicer-build and installing your extension as explained here.

  15. If you consider your extension is ready for distribution, contribute it to the ExtensionsIndex:

    $ bin/slicerExtensionWizard --contribute ~/Slicer-MyExtension/
    1. To contribute an extensions build against Slicer 4.10. See here.
    2. To learn about extension description file format. See here