You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2021/01/01 13:36:59 UTC

Re: Can I load a project from a String / InputStream?

On 2020-12-31, Eugen Stan wrote:

> Thanks but I want/need to build the xml file dynamically and build the
> project from that and then maybe customize it.I think this feature
> should make it easier to test ant as well. Would this be ok for a
> PR?Add a parse function in ProjectHelper similar to the file api?

Note that ProjectHelper2 already supports Ant's own Resource abstraction
in a limited way - it supports it if the Resource can provide a File or
an URL.

If you want to start supporting InputStreams in addition then I'd
suggest you change the code in a way that works for arbitrary Resoures
(as they all provide InputStreams).

Stefan

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


Re: AW: Can I load a project from a String / InputStream?

Posted by Eugen Stan <eu...@netdava.com>.
Hi,

Thank you all for the feedback.

I wrote some code to register a custom java.net.URLConnection 
URLStreamHandler and stream the contents from memory however.

However I don't think I can avoid making a custom ProjectHelper.
I've noticed that I can't add instances to configure an ant project.

The only way it works as far as I know is if I supply class names that 
and can load and
instantiate via reflection.

Can I supply task instances to an ant project?

TLDR

My goal is to integrate clojure with ant so I can call clojure functions 
as ant tasks.

The ideal way to handle this would be if I can supply an instance of a 
function (Callable/Runnable/AntTask).

That way I can avoid having to generate java sources from clojure 
(clojure can ship sources and compile on the fly).


As I write this email I believe I will have to write a clojure ant task 
that has to do this.

But other ideas/feedback is welcomed.


Regards,
-- 
Eugen Stan
+40720 898 747 / netdava.com


AW: Can I load a project from a String / InputStream?

Posted by ap...@materne.de.
Maybe Stefans 11 years old "JavaFront" could be helpful. 
https://svn.apache.org/viewvc/ant/sandbox/javafront/
The "taskexec.*" scripts shows how to use
https://svn.apache.org/viewvc/ant/sandbox/javafront/taskexec.bat?view=markup
https://svn.apache.org/viewvc/ant/sandbox/javafront/taskexec.sh?view=markup



-----Ursprüngliche Nachricht-----
Von: Stefan Bodewig <bo...@apache.org> 
Gesendet: Freitag, 1. Januar 2021 14:37
An: user@ant.apache.org
Betreff: Re: Can I load a project from a String / InputStream?

On 2020-12-31, Eugen Stan wrote:

> Thanks but I want/need to build the xml file dynamically and build the 
> project from that and then maybe customize it.I think this feature 
> should make it easier to test ant as well. Would this be ok for a 
> PR?Add a parse function in ProjectHelper similar to the file api?

Note that ProjectHelper2 already supports Ant's own Resource abstraction in a limited way - it supports it if the Resource can provide a File or an URL.

If you want to start supporting InputStreams in addition then I'd suggest you change the code in a way that works for arbitrary Resoures (as they all provide InputStreams).

Stefan

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