Building iManager plugins with Ant
Novell Cool Solutions: Feature
By R Sathish
Reader Rating 
|
Digg This -
Slashdot This
Posted: 11 Oct 2004 |
| Install Ant | |
Download Ant from Apache, the latest 1.6.x version.
http://ant.apache.org/bindownload.cgi
Set ANT_HOME
Add ANT_HOME\bin to path
| Install Java SDK | |
Download Sun Java, the latest 1.4.x SDK
http://java.sun.com/j2se/1.4.2/download.html
Set JAVA_HOME
Add JAVA_HOME\bin to path
| Install iManager SDK | |
http://developer.novell.com/ndk/downloadaz.htm
Set TOMCAT_HOME
| Workarea | |
- Make work area modifiable.
- Realign your workarea so that it matches the recommended structure.
GREEN is workarea directory.
RED is Ant build created directory. - Create 'build scripts' directory.
- Copy the attached files to 'build scripts'

Download build.xml
build.xml does not require any change for the recommended directory structure. If your directory structure is different from the above listing, kindly make the necessary changes in build.xml.
Download build.bat
Download env.txt
(You must not delete any property in env.txt.)env.txt has all variables of a plugin. Having a separate env.txt per plugin allows a generic build.xml.
- Change NPS_TOMCAT to your TOMCAT_HOME. Kindly use '/'.
- Change other settings as required.
- Determines debugging information in generated class files
debug - [yes/no] - Determines the compression of Jar and Npm
compress-- [yes/no] - Determines deprecation warnings for Jsp and Java compilation
deprecation-- [yes/no] - Determines optimization for Jsp and Java compilation
optimize-- [yes/no] - Determines verbosity of compilation messages
verbose - [0 to 9]
- Determines debugging information in generated class files
- Change the plugin specifications. They go into the manifest of NPM and Jar. Ensure you maintain consistency with install.xml and plugin.xml in the module ID.
- Execute '.\build.bat'

| The Ant Project | |
- Builds the ${plugin.name} Plugin project.
- Precompiles Jsps
- Compiles Java
- Logs compile errors to ${plugin.name.small}Compile.err
- Makes Jar
- Makes Npm
- Inserts Manifest into Jar and Npm
- Creates Javadoc linked to Source
- Deploys to Tomcat
- Copies Images for Custom classes to dev/images/dir
| Help Screen for Building ${plugin.name} Plugin for iManager | |
All compilation targets rely on the variable NPS_TOMCAT being set to the location of TOMCAT_HOME,for example: c:/imgrsdk/tomcat in 'build scripts\env.txt'.
Can be invoked from 'build scripts' directory only.
Usage: ANT_HOME\bin\ant.bat -f build.xml [target]
all = Build everything without deploying.
clean = Remove all plugin files from the staging area.
cleanDeployDir = Remove all plugin files from the deployment area.
compile = Compile all java sources.
createDeployDirs = Create the directory structure in the deployment area.
createJar = Create ${plugin.name}.jar from the compiled .class files.
createNpm = Create ${plugin.name}.npm from the contents of the staging area.
createStageDirs = Create the directory structure in the staging area.
deploy = Build everything and deploy all plugin files.
deployJars = Copy ${plugin.name}.jar to the deployment area.
deployStaticFiles = Copy all static files to the deployment area.
doc = Generate javadoc for all java sources.
precompileJSP = Precompiles jsp files to java and then compiles them to class.
stageStaticFiles = Copy all static files to the staging area.
The default target is 'createNpm'.
Downloads:
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com
