Reference ant.project.name : Properties « 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 » Ant » PropertiesScreenshots 
Reference ant.project.name
 
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="build" name="Agnotion">
    <property name="JUNIT_HOME" value="eclipse/plugins/org.junit_3.8.1"/>
    <path id="project.classpath">
        <pathelement location="build/java"/>
        <pathelement location="build/test"/>
        <pathelement location="${JUNIT_HOME}/junit.jar"/>
    </path>

    <target name="init">
        <mkdir dir="build/test"/>
        <mkdir dir="build/java"/>
      <mkdir dir="dist"/>
    </target>

    <target name="clean">
        <delete dir="build/test"/>
        <delete dir="build/java"/>
        <delete dir="dist"/>
    </target>

    <target depends="init" name="build">
        <javac destdir="build/java">
            <src path="src/java"/>
            <classpath refid="project.classpath"/>
        </javac>
        <javac destdir="build/test">
            <src path="src/test"/>
            <classpath refid="project.classpath"/>
        </javac>
    </target>

  <target name="dist" depends="build">
    <jar destfile="dist/${ant.project.name}.jar"
      basedir="build/java" />

  </target>
</project>

   
  
Related examples in the same category
1.Value in the properties file overwrite the value in the build.xml
2.Redefine property in the children target
3.Redefine property in the children target 2
4.Load file through URL
5.Referrence property: basedir
6.Custom properties
7.Define custom property based on existing properties
8.Ant buildin properties
9.Separate two values
10.In init target set the properties
11.Define and reference property
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.