3. Creation of scripts Table of contents

3.1. The file "build.bat"

 

 

To ease the process of development we have to create three special files which should be stored in the directory "bin\application\sample\myworld". Create this directory!

· build.bat     (Linux: build.sh)

· start.bat      (Linux: start.sh)

· build.xml

 

 

I want to discuss the creation of scripts for Windows. You will find versions for Linux at the right side. But notice that you have to adapt the contents. So you have to customise the JDK path and the Res Medicinae project path. It depends on where Java and Res Medicinae is installed on your computer.

 

(1) First create the file “build.bat” with a simple editor. This file can be used to easily build the specified project. Visit the link “build.bat” on the right side and copy the whole contents to your file. Store it in the directory “bin\application\sample\myworld”.

(2) Add your name and Email.

(3) Now you have to specify the Java paths. It should look similar to this example.

set JAVA_HOME=\jdk14

set JAVA=%JAVA_HOME%\bin\java

set JAVA_RUNTIME_PATH=%JAVA_HOME%\jre\lib\rt.jar

set JAVA_TOOLS_PATH=%JAVA_HOME%\lib\tools.jar

 

(4) Don’t forget to specify the Res Medicinae project path.

 

set RESMEDICINAE_HOME=\Studienarbeit\cvs

 

For our first simple application only one jar file (ant.jar) is used.

The other jar files are not included yet but maybe you will need them later. Then you can simply add them to the classpath by removing the “rem” before the “set” statement.

 

The building is done by the "ANT" tool of the "Jakarta" tool suite. It is a Java based build tool and uses configuration files in XML format.

 

We have three options:

 

(a) compile

(Compiles sources while taking source files from /src and discards them in /build)

(b) archive

(Creates a distribution directory containing packed file archive. The files are taken from the /build directory and jar-files are created by means of ANT, which is controlled and started by the build.xml file)

(c) clean

(Cleans up old files and directories in /lib and /build)

 

Look at this statement. At the end of this statement %*% is written. It means to read in all command line options. So it is very simple to execute one of the options. Later I will give you more information. Linux users have to take the "${*}" statement.

%JAVA% -mx64m -classpath %CLASSPATH% -Dant.home=%RESMEDICINAE_HOME%\lib org.apache.tools.ant.Main -buildfile %RESMEDICINAE_SYSTEM_BIN%\build.xml %*%

 

<<PREVIOUS                                                                   NEXT>>

Contents of build.bat

Contents of build.xml

Contents of start.bat

Contents of build.sh

Contents of start.sh

 

Copyright (c) 1999-2002. Dirk Behrendt All rights reserved. GNU FDL license. Last Update: 30.09.2002