Contribute
Making XMLVM better
This page is for all developer that are interested in contributing to the XMLVM project. We will explain how you can download the source code, help you understand the current code structure, tell you about our coding guidelines and show you what you need to do if you want to contribute a patch.Licensing
XMLVM is licensed under the GPL v2Those developers who contribute to XMLVM will be granted a linking exception to the GPL that allows them (and only them) to use XMLVM in a commercial product.
Getting and compiling the source
Our source code is currently hosted in our Subversion repository at Sourceforge. In order to check out the code, you need a Subversion client. As the team works with Eclipse, our recommendation is to use Subclipse, which is a free Eclipse plugin that allows you to easily checkout and update your code. We would recommend you to install this plugin as well, if you are planning to work with Eclipse. The root for checking out the code is:http://xmlvm.svn.sourceforge.net/svnroot/xmlvm/trunk/xmlvmIf you want to checkout the code via the Subversion
svnclient, use the following command:
svn co http://xmlvm.svn.sourceforge.net/svnroot/xmlvm/trunk/xmlvm xmlvm
Source code structure
Once you have checked out the code, you see the following structure:.classpath
This file is used by Eclipse to define the classpath entries for XMLVM..project
This file is used by Eclipse and defines the project..settings/
This file is also used by Eclipse and contains presets for the project.LICENSE-GPL
This file contains a copy of the GPL license.build.xml
This file is used byant
to build XMLVM and its components./demo/
This directory contains demos that show what's possible with XMLVM./doc/
This directory contains documentation, our homepage and XMLVM graphics./etc/
Launch files and our style configuration can be found here./lib/
All third-party libraries that XMLVM depends on can be found in this directory./src/
All of XMLVM's source code is found here. See the next section for an explanation of the structure within this directory.
The /src/
directory
All of XMLVM's main source can be found in this directory. To give you an overview of what can be found in there, here is a high-level overview of the most important directories:
android2iphone/
Contains android compatibility libraries for executing Android code in Objective-C.avm2jvm/
In here you find our approach to use cross-compilation aspect weaving.clr2jvm/
This directory has the stylesheet for CLR to JVM cross-compilation as well as the .NET compatibility Library, so .NET programs can be run on a Java VM.demo/
We are currenty in the process of moving all demos to/demo
.jvm2clr/
This directory has the stylesheet for JVM to CLR cross-compilation as well as a rudimentary compatibility library.test/
Some code to test existing XMLVM functionality.xmlvm/
This directory contains the XMLVM framework code.xmlvm2cpp/
Contains the stylesheet that produces C++ code as well as a very small compatibility library for Java-based applications.xmlvm2js/
This is the quite mature JavaScript output component of XMLVM. It contains compatibility libraries for a lot of input APIs, including Java, .NET and Android. The stylehseet for generating JavaScript can also be found here.xmlvm2objc/
In here you find the stylesheet that emits Objective-C code as well as our own Java-based iPhone API that we use to develop other compatibility libraries for the iPhone, like the android2iphone API mapping.xmlvm2py/
This directory contains a stylesheet that generates Python code as well as a rudimentary compatibility library for Java/AWT.
Coding guidelines
We try to maintain a consistent coding style throughout our project. We recommend you using Eclipse, as we have created a configuration file that will help you writing code that is compliant with our style. You can find this configuration file in/etc/xmlvm-style.xml.
To use this file go to your XMLVM project in Eclipse and choose:
Project -> Properties. From there find
Java Code Style -> Formatter. Check
Enable project specific settingsand click on
Import.... Now choose the
xmlvm-style.xmlfile and you should be all set.
Not everything is covered by these rules. For example, naming variables in a meaningful and compliant way is up to you. So please look around in the rest of the code to get a feel for how you should name classes, members and methods.
Contributors license agreement
Before we can accept a patch, you need to sign a Contributor License Agreement. We need to have a Contributor License Agreement from you on file. Without it, your code cannot be submitted into the XMLVM repository. You only need to do this once.In return we will grant you a GPL linking exception that will enable you to use XMLVM in a commercial product without having to place your own code under the GPL.
Submitting a patch
Before generating a patch, please first update your local work copy to the latest version of the Subversion repository in order to reduce the risk of conflicts. In Eclipse, right-click on the project name and then selectTeam -> Create patch.... Once you have generated the patch, you have two options to submit it. You can either simply email it to
reviews@xmlvm.orgor you can submit it through a hosted code reviewing tool. A code review gives us the opportunity to take a close look at your contribution so we can make sure it doesn't contain major bugs and complies with our coding styles.
In order to make this process easy, we host a code review portal which you can find here: http://xmlvm-reviews.appspot.com/ In order to submit a patch for code review, you need to have a Google account, you will then be able to log into this portal. Create a new issue for your patch. Give it a meaningful title and descriptions. The "SVN base" that is given should work if you created your patch relative to the SVN root directory mentioned above.
As reviewer, please add this e-mail address:
reviews@xmlvm.org. You can then append your patch either directory from a file that you created or via a URL, to which you uploaded the patch. If you have questions on how to create a patch, please let us know