Clone wiki

SCons / javabuildrun

Java-Build-Run, classpath made by recursively walking through the directories.

The code compiles and runs java files.

The project attached consists of a few directories, src, bin, lib, tools. Three main-code files, SConstruct,, The functionality of the three files is explained below.

  • SConstruct contains the build code, to invoke build, $ python tools/scons/scons-local-0.98.4/ buildresource=src/somecompany/

this will build the and put the resulting class file in bin/com/somecompany/HiSCons.class.

The classpath consists of all the files in dirs/subdirs of lib, and files in src.

Whole src directory is build, if you don't specify buildresource parameter or buildresource=src.

  • compiles the .java file, by calling SConstruct and then run's it with classpath of lib and bin directories. To invoke $ python [--javaargs] src/com/somecompany/

If the class file needs input parameters to run, you can specify --javaargs, and it will prompt you for parameters.

  • contains configuration code for the project. you can change the configuration code according to your needs.

  • I looked over the internet for java 1.5 classpath, if I don't have to walk through directories and explicitely mention jars and class files in the lib(just mention lib and it automatically finds all the files), but it was not possible at least to me . Perhaps you can find a way. Java 1.6 allows some support in this regard, but since I was on 1.5 so.. The code is self explanatory, and comments are added as and when needed. It's been tested, on ubuntu, should work well on windows, except that at some points the path separator is of posix systems, e.g. src/com/somecompany/ instead of src\com\somecompany\

-- Regards, Babar Abbas,