Newsgroup: it.comp.java
Titolo: Problemi compilazione con ant che richiama javac 2 la vendetta

Io ho provato a leggere il manuale di ant ma non ci ho capito una H! Io ant
lo devo usare solo per compilare questo schifo di programma non so nulla di
ant. Io devo semplicemente fare in modo che quando viene richiamato javac,
venga eseguito javac -deprecation. Sono andato a leggere ma non ci capisco
nulla ci sono una lunga serie di tag e non capisco deve debbano essere
inseriti. Quando compilo il programma che mi serve con ant io digito questo
da linea di comando:
ant j2se rebuil.
Quando digito questo viene richiamato il file build.xml. Io non so com'è
combinato il programma che devo compilare perchè è organizzato veramente
male.
Dato che viene richiamato subito build.xml ho aperto questo file ed ho
provato ad aggiungere questo tag:
  <property name="javac.deprecation" value="on"/>
Hoi provato ma non serve a nulla, io devo necessariamente compilare questo
schifo di programma con ant perchè mi serve per una tesina.
Qua ho inserito tutto il file build.xml ma oltre questo non so qualcuno può
dirmi qualcosa, perchè a me il manuale di ant sembra un misto tra arabo e
israeliano con sfumature di aramaico.
Grazie.
<?xml version="1.0" encoding="UTF-8"?>
<project name="JADE-LEAP" default="complete" basedir=".">
 <!-- PROPERTIES -->
  <property environment="env"/>
  <property file="buildLEAP.properties"/>
  <property name="java-home" value="${env.JAVA_HOME}"/>
  <property name="root"      value="."/>
  <property name="jade-home" value="../.."/>
  <property name="javac.optimize" value="on"/>
  <property name="javac.debug" value="off"/>
  <property name="javac.deprecation" value="on"/>
 <property name="buildfiles" value="${root}/resources/build"/>
 <!-- JAVA classes -->
 <property name="boot-java-classes" value="${java-home}/jre/lib/rt.jar"/>
 <property name="boot-java-1.1-classes"
value="${java-1.1-home}/lib/classes.zip"/>
 <property name="boot-midp-classes"
value="${j2me-wtk-home}/lib/midpapi.zip"/>
 <!-- Directories -->
 <property name="jade-src" value="${jade-home}/src"/>
 <property name="leap-src" value="${root}/src"/>
 <property name="j2se-root" value="${root}/j2se"/>
 <property name="pjava-root" value="${root}/pjava"/>
 <property name="midp-root" value="${root}/midp"/>
 <property name="dotnet-root" value="${root}/dotnet"/>
 <property name="tmp" value="${root}/tmp"/>
 <property name="dist" value="${jade-home}"/>
 <!-- Javadoc Header and Footer -->
 <property name="title" value="JADE-LEAP"/>
 <property name="version" value="3.1"/>
 <property name="javadoc-footer" value="&lt;center>&lt;i>&lt;a
href=&quot;
http://leap.crm-paris.com
&quot; target=top>The LEAP
Project&lt;/a>&lt;/i>&lt;/center>"/>
 <!-- Properties for compiling the demo -->
 <property name="demo" value="${root}/demo"/>
 <property name="demo-src" value="${demo}/src"/>
 <property name="demo-preprocessed" value="${tmp}/demo/preprocessed"/>
 <property name="demo-unverified" value="${tmp}/demo/unverified"/>
 <property name="demo-classes" value="${tmp}/demo/classes"/>
 <!-- Additional ANT tasks definition -->
 <!-- Preprocessor -->
 <taskdef name = "pproc"    classname="leapTools.Preprocessor">
  <classpath path ="resources/antTasks/leapTools.jar"/>
 </taskdef>
 <!-- Minimizer -->
 <taskdef name = "minimize"    classname="leapTools.Minimizer">
  <classpath path ="resources/antTasks/leapTools.jar"/>
 </taskdef>
 <!-- Preverifier -->
 <taskdef  name="preverify"
