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 08:11:55 GMT
Last line
task = preset.getTask();

Alexey Abashev wrote:

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

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


Mime
View raw message