alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Friki example source code file (build-stripped-jar.xml)

This example Friki source code file (build-stripped-jar.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Friki tags/keywords

app, app, can, can, root-class, root-class

The Friki build-stripped-jar.xml source code

<project default="build-stripped-jar">

  <property name="dest.dir" value="build/lib"/>
  <property name="jarfile.name" value="${APP}.jar"/>

  <target name="init">
    <available property="genjar.exists" 
      classname="org.apache.tools.ant.taskdefs.optional.genjar.GenJar"/>
    <condition property="ok">
      <and>
        <istrue value="${genjar.exists}"/>
        <isset property="ROOT-CLASS"/>
      </and>
    </condition>
    
  </target>

  <path id="classpath">
    <pathelement location="build/delivery/classes"/>
    <fileset dir="_ext">
      <include name="**/*.jar"/>
    </fileset>
    <fileset dir="_lib">
      <include name="**/*.jar"/>
    </fileset>
    <pathelement path="${java.class.path}"/>
  </path>
  
  <target name='genjar' depends="init" if="ok">
    <mkdir dir="${dest.dir}"/>
    <taskdef name="genjar" 
      classname="org.apache.tools.ant.taskdefs.optional.genjar.GenJar" classpath="${classpath}" />
    <genjar jarfile="${dest.dir}/${jarfile.name}">
      <classpath refid="classpath"/>
      <class name="${ROOT-CLASS}" />
      <manifest generateEntryAttributes='no' />
    </genjar>
  </target>
  
  <target name='complain' depends="init" unless="ok">
    <echo message="Can not build stripped jar file; needs property ROOT-CLASS and class org.apache.tools.ant.taskdefs.optional.genjar.GenJar"/> 
  </target>

  <target name="build-stripped-jar" depends="genjar, complain"/>

</project>

Other Friki examples (source code examples)

Here is a short list of links related to this Friki build-stripped-jar.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.