classname="com.stampysoft.ant.j2me.PreverifyTask">
   <classpath path ="resources/antTasks/StampysoftAntTasks.jar" />
 </taskdef>
  <property name="j2mewtk.home" value="${j2me-wtk-home}"/>
 <!-- TARGETS -->
 <!-- ******** JAVA ENVIRONMENTS ********* -->
 <!-- J2SE -->
 <target name = "j2se"
         description = "Set the j2se property --> j2se.xml will be called">
  <property name = "j2se"  value = "true"/>
 </target>
 <!-- PJAVA (java-1.1-home must be set) -->
 <target name = "pjava" depends = "pjava-do, pjava-dont"
         description = "Set the pjava property --> pjava.xml will be called
(unless java-1.1-home is not set)"/>
 <target name = "pjava-do" if = "java-1.1-home">
  <property name = "pjava"  value = "true"/>
 </target>
 <target name = "pjava-dont" unless = "java-1.1-home">
  <echo> WARNING: 'java-1.1-home' not specified in buildLEAP.properties.
Skipping pjava build.</echo>
 </target>
 <!-- MIDP (j2me-wtk-home must be set) -->
 <target name = "midp" depends = "midp-do, midp-dont"
         description = "Set the midp property --> midp.xml will be called
(unless j2me-wtk-home is not set)"/>
 <target name = "midp-do" if = "j2me-wtk-home">
  <property name = "midp"  value = "true"/>
 </target>
 <target name = "midp-dont" unless = "j2me-wtk-home">
  <echo> WARNING: 'j2me-wtk-home' not specified in buildLEAP.properties.
Skipping midp build.</echo>
 </target>
 <!-- ALL -->
 <target name = "all" depends = "j2se, pjava, midp"
         description = "Set the property for all environments"/>
 <!-- ******* ACTIONS that can be specified for the above java environments
******** -->
 <!-- INIT the whole -->
 <target name="init"
         description="Set time stamp">
   <tstamp/>
  <mkdir dir="${tmp}"/>
 </target>
 <!-- SETUP the build environment for the selected java environments -->
 <target name="setup" depends="init, setup-j2se, setup-pjava, setup-midp"
         description="Setup the build environment using the appropriate
{environment}.xml file"/>
 <target name="setup-j2se" if="j2se">
  <ant antfile="${buildfiles}/j2se.xml" target="do-setup" dir="."/>
 </target>
 <target name="setup-pjava" if="pjava">
  <ant antfile="${buildfiles}/pjava.xml" target="do-setup" dir="."/>
 </target>
 <target name="setup-midp" if="midp">
  <ant antfile="${buildfiles}/midp.xml" target="do-setup" dir="."/>
 </target>
 <!-- RESET the jade-leap directory structure for the selected java
environments -->
 <target name="reset" depends="init, reset-j2se, reset-pjava, reset-midp"
         description="Reset the directory structure using the appropriate
{environment}.xml file"/>
 <target name="reset-j2se" if="j2se">
  <ant antfile="${buildfiles}/j2se.xml" target="do-reset" dir="."/>
 </target>
 <target name="reset-pjava" if="pjava">
  <ant antfile="${buildfiles}/pjava.xml" target="do-reset" dir="."/>
 </target>
 <target name="reset-midp" if="midp">
  <ant antfile="${buildfiles}/midp.xml" target="do-reset" dir="."/>
 </target>
 <!-- CLEAN class files for the selected java environments -->
 <target name="clean" depends="init, clean-j2se, clean-pjava, clean-midp"
         description="Clean class files using the appropriate
{environment}.xml file"/>
 <target name="clean-j2se" if="j2se">
  <ant antfile="${buildfiles}/j2se.xml" target="do-clean" dir="."/>
 </target>
 <target name="clean-pjava" if="pjava">
  <ant antfile="${buildfiles}/pjava.xml" target="do-clean" dir="."/>
 </target>
 <target name="clean-midp" if="midp">
  <ant antfile="${buildfiles}/midp.xml" target="do-clean" dir="."/>
 </target>
 <!-- Generate ACL and SL PARSERS from jj files for the selected java
environments
      Note that there are no parsers in midp -->
 <target name="parsers" depends="init, parsers-j2se, parsers-pjava"
         description="Generate parsers using the appropriate
{environment}.xml file"/>
 <target name="parsers-j2se" if="j2se">
  <ant antfile="${buildfiles}/j2se.xml" target="do-parsers" dir="."/>
 </target>
 <target name="parsers-pjava" if="pjava">
  <ant antfile="${buildfiles}/pjava.xml" target="do-parsers" dir="."/>
 </target>
 <!-- COMPILE jade-leap for the selected java environments -->
 <target name="compile" depends="init, compile-j2se, compile-pjava,
