Re: cook question: dealing with unpredictable target names
"Pendergraft, Jerry" <[email protected]>
| Newsgroups | gmane.comp.version-control.aegis.user |
|---|---|
| Message-ID | <[email protected]> |
Looks like your problem recipe is more of an install target rather than a build target, so perhaps an install program is in order.
Having said that I belive you could get your desired result by changing the body to something like:
loop local classfile = [resolve [need]]
{
local classbase = [basename [classfile]];
cp [classfile] [concat [classbase] '$*' .class] [dirname [need]];
}
Alternatively you could do more brute force (might copy things not updated) by:
cd deploy/classes && find . -name '*.class' -print | cpio -pdum [dirname [target]];
-----Original Message-----
From: Aegis-users [mailto:[email protected]] On Behalf Of Aryeh Friedman
Sent: Wednesday, September 19, 2012 5:39 AM
To: aegis-users
Subject: [Aegis] cook question: dealing with unpredictable target names
When Java compiles an inner class or something like them (enums for
example) a separate .class file is generated for each inner class file
that has a $x where x is a internal compiler count of inner classes.
For example
public enum Foo
{
FOO, ACK, BAR;
}
would get compiled as:
Foo$1.class
Foo$2.class
Foo$3.class
(there are no rules about what order "x" is assigned in).
Now the problem I have the following for determining what classes need
to be compiled:
java=[fromto src/%0%.java [tomcat]/WEB-INF/classes/%0%.class
[match_mask src/%0%.java [manifest]];
all: [java];
[tomcat]/WEB-INF/classes/%0%.class: deploy/classes/%0%.class
set mkdir
{
cp [resolve [need]] [target];
}
deploy/classes/%0%.class: src/%0%.java
set mkdir
{
javac -d deploy/classes -sourcepath [unsplit ':' [resolve src]] [need];
}
The problem is the above doesn't handle the xxx$y.class files because
they are not a direct off shot of [java]
_______________________________________________
Aegis-users mailing list
[email protected]
http://lists.auug.org.au/listinfo/aegis-users
This communication, including any attachments, may contain information that is proprietary, privileged, confidential or legally exempt from disclosure. If you are not a named addressee, you are hereby notified that you are not authorized to read, print, retain a copy of or disseminate any portion of this communication without the consent of the sender and that doing so may be unlawful. If you have received this communication in error, please immediately notify the sender via return e-mail and delete it from your system.