My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Preface

It was 2002 when I developed the first version of the preprocessor, I needed it because I had a lot of orders for mobile applications and I desired any tool which allowed me to decrease size of those applications and make them faster, so the project was born. Long time I had been using it in different projects and it worked well but in 2011 I decided to make deep refactoring because inside it looked awfully, as well I have placed the project on the google code service. So may be it is the first world Java preprocessor (it's almost ten years old) and may be the most powerful because it is a multi-pass one, allows to read data from XML files and make loops inside directives. I have been publishing its binaries since 2003 but sources were published (very old versions) only about 2010. The Power of the preprocessor allowed me to speed up developing not only in Java but also it was used by me to generate static web sites based on XML data files and it worked well.

Usage

Since the 5.0 version the preprocessor can be executed

  • As an ANT task
  • As a Maven plugin
  • As a Java framework with direct class calls
  • through CLI (command line interface)

The Main idea

Because Java doesn't support any preprocessing and I wanted to use standard IDEs (like NetBeans) I decided to use commentaries to place preprocessor directives. The solution allows to keep preprocessing without any problem for debugging and compilation in any IDE. You can see some piece of code using preprocessor directives below:

//#local TESTVAR="TEST LOCAL VARIABLE"
//#assert "TESTVAR="+/*$TESTVAR$*/
//#include ".//test//_MainProcedure.java"

public static final void testproc()
{
 System.out.println(/*$VARHELLO$*/);
 System.out.println("// Hello commentaries");
 //#local counter=10
	//#while counter!=0
	System.out.println("Number /*$counter$*/");
	//#local counter=counter-1
	//#end
 System.out.println("Current file name is /*$SRV_CUR_FILE$*/");
 System.out.println("Output dir is /*$SRV_OUT_DIR$*/");
 //#if issubstr("Hello","Hello world")
 System.out.println("Substring found");
 //#endif
}
Powered by Google Project Hosting