| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Friki example source code file (strip-dependencies.xml)

This example Friki source code file (strip-dependencies.xml) is included in the "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 strip-dependencies.xml source code

<project default="strip-dependencies">

  <property name="dest.dir" value="build/lib"/>
  <property name="temp.dir" value="build/stripped"/>
  <property name="" value="${APP}.jar"/>
  <property name="remove.root" value="true"/>

  <target name="strip-dependencies-init">
    <available property="genjar.exists" 

    <condition property="ok">
        <istrue value="${genjar.exists}"/>
        <isset property="ROOT-CLASS"/>

    <condition property="remove">
        <istrue value="${ok}"/>
        <istrue value="${remove.root}"/>

  <path id="classpath">
    <pathelement location="build/delivery/classes"/>
    <fileset dir="_ext">
      <include name="**/*.jar"/>
    <fileset dir="_lib">
      <include name="**/*.jar"/>
    <pathelement path="${java.class.path}"/>
  <target name='strip' depends="strip-dependencies-init" if="ok">
    <mkdir dir="${temp.dir}"/>
    <taskdef name="genjar" 
      classname="" classpath="${classpath}" />
    <genjar destdir="${temp.dir}">
      <classpath refid="classpath"/>
      <class name="${ROOT-CLASS}" />
  <target name='remove-root' depends="strip-dependencies-init" if="remove">
    <delete file="${temp.dir}/${ROOT-CLASS}.class"/>
  <target name='jar' depends="strip" if="ok">
    <mkdir dir="${dest.dir}"/>
    <jar destfile="${dest.dir}/${}" basedir="${temp.dir}"/>
  <target name='complain' depends="strip-dependencies-init" unless="ok">
    <echo message="Can not build stripped jar file; needs property ROOT-CLASS and class"/> 

  <target name="strip-dependencies" depends="strip, remove-root, jar, complain"/>


Other Friki examples (source code examples)

Here is a short list of links related to this Friki strip-dependencies.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,
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.