compile-midp"
         description="Compile using the appropriate {environment}.xml
file"/>
 <target name="compile-j2se" if="j2se">
  <ant antfile="${buildfiles}/j2se.xml" target="do-compile" dir="."/>
 </target>
 <target name="compile-pjava" if="pjava">
  <ant antfile="${buildfiles}/pjava.xml" target="do-compile" dir="."/>
 </target>
 <target name="compile-midp" if="midp">
  <ant antfile="${buildfiles}/midp.xml" target="do-compile" dir="."/>
 </target>
  <!-- Create jade-leap LIBRARY (jar files) for the selected java
environments -->
 <target name="lib" depends="init, lib-j2se, lib-pjava, lib-midp"
         description="Jar using the appropriate {environment}.xml file"/>
 <target name="lib-j2se" if="j2se">
  <ant antfile="${buildfiles}/j2se.xml" target="do-lib" dir="."/>
 </target>
 <target name="lib-pjava" if="pjava">
  <ant antfile="${buildfiles}/pjava.xml" target="do-lib" dir="."/>
 </target>
 <target name="lib-midp" if="midp">
  <ant antfile="${buildfiles}/midp.xml" target="do-lib" dir="."/>
 </target>
 <!-- Generate JAVADOC for the selected java environments -->
 <target name="javadoc" depends="init, javadoc-j2se, javadoc-pjava,
javadoc-midp"
         description="JavaDoc using the appropriate {environment}.xml
file"/>
 <target name="javadoc-j2se" if="j2se">
  <ant antfile="${buildfiles}/j2se.xml" target="do-javadoc" dir="."/>
 </target>
 <target name="javadoc-pjava" if="pjava">
  <ant antfile="${buildfiles}/pjava.xml" target="do-javadoc" dir="."/>
 </target>
 <target name="javadoc-midp" if="midp">
  <ant antfile="${buildfiles}/midp.xml" target="do-javadoc" dir="."/>
 </target>
 <!-- Generate filtered JAVADOC -->
 <target name="apidoc" depends="init"
         description="Generate filtered JavaDoc">
  <ant antfile="${buildfiles}/j2se.xml" target="do-apidoc" dir="."/>
 </target>
 <!-- ******** The COMPLETE build process ********* -->
 <target name="rebuild" depends="reset, lib"
         description="Rebuild from scratch using the appropriate
{environment}.xml file"/>
 <target name="complete" depends="all, rebuild, javadoc"
         description = "Build everything"/>
 <!-- ******** The DEMO ********* -->
 <target name="demo" depends="init, demo-j2se, demo-pjava, demo-midp"
         description="Build the demo using the appropriate {environment}.xml
file"/>
 <target name="demo-j2se" if="j2se">
  <ant antfile="${buildfiles}/j2se.xml" target="do-demo" dir="."/>
 </target>
 <target name="demo-pjava" if="pjava">
  <ant antfile="${buildfiles}/pjava.xml" target="do-demo" dir="."/>
 </target>
 <target name="demo-midp" if="midp">
  <ant antfile="${buildfiles}/midp.xml" target="do-demo" dir="."/>
 </target>
 <!-- ******** JADE-LEAP distribution targets ********* -->
 <!-- Create the JADE-LEAP distribution zip files -->
 <target name="dist" depends="init"
         description="Create the LEAP distribution file">
  <delete file="${dist}/LeapAddon.zip" quiet="true"/>
    <jar jarfile="${dist}/LeapAddon.zip" basedir="${dist}">
     <include name="add-ons/leap/License"/>
     <include name="add-ons/leap/COPYING"/>
     <include name="add-ons/leap/README.txt"/>
     <include name="add-ons/leap/buildLEAP.properties"/>
     <include name="add-ons/leap/build.xml"/>
     <include name="add-ons/leap/LEAPUserGuide.pdf"/>
     <include name="add-ons/leap/demo/*.bat"/>
     <include name="add-ons/leap/demo/demo.dlc"/>
     <include name="add-ons/leap/demo/demo.jad"/>
     <include name="add-ons/leap/demo/demo.manifest"/>
     <include name="add-ons/leap/demo/src/**"/>
     <include name="add-ons/leap/resources/**"/>
     <include name="add-ons/leap/src/**"/>
    </jar>
 </target>
 <!-- Create the JADE-LEAP snapshot zip files -->
 <target name="snapshot"
         description="Create the LEAP snapshot file">
  <echo> To be implemented </echo>
 </target>
 <!-- ******** LEAP ant tasks ******** -->
 <target name = "leapTools">
  <mkdir dir="${tmp}/leapTools"/>
   <javac srcdir  = "resources/src"
          destdir = "${tmp}/leapTools"/>
  <delete file="resources/antTasks/leapTools.jar" quiet="true"/>
   <jar jarfile = "resources/antTasks/leapTools.jar"
        basedir = "${tmp}/leapTools"/>
   <delete dir = "${tmp}/leapTools"/>
  </target>
 <!-- ******** JADE-LEAP for Microsoft .NET (experimental) ******** -->
 <!-- The VJSHARPTOOLS environment variable must be set -->
 <target name = "dotnet" depends = "init, dotnet-do, dotnet-dont"
         description = "Compile Jade-leap for .NET by calling dotnet.xml
