-
Notifications
You must be signed in to change notification settings - Fork 20
Compiling OpenSHAPA
This guide steps new developers and the curious through the process of obtaining and compiling the OpenSHAPA source code.
git clone https://github.com/OpenSHAPA/openshapa.git
cd openshapa
export MAVEN_OPTS="-Xmx256M"
mvn -Prelease,jar-package -Dmaven.test.skip=true assembly::assembly
To get started you will need to download and install a few development tools. OpenSHAPA is primarily written in Java, and the scripting engine is powered by Ruby (via JRuby). The list of toys you will need to download:
When installing Xcode, you will need to select the "UNIX Development Support" option during the install process. However, if the option is greyed out and not available (as in the example below) it may mean that the version of Xcode you are trying to install is out of date and not supported on Snow Leopard. Download the latest version of Xcode Tools from the Apple website and try again - it should then be available for installation.
In order for git to correctly populate OpenSHAPA's version history of any changes that you contribute, the following configuration commands need to be issued:
git config --global user.name "your name"
git config --global user.email [email protected]
We use git to track versioning changes of OpenSHAPA; it is a distributed version control system so it’s a little different from CVS or SVN (this excelent guide maps concepts from SVN to Git). If you are new to Git, check out the documentation here and our git cheat sheet to get you going. But basically a single command is used to ‘checkout’ openshapa:
git clone https://github.com/OpenSHAPA/openshapa.git
If you are using Netbeans 6.7 and above you can just open the openshapa directory as a project.
In order to correctly debug the video controller from within the netbeans project, you need tell NetBeans to set the security policy that ships with OpenSHAPA, this can be achieved by altering your nbactions.xml file (this will be created in your OpenSHAPA directory after you have imported the OpenSHAPA project into NetBeans. You may need to launch the project from within NetBeans by pressing F6). The nbactions.xml file I use is listed below:
<?xml version="1.0" encoding="UTF-8"?> <actions> <action> <actionName>run</actionName> <goals> <goal>process-classes</goal> <goal>org.codehaus.mojo:exec-maven-plugin:1.1:exec</goal> </goals> <properties> <exec.args>-Djava.security.manager -Djava.security.policy=OpenSHAPA.policy -classpath %classpath org.openshapa.OpenSHAPA</exec.args> <exec.executable>java</exec.executable> </properties> </action> <action> <actionName>debug</actionName> <goals> <goal>process-classes</goal> <goal>org.codehaus.mojo:exec-maven-plugin:1.1:exec</goal> </goals> <properties> <exec.args>-Djava.security.manager -Djava.security.policy=OpenSHAPA.policy -Xdebug -Djava.compiler=none -Xnoagent -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath org.openshapa.OpenSHAPA</exec.args> <jpda.listen>true</jpda.listen> <exec.executable>java</exec.executable> </properties> </action> <action> <actionName>run.single</actionName> <goals> <goal>process-classes</goal> <goal>org.codehaus.mojo:exec-maven-plugin:1.1:exec</goal> </goals> <properties> <exec.args>-Djava.security.manager -Djava.security.policy=OpenSHAPA.policy -classpath %classpath ${packageClassName}</exec.args> <exec.executable>java</exec.executable> </properties> </action> <action> <actionName>debug.single</actionName> <goals> <goal>process-classes</goal> <goal>org.codehaus.mojo:exec-maven-plugin:1.1:exec</goal> </goals> <properties> <jpda.listen>true</jpda.listen> <exec.args>-Xdebug -Djava.compiler=none -Xnoagent -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Djava.security.manager -Djava.security.policy=OpenSHAPA.policy -classpath %classpath ${packageClassName}</exec.args> <jpda.stopclass>${packageClassName}</jpda.stopclass> <exec.executable>java</exec.executable> </properties> </action> <action> <actionName>test</actionName> <goals> <goal>test-compile</goal> <goal>surefire:test</goal> </goals> <properties> <test>${className}</test> <argLine>-Djava.security.manager -Djava.security.policy=OpenSHAPA.policy</argLine> </properties> </action> <action> <actionName>test.single</actionName> <goals> <goal>test-compile</goal> <goal>surefire:test</goal> </goals> <properties> <argLine>-Djava.security.manager -Djava.security.policy=OpenSHAPA.policy</argLine> <test>${className}</test> </properties> </action> </actions>
The above step should create an openshapa directory move into this directory and use maven to invoke the build:
cd openshapa
export MAVEN_OPTS="-Xmx256M"
mvn -Prelease,jar-package -Dmaven.test.skip=true assembly::assembly
You should see maven go off and fish plugins and other dependencies required to build OpenSHAPA. It will run unit tests and hopefully build a zip file at:
openshapa/target/site/download
The zip file is a packaged version of OpenSHAPA that contains everything a user needs to get started with OpenSHAPA. Simply unzip it and double click on the openshapa jar file.