3. Programming with Java

3.1. Structure of the mixed Smalltalk/Java package

Within Smalltalk/X package all Java code lives in subdirectory named java , which itself contains various directories and files.

  • build.xml - this is an Ant build file used to compile Java code when building the application. This file is never overwritten by any of the STX:LIBJAVA tools and thus can be edited freely by hand. You may put all customization there. You should import build.auto.xml into build.xml to include all (generated) dependencies and common targets.

  • build.auto.xml - this is a fragment of an Ant build file that is automatically generated (and overwritten) upon commit from Smalltalk/X and should not be edited by hand (changes will be lost after next commit). This file contains generated dependencies and includes common targets (defined in stx/libjava/build.common.xml)

  • ivy.xml - this file may contain dependency definitions for Apache Ivy dependency manager. This is the prefered way to manage dependencies on third-party Java libraries.

  • src - this directory contains Java source files in directory structure as required by Java.

  • libs - this directory contains all Java libraries (as .jar files) required by that package. Except of special cases, .jar files are not (should not) be commited in the repository but rather managed by Apache Ivy dependency manager.

  • libs-src - this directory may contain source .jars for libraries in libs directory. As for libs, sources are not (should not) be commited in the respository but rather managed by Ivy.