SourceForge.net Logo

Source Code Organization and Build System

Release Information

Project: KoLmafia

Overview

What are the most important facts that a developer should know about this source code organization and build system?
The source code will be organized according to the packages detailed in the table below and will use the directory structure and package naming conventions detailed at the Sun website. The automated build system is not likely to be used in the development of this system, though at a later stage in the development process, it may become useful to make this feature available.
What are the ranked goals of this source code organization and build system?
  1. Division of modules into intuitive subpackages
  2. Compatibility with standard build processes
  3. Separation of version-controlled files from files generated by the build process

Key Directories and Files in Developer Working Copies

PathVCDescription
build.xml Yes Build file
src/net/sourceforge/ Yes Source code
build/ No Output of build process
dist/ No Deployable archives of classes generated by build process

Package Summary

Build Targets

TargetDescription
init Creates the directories which are used by the other build targets. A direct compliment to the clean target, the directories created in this target will be removed through the clean target.
clean Deletes files generated by previous build commands. Files under version control are not touched, provided the files under version control adhere to Goal #3 indicated above.
compile Compiles Java source code and creates .class files under the "build" directory. In addition, because the compiled files may need data files, it also copies the necessary non-source files into the "build" directory.
recompile Deletes files generated by previous build commands and recompiles the Java source code. Specifically, it compiles the code in a clean state to detect possible compile errors that may result from the changing of class interfaces.
createjar = default Creates a .jar archive of compiled classes and adds all necessary manifest information to the created .jar archive, including the main-class attribute, which makes the .jar archive executable.
createtar = default Creates a .tar.gz archive of all source code and web documents stored in the current folder. This is the target that is used to generate the gzipped source during each release.
rejar Deletes files generated by previous build commands and creates a .jar archive of compiled classes and adds all necessary manifest information to the created .jar archive, including the main-class attribute, which makes the .jar archive executable.
javadoc Generates the technical documentation (javadocs) for the system. Note that the user must be online for this target to succeed, as it links to the Java API to create the appropriate hyperlinks to the Sun documentation.
dist Packages the system for distribution/deployment to servers or end users. Specifically, it creates .jar archive of classes recompiled from a clean state and generates the technical documentation (javadocs)
cvscheck Gets a fresh checkout of the files currently in the CVS repository and assures that all of the files successfully compile. This target is to make sure that new files that were intended to be added have been added to the repository and should be used before any release is tagged.
exec Creates a .jar archive of compiled classes and executes the main class of the .jar archive. The .jar archive is dependent on the most recent compilation; the data will not be recompiled from a clean state.

Source Code Organization and Build System Checklist

Division of modules into intuitive subpackages
The subpackages are currently under evaluation. Though this goal has been partially achieved, as the project evolves, special attention must be given to ensure that the subpackages remain intuitive.
Compatibility with standard build processes
Yes; the build process has been tested with Apache Ant 1.6.2, using version 1.5.0 of the Java SDK for Windows XP (J2SE 5.0), with the source JVM being 1.5. Because Apache Ant and Java are platform-independent, it is assumed that the build processes will succeed on other platforms with at least version 1.5.0 of the Java SDK installed.
Separation of version-controlled files from files generated by the build process
Yes; this occurs through different destination directories for the build process than the ones available through CVS. As the project evolves, this distinction should be easy to maintain.