Xvcl Pages; Rpm Cjos Release Frame; [ Cjos Audience]
Summary
An open source x-framework for creating an RPM distribution of an open source Java project. The "Release Frame" project is part of the CjOS Project at sourceforge.net.
Given an XML description of a project, the x-framework generates Ant scripts to build a binary edition, source edition, source RPM and target RPMs (-ant, -javadoc, -joste, -websource).
Our goal is to provide a self-contained engine for a distributor. Would you like to distribute your open source Java project with RPM? We distribute "Release Frame" with Release Frame.
Release Frame runs on Linux because RPM runs on Linux. On Windows, it builds only a binary edition (ZIP) and a source edition (ZIP).
Goal
Provide this x-framework as a resource inside cjos-releaseframe.jar.
Requires
- Java Software Development Kit (JSDK). Version 1.4 is recommended.
- Apache Ant. Version 1.6 is recommended.
- XVCL Processor 2.07 (1h) ( Xvcl Pages)
- jdom.jar
- URL To Smart API Bridge ( Url To Smart Api Bridge)
- XML Bind ( Xml Bind)
Using Release Frame
In this section, we describe how to use the Release Frame.
Generates Ant scripts
This x-framework generates a tree of Ant scripts.
A generated Ant script
- creates a ZIP-compatible source archive,
- uncompresses the source archive,
- invokes the Ant script to build dependencies,
- invokes an Ant script to build product from its source code,
- invokes an Ant script to create a ZIP-compatible binary archive, and
- invokes an Ant script to build an RPM.
Distribution document
A distribution document contains the specification for each product and its dependencies.
----- distribution.xml -----
<?xml version="1.0"?>
<model release.major="1">
<product name="demo">
<dir name="demo">
<include name="**"/>
</dir>
</product>
</model>
Tags and attributes:
- model - Represents a distribution.
- distribution.name - Short name of distribution.
- distribution.description - Description of distribution.
- version.major - Optional. Default is 1.
- version.minor - Optional. Default is 0.
- release.major - Required.
- product - Represents a product.
- name - Short name of product.
- summary - Summary implemented by RPM.
- description - Description implemented by RPM.
- release.minor - Optional. Default is 1.
- depends - Comma-delimited list of dependencies on other products in this distribution.
- jar-depends-free - Comma-delimited list of precompiled jar dependencies.
- include-ant-runtime="true" - Includes Ant runtime when compiling a product.
- dir - Represents a directory.
- name - Name of directory, relative to ${site.dir}.
- include - Represents a matching pattern.
- name - Fileset pattern implemented by Ant for Java source code and resources.
Reference:
Ant script
An Ant script is used to invoke the XVCL Processor.
----- build.xml -----
<?xml version="1.0"?>
<project name="release-1.0-34" basedir="." default="build">
<target name="init">
<tstamp/>
<echo message="${basedir}"/>
</target>
<target name="clean">
<delete dir="build" failonerror="false"/>
</target>
<target name="taskdef" depends="init">
<taskdef name="xvcl" classname="gchii.tools.xvcl.XVCLAntTask"/>
</target>
<target name="xvcl" depends="clean,taskdef">
<property name="product" value="cjos-releaseframe"/>
<property name="xml" location="distribution.xml"/>
<xvcl
spc="spc.xvcl"
projectPath="."
beautifyOutput="true"
failonerror="true"
includeTraceInfo="false"
verbose="false">
<set var="xvcl.date" value="${DSTAMP}"/>
<set var="site.dir" value="${site.dir}"/>
<set var="product" value="${product}"/>
<set var="xml" value="file:${xml}"/>
<set var="description-default" value="${description-default}"/>
</xvcl>
</target>
<target name="build" depends="xvcl"/>
</project>
Reference:
Specification
A specification file (SPC) invokes the x-framework as a resource inside cjos-releaseframe.jar.
----- spc.xvcl -----
<?xml version="1.0"?>
<!DOCTYPE x-frame SYSTEM "default">
<x-frame name="spc.xvcl" outdir="build" outfile="spc.txt">
<adapt x-frame="x-resource:/releaseframe-1.0-34/spc.xvcl"/>
</x-frame>
Reference:
Running Ant script
To create n.jar
$ ant -Dproduct=n
Result:
- The Ant script (above) uses the XVCL Processor to generate Ant scripts for a product.
- build/product/build.xml
- build/product/n-1.2-3.0/build.xml
- build/product/n-1.2-3.0/build/n-1.2-3.0/build.xml
- build/product/n-1.2-3.0/build/n-1.2-3.0/module/script/build.xml
- build/product/n-1.2-3.0/build/n-1.2-3.0/module/n/build.xml
- The Ant script (above) invokes build/product/build.xml.
- The build/product/build.xml script invokes n-1.2-3.0/build.xml.
- n-1.2-3.0/build.xml creates a source distribution.
- n-1.2-3.0/build.xml unzip a source distribution.
- n-1.2-3.0/build.xml invokes build/n-1.2-3.0/build.xml.
- build/n-1.2-3.0/build.xml compiles the source code and creates n.jar.
To create n RPM
$ ant -Dproduct=n build-all
Result:
- The Ant script (above) generates an RPM specification.
- It invokes build/product/n-1.2-3.0/build.xml.
- build/product/n-1.2-3.0/build.xml invokes rpmbuild/build.xml to create target RPMs.
See also
Developing Release Frame
Details
CVS Module : eclipse/releaseframe-eclipse
IDE : Eclipse 3.1
Articles
- Release Frame And Xvcl Project
|