+34 934 547 873 info@wincom-plm.com

Managing a Wincom Component

Introduction

This document describes the WCom project build procedures. The concept of a Wincom Component project is to have a custom component for Windchill that can be indpendently managed. A WCom project has a unique name and is self contained, and can be installed, uninstalled and compiled as a single unit, although it may require other WCom projects to be installed first. It uses a common build procedure that is used to both compile and produce an installable jar for the target machine.

This document assumes the use of a suitable source version control system where all files are stored in a path where the base is the Windchill home directory.

Creating a new project

All projects are created under the wcom directory in the Windchill home directory (e.g. c:\ptc\windchill). There is a common ant build script that is used to compile and create a jar release.

Create the directory structure

Create the following structure for your project under the Windchill home directory:

[wt_home]/wcom/[projectname]/scripts Used to hold scripts such as install, special build etc.
[wt_home]/wcom/[projectname]/release Holds the jar files to be installed on a target server
[wt_home]/wcom/[projectname]/documentation All documentation (including javadoc)
[wt_home]/wcom/[projectname]/coverage Coverage report will be generated here
[wt_home]/wcom/[projectname]/execute Execute location for command line utils [optional]
[wt_home]/wcom/[projectname]/testing Test area [optional]
e.g.
c:/ptc/windchill/wcom/myproject/scripts
c:/ptc/windchill/wcom/myproject/release
c:/ptc/windchill/wcom/myproject/documentation
c:/ptc/windchill/wcom/myproject/coverage
c:/ptc/windchill/wcom/myproject/execute
c:/ptc/windchill/wcom/myproject/testing

Create the build properties

In the [wt_home]/wcom/[projectname]/scripts folder create a new properties file with the following entries

comp.src.path=[src path]
comp.jar.prefix=[release jar name]e.g.
comp.src.path=/com/wcom/windchill  [all sources are in c:/ptc/windchill/src/com/wcom/windchill]
comp.jar.prefix=wcomfw

If you wish to deliver the project classes as a jar file e.g all the .class files are contained in a single jar, specify the following properties

comp.jar.libjar=true
comp.jar.webinf=[webinf jar name]e.g.
comp.jar.libjar=true
comp.jar.webinf=myclasses

If you wish generate the javadoc for the source directory add the following properties

comp.javadoc=true
comp.javadoc.packagenames=[packagenames to javadoc]
comp.javadoc.excludepackagenames=[packagenames to exclude] {optional}

To deliver an coverage version of the jar file, you must first install the WComTestPack available here.

Building the project

The build is to used to compile the project files.
Execute the following command from a Windchill shell:

ant -buildfile wcom/build.xml -Dcomp=[component] build
e.g. ant -buildfile wcom/build.xml -Dcomp=myproject build

Generating JavaDoc documentation

The javadoc will be generated under the documenation directory
Execute the following command from a Windchill shell:

ant -buildfile wcom/build.xml -Dcomp=[component] javadoc
e.g.ant -buildfile wcom/build.xml -Dcomp=myproject javadoc

Building a release

The release build is to used to create a jar file to be installed on a target machine e.g. production server. This file includes all source and compiled files and all other files in the source control.Create a directory in the project dirctory call “buildarea”

[wt_home]/wcom/[projectname]/buildarea

Export from the source control system all the files to this path.

ant -buildfile wcom/build.xml -Dcomp=[component] -Dversion=[version number]release
e.g. ant -buildfile wcom/build.xml -Dcomp=myproject -Dversion=1.0 release

A release jar will be generated in the release area e.g. myproject1.0.jar which can be unjarred on the target machine

Testing with a coverage enabled version

Under the wcom/[component]/coverage is a coverage jar file. Save in a backup location the current version in codebase/WEB-IBF/lib and then add this new version.

Now restart the servers and perform your tests, then stop the servers.

Add a TOMCAT environment variable if it does not already exist e.g. set TOMCAT=c:\ptc\tomcat

Execute the following command:

ant -buildfile wcom/build.xml -Dcomp=[component] coveragereport

A coverage report will be generated in the coverage directory.

Note: Coverage is only available with comp.jar.libjar=true

To use a coverage version of the jar file, you must first install the WComTestPack

Development Principals