<commit_before># KBase Module Builder documentation

The KBase Module Builder (kb-mobu) is an application that helps developers initialize, compile, test, and run KBase modules. This document details how to install and use it.

The module builder tooling is being designed to allow complete local testing of long running jobs without any external registration or configuration of the deployed job execution engine. Implementation of the code for long running jobs is handled identically to implementations of server code in the current standard KBase server generation.

Stubs for services can be generated in Python, Java and Perl. Clients can be generated in Python, Java, JavaScript and Perl.
For an example KBase service with an asynchronous, long running job, see code and automated tests here:
- Perl: https://github.com/kbaseIncubator/contigcount/tree/develop
- Python: https://github.com/kbaseIncubator/onerepotest

An example KBase service written in Java will be available soon.

# Obtain and install prerequisites

1. MacOS 8 or higher.
 - The SDK should also work on Linux but has not yet been extensively tested. We are not yet supporting Windows.
2. Java JDK (version 7 or above): http://java.oracle.com/
 - You will also need to set the JAVA_HOME environment variable to point to your Java installation.
3. Latest version of XCode (includes make and other developer tools)
4. ant: http://java.oracle.com/
5. git (command-line version): https://git-scm.com/
6. Create a GitHub account if you do not have one already: https://github.com
 - All modules in KBase are pulled and registered from public GitHub repositories

# Set environment variables

Set JAVA_HOME to the directory where you installed JDK. If you're not sure where that is, the command `/usr/libexec/java_home` will tell you.  

    setenv JAVA_HOME `/usr/libexec/java_home`  
Also, be sure your PATH includes the directory that has the *ant* executable.

# Get the git repos

    git clone https://github.com/kbase/kb_sdk
    git clone https://github.com/kbase/jars

# Build the SDK

Some newer features are on other branches, such as develop.  If you do not need these features you do not need to check out a different branch.

    cd kb_sdk<commit_msg>Update Module_builder.md<commit_after># KBase Module Builder documentation

The KBase Module Builder (kb-mobu) is an application that helps developers initialize, compile, test, and run KBase modules. This document details how to install and use it.

The module builder tooling is being designed to allow complete local testing of long running jobs without any external registration or configuration of the deployed job execution engine. Implementation of the code for long running jobs is handled identically to implementations of server code in the current standard KBase server generation.

Stubs for services can be generated in Python, Java and Perl. Clients can be generated in Python, Java, JavaScript and Perl.
For an example KBase service with an asynchronous, long running job, see code and automated tests here:
- Perl: https://github.com/kbaseIncubator/contigcount/tree/develop
- Python: https://github.com/kbaseIncubator/onerepotest

An example KBase service written in Java will be available soon.

# Obtain and install prerequisites

1. MacOS 8 or higher.
 - The SDK should also work on Linux but has not yet been extensively tested. We are not yet supporting Windows.
2. Java JDK (version 7 or above): http://java.oracle.com/
 - You will also need to set the JAVA_HOME environment variable to point to your Java installation.
3. Latest version of XCode (includes make and other developer tools)
4. ant: http://java.oracle.com/
5. git (command-line version): https://git-scm.com/
6. Create a GitHub account if you do not have one already: https://github.com
 - All modules in KBase are pulled and registered from public GitHub repositories

# Set environment variables

Set JAVA_HOME to the directory where you installed JDK. If you're not sure where that is, the command `/usr/libexec/java_home` will tell you.  

    # for tcsh/csh
    setenv JAVA_HOME `/usr/libexec/java_home`  
    # for bash
    export JAVA_HOME=`/usr/libexec/java_home`

Also, be sure your PATH includes the directory that has the *ant* executable.

# Get the git repos

    git clone https://github.com/kbase/kb_sdk
    git clone https://github.com/kbase/jars

# Build the SDK

Some newer features are on other branches, such as develop.  If you do not need these features you do not need to check out a different branch.

    cd kb_sdk
{'fraction_non_alphanumeric': 0.05660377358490566, 'fraction_numerical': 0.0035103115401491883, 'mean_word_length': 4.054323725055433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '314227', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1163, 'n_words': 638}