ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Abashev <aabas...@diasoft.ru>
Subject Re: Sample code for Presetdef
Date Wed, 28 Jul 2004 07:21:05 GMT
Selfanswered message :)
This is JavaScript sample code:

      preset = project.createDataType("myjavac").getPreSets();

      preset.maybeConfigure();

      task = compiler.getTask();

And now task is javac task.

Alexey Abashev wrote:

> 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
>
>
>

-- 
С уважением,
Абашев Алексей Валерьевич
Инженер-программист
Центр Банковских Технологий компании "Диасофт"
Alexey V. Abashev
Programmer
Banking Technologies Center, Diasoft
Россия, 127018, Москва, ул.Полковая д.17, стр.15
Тел (095) 780-7575 факс (095) 780-7576
E-mail: aabashev@diasoft.ru
http://www.diasoft.ru


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


Mime
View raw message