ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arthur <arthur.s....@gmail.com>
Subject how can i set javac's parameter in ant get the same bytecode as use javac in cmd????
Date Tue, 12 Aug 2008 08:53:47 GMT
hi, funs & master of ant

     i need build a baseline 1, but there nerver exists such a thing, and
the configuration system lost some files or exist but version is wrong.
     the old way in our company is use  way a, and i want to use ant as a
total-build-deploy tool.
     way a, use "*javac TextUtil.java*" or eclipse's inner build tool to
generate *.class* file , after that use *"javap* *-verbose TextUtil >
TextUitl.bc*" to get the bytecode of the class file.
      way b, use ant's javac task to build java file then generate
*.class*file , after that use
*"javap* *-verbose TextUtil > TextUitl.bc*" to get the bytecode of the
class file.
     the two bytecode files are different. as for one same java file, i want
to get the same bytecode file in both the two ways,and if there exists any
different, the bytecode files should be different also. but now i cann't get
expected bytecode files, how can i set the build.xml and javac parameter to
get what i want?


java -version 1.4.2_12
ant -version 1.6.5
Here is the build.xml file
====================================

<?xml version="1.0" encoding="UTF-8"?>
<project name="sinolife" default="javac" basedir=".">
   <target name="javac">
       <property name="build.compiler" value="javac1.4"/>
       <javac sourcepath="" srcdir="." destdir="." compiler="javac1.4"
         target="1.4"
         source="1.4"
         fork="true"
         optimize="on"
         verbose="yes"
         includeJavaRuntime="yes"
         >
        <include name="TextUtil.java"/>
      </javac>

     <echo message="javac is ok!"/>
    </target>
</project>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message