Sigo con la misma pregunta. Como compilar un solo archivo?
Cita: <?xml version="1.0"?>
<project name="SwingBasico" default="dist" basedir=".">
<!-- set global properties for this build -->
<!-- name of this package - typically the same as the project build -->
<property name="package" value="${ant.project.name}" /> <!-- name of the plugin.jar file -->
<!-- set this to your name/handle/avatar -->
<property name="author" value="Mayid" />
<!-- you won't normally need to change any of these -->
<property name="src" value="src" />
<property name="build" value="build" />
<property name="dist" value="jar" />
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" classpath="${aoijar}" debug="on" target="1.5" source="1.5" includeantruntime="false" />
</target>
<target name="dist" depends="compile">
<!-- create the jar file -->
<jar jarfile="${dist}/${package}.jar" basedir="${build}" >
<fileset dir="${src}" />
<!-- <filename name="${ant.project.name}.java"/><filename name="**/*${ant.project.name}*" negate="true"/>-->
</jar>
</target>
<target name="clean">
<!-- Delete the ${build} and ${docs} directory trees -->
<delete dir="${build}" />
</target>
</project>
Intento con estas variantes pero no funcionan!
Cita: <fileset dir="${src}" >
<contains text="${ant.project.name}" casesensitive="no"/>
</fileset>
Cita: <filename name="${build}/${ant.project.name}.java"/>