#6 GSoC’18 – Restructure SBSCL

This week’s work mainly includes a comprehensive refactoring of the codebase. Originally, SBSCL used Ant scripts for the build process and therefore the current directory structure. However, over time the standards changed and SBSCL’s build process moved to maven. I have talked about maven in a few blog posts already when I try to introduce the build process. I have also talked about the issues faced to build SBSCL using maven. Most of these were because SBSCL’s codebase was not organized as per maven standards.

Before restructuring this is how the code was organized:

 |- dist        -> Contains a JAR file of the library
 |- doc
    |- api      -> JavaDoc including examples for usage of the library
 |- lib         -> 3rd party libraries needed for compilation and execution
 |- licenses    -> License agreements of all 3rd party libs and a list of 
 |                 authors of this library
 |- resources   -> A source folder containing required resource files.
 |- src         -> The main source folder containing all Java files and the 
 |                 overview.html providing a brief overview of the project.
 |- test        -> Source code for testing, including BioModels and SBML Test
 |                 Suite
 |- build.xml   -> an Apache ANT script which compiles the source code and
 |                 provides several options to create distribution files.
 |- LICENSE.txt -> the license, under which this project is distributed
 |- pom.xml     -> Maven support for the project
 |- README.txt  -> this file

There were multiple folders in the original organization which has been changed to move all the code inside src folder. As per maven standards, all the code should be inside src/main/java/ and JUnit test should be in src/test/java while the resources for these should be in src/main/resources and src/test/resources respectively.

This restructuring is especially helpful since simple maven run will not only compile the code, but it will also execute all the JUnit tests. Following command can be used for a clean maven install:

mvn -U clean install

Currently, most tests inside src/test/java are not JUnit files. Instead, they have a main class and so they won’t be automatically executed. Upcoming work will be to convert these to JUnit tests.

Let me know if any questions or issues.


One thought on “#6 GSoC’18 – Restructure SBSCL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s