You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Mallampati, Suresh" <SM...@erac.com> on 2001/12/14 17:35:03 UTC

specifying manifest file for Jar

Hi,
i wanted to specify my own manifest file to a "ejbjar" task. My Manifest
file has an entry called "Class-Path". Since its a bit long, Ant is
truncating it after certain characters, and adding new lines and spaces. To
avoid this, I divided the values, and put it as 3 Class-Path entries. Even
this doesnt work.

case 1:
Class-Path: lib/myJar1 lib/myJar2 lib/myJar3 lib/myJar4 lib/myJar5
lib/myJar6 lib/myJar7 lib/myJar8 lib/myJar9 lib/myJar10

Ant converted this to:
Class-Path: lib/myJar1 lib/myJar2 lib/myJar3 lib/myJar4 lib/myJ 
ar5 lib/myJar6 lib/myJar7 lib/myJar8 lib/myJar9 lib/myJar10

case 2:
Class-Path: lib/myJar1 lib/myJar2 lib/myJar3 lib/myJar4
Class-Path: lib/myJar5 lib/myJar6 lib/myJar7 lib/myJar8
Class-Path: lib/myJar9 lib/myJar10

Ant, is may be thinking of them as duplicates and removing the first two
entries leaving the third. Is this a bug..and does anyone know about a fix
for this.
Class-Path: lib/myJar9 lib/myJar10

Pleae let me know if some one knows a fix to this.

Thanks
-Suresh


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to run a target without ANTCALL?

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Yeah, don't have the called target depend on 'init'!  :))


----- Original Message -----
From: "Mark McMillan" <ma...@engineous.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Friday, December 14, 2001 12:40 PM
Subject: How to run a target without ANTCALL?


> At some point in a target I need to execute some other target in the same
> project, but I don't want to use ANTCALL because it re-evaluates all the
> dependant targets.  E.g. I have an "init" target that all targets depend
> on.  If I use ANTCALL to invoke a target, "init" will be executed more
than
> once.  Is there some way to invoke a target without using ANTCALL (or,
some
> way to prevent re-evaluation of dependants in the call)?
>
> Thanks,
> -Mark
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


General string manipulations

Posted by Mark McMillan <ma...@engineous.com>.
I have a number of times wanted to do some manipulation of a property 
string.  For example, when running JAVA2IIOP as part of an EJB build, I 
need build a list of all Java classes that end in "...Home.java".  A 
FILESET easily builds the list of files, but then I have to convert those 
file names to Java class names (remove path prefix, convert "/" to ".", and 
remove ".java" postfix).

I have written a simple string-substitution task:

   <subst property="someProperty" from="string1" to="string2"/>

but is there a more general way to manipulate property values in ANT?  I 
looked around on the Jakarta site but could not find anything like this... 
surely this is a common sort of task?

-Mark


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to run a target without ANTCALL?

Posted by Mark McMillan <ma...@engineous.com>.
None of the offered solutions is really clean... a complex build file with 
many targets (some of which invoke each other via ANTCALL) always evaluate 
common dependencies more than once.  It takes a lot of tedious code to 
control it with "unless" clauses and setting properties to prevent multiple 
executions.

So I wrote a simple task of my own called "do" which will invoke the named 
target without losing the current dependencies.  So instead of writing:

   <antcall target="subtask">

I write:

   <do target="subtask">

This seems to work very well and results in significantly faster builds of 
our large project when running high level targets (e.g. targets that call 
lots of sub-targets).

Seems like this should be a built-in ANT function...?

-Mark

At 01:01 PM 12/14/01, you wrote:
>--- Mark McMillan <ma...@engineous.com> wrote:
> > At some point in a target I need to execute some other target in the
> > same project, but I don't want to use ANTCALL because it re-evaluates
> > all the dependant targets.  E.g. I have an "init" target that all
> > targets depend on.  If I use ANTCALL to invoke a target, "init" will be
> > executed more than once.  Is there some way to invoke a target without
> > using ANTCALL (or, some way to prevent re-evaluation of dependants in
> > the call)?
>
>You can execute a target from <script> without it re-running dependent
>targets. If using <script> doesn't float your boat, the only other thing
>that jumps to mind is to have your "init" target (if that's the only one
>you're concerned about) set an (eg.) init.done property, then include an
>unless="init.done" for the "init" target.
>
>Diane
>
>=====
>(holtdl@yahoo.com)
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Check out Yahoo! Shopping and Yahoo! Auctions for all of
>your unique holiday gifts! Buy at http://shopping.yahoo.com
>or bid at http://auctions.yahoo.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to run a target without ANTCALL?

Posted by Diane Holt <ho...@yahoo.com>.
--- Mark McMillan <ma...@engineous.com> wrote:
> At some point in a target I need to execute some other target in the
> same project, but I don't want to use ANTCALL because it re-evaluates
> all the dependant targets.  E.g. I have an "init" target that all
> targets depend on.  If I use ANTCALL to invoke a target, "init" will be
> executed more than once.  Is there some way to invoke a target without
> using ANTCALL (or, some way to prevent re-evaluation of dependants in
> the call)?

You can execute a target from <script> without it re-running dependent
targets. If using <script> doesn't float your boat, the only other thing
that jumps to mind is to have your "init" target (if that's the only one
you're concerned about) set an (eg.) init.done property, then include an
unless="init.done" for the "init" target.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


How to run a target without ANTCALL?

Posted by Mark McMillan <ma...@engineous.com>.
At some point in a target I need to execute some other target in the same 
project, but I don't want to use ANTCALL because it re-evaluates all the 
dependant targets.  E.g. I have an "init" target that all targets depend 
on.  If I use ANTCALL to invoke a target, "init" will be executed more than 
once.  Is there some way to invoke a target without using ANTCALL (or, some 
way to prevent re-evaluation of dependants in the call)?

Thanks,
-Mark


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>