Novell Home

Building iManager plugins with Ant

Novell Cool Solutions: Feature
By R Sathish

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
  1. Make work area modifiable.


  2. Realign your workarea so that it matches the recommended structure.
    GREEN is workarea directory.
    RED is Ant build created directory.




  3. Create 'build scripts' directory.


  4. 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.

  1. Change NPS_TOMCAT to your TOMCAT_HOME. Kindly use '/'.


  2. Change other settings as required.
    1. Determines debugging information in generated class files
            debug - [yes/no]
    2. Determines the compression of Jar and Npm
            compress-- [yes/no]
    3. Determines deprecation warnings for Jsp and Java compilation
            deprecation-- [yes/no]
    4. Determines optimization for Jsp and Java compilation
            optimize-- [yes/no]
    5. Determines verbosity of compilation messages
            verbose - [0 to 9]

  3. 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.




  4. Execute '.\build.bat'
The Ant Project
  1. Builds the ${plugin.name} Plugin project.


  2. Precompiles Jsps


  3. Compiles Java


  4. Logs compile errors to ${plugin.name.small}Compile.err


  5. Makes Jar


  6. Makes Npm


  7. Inserts Manifest into Jar and Npm


  8. Creates Javadoc linked to Source


  9. Deploys to Tomcat


  10. 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

Novell® Making IT Work As One

© 2008 Novell, Inc. All Rights Reserved.