This sample Ant script can be used in a project that contains a custom builder where you want to generate a Feature Set (.pkg) file that includes your builder(s). Included in this sample is a custom Ant task that will generate the Feature Set manifest file.
The following is a high level list of the tasks that the Ant build script performs.
- Generates the Builder Java API from the bdef (e.g. WebContent\WEB-INF\work\source\com\samples\builders\api\Example.java).
- Generates the Builder resource properties file for localizing builder strings within the bdef (e.g. WebContent\WEB-INF\work\classes\com\samples\builders\ExampleBuilderbdef.properties).
- Compiles the Builder Java source code.
- Creates a .jar file that includes the Builder classes and resource properties files (e.g. WebContent\WEB-INF\work\lib\example_package_builder.jar).
- Generates the Feature Set manifest file (e.g. ExamplePackage.bs).
- Generates the Feature Set resource property file for localization (e.g. .\ExamplePackage.properties).
- Generates the Feature Set file (e.g. dist\ExamplePackage.pkg).
To run the build script you should do the following:
- Import the feature_set_creation_sample.zip (WebSphere Portlet Factory Archive) into the Portlet Factort project that contains the Feature Set content.
- Add ant.jar to your build path. The Ant task is provided in source code form, so you will need to add the ant.jar to your project’s build path. One way to do this is to place the ant.jar in your project’s WebContent\WEB-INF\clientLibs directory. Then add the ant.jar to your Java Build Path. You can download the ant.jar from the http://ant.apache.org site.
- Open the WebContent\build_pkg.xml Ant script and edit the pr operty setting for your manifest. You may also need to adjust the file filtering based on your requirements. See the Ant help for more details (http://ant.apache.org/index.html).
- Run the build_pkg.xml Ant script by right clicking on the build_pkg.xml file and selecting Run As/Ant Script.
If successful the build will create a Feature Set pkg file in the project's root "dist" directory. You will have to manually refresh your project view to see the Feature Set file within the Eclipse.
To see the new Feature Set in the Designer you must add it to the Designer's Packages directory (e.g. Designer\FeatureSets\Web-App_6.x.x\Packages).