Hi,
beside =
project.setNewProperty() for a really new property
there's also =
project.setProperty() - with that method you can reset/overwrite
an existing property if you need to
btw you can always use such methods with script task, you
don't always need a new task, f.e.
property name=FOO
Hi,
I have solution for that:
The fileset-Tag has the element different...
How it works:
The different tag selects files who are deemed to be 'different' from
another,
equivalent file in another location. The rules for determining difference
between two files are as follows:
1. If there is
I want to echo ASCII art.
But since multiple spaces are trimmed, it does not work.
How can I do it?
-
Yahoo! Music Unlimited - Access over 1 million songs.Try it free.
hm, maybe you could use a multilineproperty
the format has to be written like that =
myasciiart=\n line0 \
\n line1 \
\n line2 \
\n line3 \
\n line4 \
\n line5 \
\n line6 \
you have to wrap every line of your ascii art between \n and \
and then echo${myasciiart}/echo
Regards, Gilbert
Or is there a task to print the contents of a text file (not trimming spaces)?
Rebhan, Gilbert [EMAIL PROTECTED] wrote:
hm, maybe you could use a multilineproperty
the format has to be written like that =
myasciiart=\n line0 \
\n line1 \
\n line2 \
\n line3 \
\n line4 \
\n line5 \
\n
Hey,
I have some hand-written classes and some idl-generated source
in two seperated directories. Some of the source in both of the
directories has the same file/class name, and as I need to compile them
together, I get
duplicate class errors. What I would like to do is compare the
Doesn't work. Same effect.
Lets say you have three spaces in a row. They are all trimmed.
Rebhan, Gilbert [EMAIL PROTECTED] wrote:
Yup
there is a task =
first load the file as a property :
... and later echo the property
${bla}
btw after reading your first mail a second
CDATA?
Hans Schwaebli wrote:
Doesn't work. Same effect.
Lets say you have three spaces in a row. They are all trimmed.
Rebhan, Gilbert [EMAIL PROTECTED] wrote:
Yup
there is a task =
first load the file as a property :
... and later echo the property
${bla}
btw after
Hm,
i've tried with a txtfile like that :
Bla bluer
asda
ASDF
12345678
asdf
and :
loadfile property=bla srcfile=y:/test2.txt/
target name=depends
echo${bla}/echo
/target
gives me =
[echo] Bla bluer
[echo]
---88888888-
project
echo
line1
line4-indented
line5
/echo
/project
---88888888-
C:\TEMPant -f build-asciiart.xml
Buildfile: build-asciiart.xml
... or when using external text files (not property-file) ...
project
concatfileset dir=. includes=asciiart.txt//concat
/project
Jan
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 9. August 2006 12:17
An: user@ant.apache.org
Betreff:
Try it with
adgl
sdfsdf
The result will be
adgl
sdfsdf
Rebhan, Gilbert [EMAIL PROTECTED] wrote:
Hm,
i've tried with a txtfile like that :
Bla bluer
asda
ASDF
12345678
asdf
and :
${bla}
ok good shot,
they have differenct hashcodes now how do I fix this? my complete ant
task looks like:
project name=antTaskExample default=example
!-- define our classpath --
path id=lib
pathelement path=../../build /
fileset dir=../../lib
ok I got it fixed, I had to set the loader ref, kinder annoying and is
there an easy way todo this automatical?
thx for your help and pointing me in the right direction!
final soloutioon:
path id=lib
pathelement path=../../build /
fileset dir=../../lib
is suggest you use the if/else task and check if the dir exist in the
first place?
this should solve your problem.
http://ant-contrib.sourceforge.net/tasks/tasks/if.html
/gert
On 8/8/06, John Davis [EMAIL PROTECTED] wrote:
Hello
Currently I have a top-level build.xml file which calls ant
Doesn't work to solve the problem.
[EMAIL PROTECTED] wrote:
... or when using external text files (not property-file) ...
Jan
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 9. August 2006 12:17
An: user@ant.apache.org
Doesn't work to solve the problem.
James Abley [EMAIL PROTECTED] wrote: CDATA?
Hans Schwaebli wrote:
Doesn't work. Same effect.
Lets say you have three spaces in a row. They are all trimmed.
Rebhan, Gilbert wrote:
Yup
there is a task =
first load the file as a property :
hi I try to call an ejb from an ant task and get always:
[register] (util.RocksClusterFactoryImpl50 ) create new
implementation of the cluster util
[register] javax.naming.NoInitialContextException: Cannot instantiate
class: org.jnp.interfaces.NamingContextFactory [Root exception is
I suppose you could do something with available and set properties,
then use targets with a if attribute... That would be somewhat
kludgy... Honestly, the ant-contrib solution would be cleaner...
wohlgemuth wrote:
is suggest you use the if/else task and check if the dir exist in the
first
OK, i see, you have probs with leading spaces
i think i have hit the problem
i tried with
---
Bla bluer
asda
ASDF
12345678
asdf
---
and =
loadfile property=bla srcfile=y:/test2.txt/
target name=depends
you may also go with concat, as Jan already mentioned,
then you do not need to go the way via multilineproperty
and wrap every line betwenn \n ... \ =
concat
fileset dir=Y: includes=test2.txt/
/concat
when no destfile attribute specified it appears on stdout
result =
[concat]
forget the line
...
then you do not need to go the way via multilineproperty
and wrap every line between \n ... \ =
...
not needed when using loadfile property= ...
i once had a problem when generating a property
file and java has the convention with \n line \ when it comes
to multiline
Sorry but how do I invoke the java task from within my custom
task? You guys said to use antcall but I'm not clear on how to do this
using the programmatic API (as opposed to embedding code in the build.xml
file).
Thanks,
Gili
-Original Message-
From: Rebhan, Gilbert
sofar I found out that the problem is located in the ant classpath, If
I copy all my libs into the ant lib directory everything is working
fine.
It's just there need to be an easier way, cause I can't force the user
of this software to always copy the nearly 50 libs into there ant
directory.
Yes, I use Eclipse.
Thanks for the information you found.
I will check why Eclipse 3.1.2 is doing this strange thing. Maybe a bug.
Rebhan, Gilbert [EMAIL PROTECTED] wrote:
OK, i see, you have probs with leading spaces
i think i have hit the problem
i tried with
---
I now believe it is because of Eclipse. Tomorrow I will test it.
By the way, I want to use this ASCII art:
,-._.-._.-._.-._.-.
`-. ,-'
.--. | |
|| |
ok I found an ugly solution but it works.
basicly in my taks I create an instance of the java task and give it
the reference to the classpath + plus the needed parameter.
public void execute() throws BuildException {
try {
Java java = new Java();
Hi,
don't worry it's also in Eclipse 3.2 :-),which i use
I wouldn't call it a bug, it's enough if you
know that behaviour when using ascii art ;-)
Gilbert
Hans Schwaebli wrote:
Yes, I use Eclipse.
Thanks for the information you found.
I will check why Eclipse 3.1.2 is doing this strange
I have noticed some very strange behaviour when I try to compile my java code.
Say I have some java files to be filed, A,B,C,D,E,F,G...
When I was doing a clean compiling, it gives me error that File C, D failed
because some errors, which is true. But when I do the compile(not a clean
You mean when not using ASCII art, because of that feature...
Gilbert Rebhan [EMAIL PROTECTED] wrote: Hi,
don't worry it's also in Eclipse 3.2 :-),which i use
I wouldn't call it a bug, it's enough if you
know that behaviour when using ascii art ;-)
Gilbert
Hans Schwaebli wrote:
Yes, I use
Since leading whitespace may be stripped from your ASCII art, simply
prepend each line with a little dot '.' (possibly followed by spaces),
to work around the issue. The dots shouldn't affect the visual effect.
--DD
On 8/9/06, Hans Schwaebli [EMAIL PROTECTED] wrote:
You mean when not using
It'd help to see your classpath, sourcepath, etc...
It sounds like those are in issue.
Chun Ji wrote:
I have noticed some very strange behaviour when I try to compile my java code.
Say I have some java files to be filed, A,B,C,D,E,F,G...
When I was doing a clean compiling, it gives me error
-Original Message-
From: David Corley (AT/LMI) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 9 August 2006 6:42 PM
To: Ant Users List
Subject: Code synchronisation problem
Hey,
I have some hand-written classes and some
idl-generated source in two seperated directories.
Have you also checked the latest Ant (1.6.5) changelog? I noticed there
was a change to the javac task in 1.6.3 as follows:
* Changed default tempdir for javac from user.dir to java.io.tmpdir.
Perhaps this affects you?
-Original Message-
From: Chun Ji [mailto:[EMAIL PROTECTED]
Sent: 09
smime.p7s
Description: S/MIME Cryptographic Signature
ANT compares timestamps of class files with Java source files and passes
the list to JavaC command. So, if C and D files are not specified as
source files for compilation and selected by JavaC on its own, ANT would
not know about them. The situation can happen, if all selected files
compiled
Here is my ant target looks like:
target name=build
javac srcdir=/home/cji/src
destdir=${classes}
debug=${debug}
optimize={optimize}
includes=package1/A.java, package1/B.java, package2/C.java,
package2/D.java, package3/E.java, ...;
classpath
I wouldnt use includeswhy are you doing that? Just use srcdir and
all your .java's will be found.
Chun Ji wrote:
Here is my ant target looks like:
target name=build
javac srcdir=/home/cji/src
destdir=${classes}
debug=${debug}
optimize={optimize}
Brown, Carlton wrote:
I've got an sshexec task that never exits, and I need to solicit some
opinions on the problem. The reasons behind it are well-known; if an
ssh command starts a long-running in the background, then ssh doesn't
know when it should exit.
From the purist standpoint, this is
John Davis wrote:
Hello
Currently I have a top-level build.xml file which calls ant on
subdirs. It looks like something like this:
target name=top_build depends=...
ant dir=tools/
ant dir=src /
ant dir=tests /
...
/target
I would like to change the xml so it only builds available
Hi,
I'd like my custom task to invoke the Java task. Do I simply
construct a new instance of org.apache.tools.ant.taskdefs.Java and execute()
it? Or is there a nicer convention for chaining tasks programmatically (not
in the build.xml side, but rather on the Java end)?
Thanks,
Hello Gili,
you can construct your Java task instance in two ways :
a) for Ant 1.6 code
Java myjava = (Java) getProject().createTask(java);
or
b) for Ant 1.7 code
Java myjava = new Java();
myjava.bindToOwner(this);
myjava.init();
in both cases you need to set afterwards all the attributes
42 matches
Mail list logo