More than one filesets for jar : Jar « Ant « Java

Home
Java
1.2D Graphics GUI
2.3D
3.Advanced Graphics
4.Ant
5.Apache Common
6.Chart
7.Class
8.Collections Data Structure
9.Data Type
10.Database SQL JDBC
11.Design Pattern
12.Development Class
13.EJB3
14.Email
15.Event
16.File Input Output
17.Game
18.Generics
19.GWT
20.Hibernate
21.I18N
22.J2EE
23.J2ME
24.JDK 6
25.JNDI LDAP
26.JPA
27.JSP
28.JSTL
29.Language Basics
30.Network Protocol
31.PDF RTF
32.Reflection
33.Regular Expressions
34.Scripting
35.Security
36.Servlets
37.Spring
38.Swing Components
39.Swing JFC
40.SWT JFace Eclipse
41.Threads
42.Tiny Application
43.Velocity
44.Web Services SOA
45.XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
SCJP
Java » Ant » JarScreenshots 
More than one filesets for jar
 

<!--
  About this file (build.xml):

  Last modified 2001-11-30
  Author        Matthias Beil
  Contributor   Guillaume Desnoix
  License       GNU General Public License (GPL2)
                Copyright (c2001 Matthias Beil
                All rights reserved.
-->

<!--  -->

<project name="alma" default="main" basedir="." >


<!--  -->
<!-- Set up application values -->

<property name="app.name"    value="alma" />
<property name="app.package" value="com/memoire" />
<property name="app.version" value="0.36" />
<property name="app.year"    value="2001" />


<!--  -->
<!-- directory locations -->

<property name="dir.classes"        location="classes" />
<property name="dir.dist"           location="dist" />

<property name="dir.javadocs"       location="docs" />
<property name="dir.project"        location="." />
<property name="dir.src"            location="." />

<property name="dir.package" value="com/memoire" />

<!-- debug setting -->
<property name="debug" value="on"/>

<!-- javadoc package -->
<property name="packages" value="com.memoire.*"/>


<!--  -->
<!-- Show System JVM -->

<target name="showsystem" >
   <!-- might not work!? -->
   <showsystem />
</target>



<!-- Create necessary directories -->

<target name="prepare">
   <tstamp />

   <mkdir dir="${dir.classes}" />
   <mkdir dir="${dir.dist}" />

</target>



<!-- Compiles the java source files -->

<target name="compile" depends="prepare">

   <javac
      srcdir="${dir.src}"
      destdir="${dir.classes}"
      classpath="${dir.src}"
      debug="${debug}"
      failonerror="no" >

      <include name="com/memoire/acme/Acme*.java"/>
      <include name="com/memoire/re/RE*.java"/>
      <include name="com/memoire/mst/Mst*.java"/>
      <include name="com/memoire/pbc/Pbc*.java"/>
      <include name="com/memoire/fu/Fu*.java"/>
      <include name="com/memoire/dnd/Dnd*.java"/>
      <include name="com/memoire/xml/Xml*.java"/>
      <include name="com/memoire/yapod/Yapod*.java"/>
      <include name="com/memoire/bu/Bu*.java"/>
      <include name="com/memoire/dja/Dja*.java"/>
      <include name="com/memoire/agl/Agl*.java"/>
      <include name="com/memoire/alma/Alma*.java"/>
      <include name="com/memoire/jedit/JEdit*.java"/>
      <include name="com/memoire/editor/Editor*.java"/>
      <include name="com/memoire/foo/Foo*.java"/>
      <include name="com/memoire/silk/Silk*.java"/>
      <include name="com/memoire/script/Script*.java"/>

      <exclude name="com/memoire/ant/*.java"/>
      <exclude name="com/memoire/editor/EditorJext.java"/>
      <exclude name="com/memoire/script/ScriptInterpreterBeanshell.java"/>
      <exclude name="com/memoire/script/ScriptInterpreterDawn.java"/>
      <exclude name="com/memoire/script/ScriptInterpreterFiji.java"/>
      <exclude name="com/memoire/script/ScriptInterpreterFoo.java"/>
      <exclude name="com/memoire/script/ScriptInterpreterPnuts.java"/>
      <exclude name="com/memoire/script/ScriptInterpreterPython.java"/>
      <exclude name="com/memoire/script/ScriptInterpreterRhino.java"/>
      <exclude name="com/memoire/script/ScriptInterpreterRuby.java"/>

   </javac>

</target>



<!-- Creates the jar file for distribution -->

<target name="dist" depends="compile">

   <jar jarfile="${dir.dist}/${app.name}.jar"
        manifest="manifest-alma.txt" >
      <fileset dir="${dir.classes}" >
         <patternset>
            <exclude name="**/dependency cache"/>
         </patternset>
      </fileset>
      <fileset dir="${dir.src}" >
         <patternset>
            <include name="**/*.dja"/>
            <include name="**/*.foo"/>
            <include name="**/*.gif"/>
            <include name="**/*.txt"/>
         </patternset>
      </fileset>

   </jar>

</target>



<!-- Compile and build a distribution -->

<target name="main" depends="compile, dist" >

   <echo>Alma application package created</echo>

</target>



<!-- Create the API documentation -->

<target name="javadocs" depends="prepare">
   <mkdir dir="${dir.javadocs}"/>

   <javadoc packagenames="${packages}"
            sourcepath="${dir.src}"
            destdir="${dir.javadocs}"
            classpath="${dir.src}"
            author="true"
            version="true"
            use="true"
            windowtitle="${app.name} API"
            doctitle="&lt;h1&gt;${app.name}&lt;/h1&gt;"
   />

</target>



<!-- Deletes the build and dist directories -->

<target name="clean" >

   <delete dir="${dir.dist}" />
   <delete dir="${dir.classes}" />

</target>




<target name="all" depends="clean,main,javadocs" >

   <echo>Alma application package cleaned and created</echo>

</target>



<!-- run application -->

<target name="app-run" depends="main" >
   <java classname="com.memoire.alma.Alma"
      classpath="${dir.dist}/${app.name}.jar"
      fork="yes">
   </java>
</target>

<target name="run-alma" depends="main" >
   <java classname="com.memoire.alma.Alma"
      classpath="${dir.dist}/${app.name}.jar"
      fork="yes">
   </java>
</target>

<target name="run-dja" depends="main" >
   <java classname="com.memoire.dja.Dja"
      classpath="${dir.dist}/${app.name}.jar"
      fork="yes">
   </java>
</target>

<target name="run-agl" depends="main" >
   <java classname="com.memoire.agl.Agl"
      classpath="${dir.dist}/${app.name}.jar"
      fork="no">
   </java>
</target>

<target name="run-foo" depends="main" >
   <java classname="com.memoire.foo.Foo"
      classpath="${dir.dist}/${app.name}.jar"
      fork="no">
   </java>
</target>

<target name="run-reformatage" depends="main" >
   <java classname="com.memoire.agl.AglOutilReformatage"
      classpath="${dir.dist}/${app.name}.jar"
      fork="no">
   </java>
</target>

<target name="run-coloration" depends="main" >
   <java classname="com.memoire.agl.AglOutilColoration"
      classpath="${dir.dist}/${app.name}.jar"
      fork="no">
   </java>
</target>


</project>

   
  
Related examples in the same category
1.Ant task: jar
2.Jar with includes and excludes using filesets
3.Jar with includes and excludes
4.Generates java2s.jar
5.Ant jar file setting the Main-Class
6.Jar file with fileset and exclude
7.Jar file: exclude files
8.Add attribute to jar file manifest
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.