(unless The VJSHARPTOOLS environment variable is not set)"/>
 <target name = "dotnet-do" if = "env.VJSHARPTOOLS">
  <ant antfile="${buildfiles}/dotnet.xml" target="do-compile" dir="."/>
 </target>
 <target name = "dotnet-dont" unless = "env.VJSHARPTOOLS">
  <echo> WARNING: 'VJSHARPTOOLS' environment variable not set. Skipping
dotnet build.</echo>
 </target>
 <target name = "dotnetreset" depends = "init"
         description = "Reset the environment for dotnet compilation">
  <ant antfile="${buildfiles}/dotnet.xml" target="do-reset" dir="."/>
 </target>
 <!-- ******** Minimize a jar file ******** -->
  <target name = "minimize" description = "" depends = "init">
   <basename property="name" file="${JAR}" suffix=".jar"/>
   <dirname property="dir" file="${JAR}"/>
   <property name="base" value="${dir}/${name}"/>
   <!-- Where to find the .dlc file (same as the jar unless specified) -->
   <condition property="dlcfile" value="${DLC}">
    <isset property="DLC"/>
   </condition>
   <condition property="dlcfile" value="${base}.dlc">
    <not>
     <isset property="DLC"/>
    </not>
   </condition>
   <!-- Detect all classes that are referenced starting from the .dlc
file -->
  <java classname="leapTools.Package" fork="true">
   <classpath>
    <pathelement location="resources\antTasks\packagingtool.jar"/>
    <pathelement location="${boot-midp-classes}"/>
    <pathelement location="${JAR}"/>
   </classpath>
   <arg line="-d ${base}-tmp.jar -f ${dlcfile} -e -s"/>
  </java>
  <mkdir dir="${tmp}/t1"/>
  <mkdir dir="${tmp}/t2"/>
  <unzip src="${JAR}" dest="${tmp}/t1"/>
  <unzip src="${base}-tmp.jar" dest="${tmp}/t2"/>
  <!-- Remove from t1 all .class files that are not in t2 -->
  <minimize basedir="${tmp}/t1" checkdir="${tmp}/t2" verbose="true"/>
   <!-- Where to find the manifest (from the jar unless specified) -->
   <condition property="manifest" value="${MANIFEST}">
    <isset property="MANIFEST"/>
   </condition>
   <condition property="manifest" value="${tmp}/t1/meta-inf/Manifest.mf">
    <not>
     <isset property="MANIFEST"/>
    </not>
   </condition>
   <echo> ${manifest} </echo>
  <!-- Produce the minimized jar -->
  <delete file="${base}-min.jar" quiet="true"/>
   <jar jarfile="${base}-min.jar" basedir="${tmp}/t1"
manifest="${manifest}"/>
   <!-- Delete temp files and directories -->
   <delete file="${base}-tmp.jar" quiet="true"/>
   <delete dir="${tmp}/t1"/>
   <delete dir="${tmp}/t2"/>
 </target>
</project>

 venga eseguito javac -deprecation. 
Nel tag javac aggiungi deprecation="on", o se vuoi fare il sottile visto 
che hai aggiunto la proprietà puoi fare deprecation="${javac.deprecation}".
Pensavo che postarti un link fino alla documentazione del task javac 
fosse sufficiente, non lo è stato.