ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Abashev <aabas...@diasoft.ru>
Subject Sample code for Presetdef
Date Mon, 26 Jul 2004 12:26:36 GMT
Anybody can help me???? Where I can find API how to use presetdef tasks 
in Java or JavaScript code? This is what I've got:

<script language="javascript"> <![CDATA[
      importClass(java.io.File);

      compiler = project.createTask("javac");
      compiler.setDestdir(new 
File(project.getProperty("web.module.build.classes.dir")));

      compiler.setDebug(true);
      compiler.setDeprecation(true);

      modules = project.getReference("web.module.elements");

      for (i = modules.iterator(); i.hasNext();) {
        module = i.next();

        compiler.createSrc().setPath(module.moduleDir.absolutePath + 
"/src/java");
      }

      compiler.setIncludes("**/web/**");
      compiler.setClasspath(project.getReference("libs.class.path"));
      compiler.execute();
  ]]> </script>

But I want to change this code into usage presetdef like this:

  <presetdef name="myjavac">
      <javac classpathref="libs.class.path" debug="${compile.debug}" 
deprecation="${compile.deprecation}" optimize="${compile.optimize}"/>
   </presetdef>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message