Props Antlib

2007-07-06 Thread Kevin Jackson

Hi all,

I've just got the props antlib working within my odd usecase.

I'm using mvn + antrun plugin and I've installed the patched version
of ant and the props antlib.  Then in a parent pom, I've got the
complete  etc setup for the property helper
ie

 


I munge the property with a regexp (very nice Matt, worked perfectly).
Finally in the child pom.xml I set the property value that will be
munged.

Issues I came across.

1- Without the ant-nodeps jar, the propertyhelper task fails with a
ClassNotFoundException for ...Jdk14Regexp.Regexp

I fixed this by installing this jar in my ~/.m2/repository, and
altering the classpath for the typedef

2- Munging the property directly won't work.  I had to first copy the
child property into an intermediate property and then perform the
regexp on that - I guess this has to do with the mvn->ant mapping in
some way - and it's not much of a hassle when you know the workaround

Anyway, for my use case of removing a hardcoded svn repo URL in the
pom/profile when it's already available in the  in
the pom, this antlib works perfectly.

Ta Matt,
Kev

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r553857 - in /ant/core/trunk: build.xml docs/manual/CoreTasks/jar.html src/etc/testcases/taskdefs/jar.xml src/main/org/apache/tools/ant/taskdefs/Jar.java src/tests/junit/org/apache/tools/a

2007-07-06 Thread jhm
Author: jhm
Date: Fri Jul  6 05:19:28 2007
New Revision: 553857

URL: http://svn.apache.org/viewvc?view=rev&rev=553857
Log:
Encourage people to follow the packaging spec.

Modified:
ant/core/trunk/build.xml
ant/core/trunk/docs/manual/CoreTasks/jar.html
ant/core/trunk/src/etc/testcases/taskdefs/jar.xml
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java

Modified: ant/core/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/build.xml?view=diff&rev=553857&r1=553856&r2=553857
==
--- ant/core/trunk/build.xml (original)
+++ ant/core/trunk/build.xml Fri Jul  6 05:19:28 2007
@@ -1547,6 +1547,22 @@
 
 
 
+  
+
+
+
+
+
+
+
+  
   
 
   

Modified: ant/core/trunk/docs/manual/CoreTasks/jar.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/jar.html?view=diff&rev=553857&r1=553856&r2=553857
==
--- ant/core/trunk/docs/manual/CoreTasks/jar.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/jar.html Fri Jul  6 05:19:28 2007
@@ -73,14 +73,17 @@
 include an empty one for you.)
 
 Manifests are processed by the Jar task according to the
-http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html";>Jar file 
specification.
+http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html";>Jar file 
specification.
 Note in particular that this may result in manifest lines greater than 72 bytes
-being wrapped and continued on the next line.
-
+being wrapped and continued on the next line.
+
+The Jar task checks whether you specified package information according to 
the
+http://java.sun.com/j2se/1.3/docs/guide/versioning/spec/VersioningSpecification.html#PackageVersioning";>
+versioning specification.
 
 Please note that the zip format allows multiple files of the same
-fully-qualified name to exist within a single archive.  This has been
-documented as causing various problems for unsuspecting users.  If you wish
+fully-qualified name to exist within a single archive. This has been
+documented as causing various problems for unsuspecting users. If you wish
 to avoid this behavior you must set the duplicate attribute
 to a value other than its default, "add".
 

Modified: ant/core/trunk/src/etc/testcases/taskdefs/jar.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/jar.xml?view=diff&rev=553857&r1=553856&r2=553857
==
--- ant/core/trunk/src/etc/testcases/taskdefs/jar.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/jar.xml Fri Jul  6 05:19:28 2007
@@ -236,5 +236,23 @@
   
 
   
+
+  
+
+
+
 
+
+  
+
+
+  
+
+
+
+  
+
+
+
+
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java?view=diff&rev=553857&r1=553856&r2=553857
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java Fri Jul  6 
05:19:28 2007
@@ -45,6 +45,7 @@
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Manifest.Section;
 import org.apache.tools.ant.types.EnumeratedAttribute;
 import org.apache.tools.ant.types.Path;
 import org.apache.tools.ant.types.ResourceCollection;
@@ -76,6 +77,7 @@
 
 /** merged manifests added through addConfiguredManifest */
 private Manifest configuredManifest;
+
 /** shadow of the above if upToDate check alters the value */
 private Manifest savedConfiguredManifest;
 
@@ -158,7 +160,7 @@
 setEncoding("UTF8");
 rootEntries = new Vector();
 }
-
+
 /**
  * Not used for jar files.
  * @param we not used
@@ -773,6 +775,25 @@
  */
 protected void cleanUp() {
 super.cleanUp();
+
+// check against packaging spec
+// 
http://java.sun.com/j2se/1.3/docs/guide/versioning/spec/VersioningSpecification.html#PackageVersioning
+Section mainSection = (configuredManifest==null) ? null : 
configuredManifest.getMainSection();
+if (mainSection==null) {
+log("No Implementation-Title set. (" + getLocation() + ")");
+log("No Implementation-Version set. (" + getLocation() + ")");
+log("No Implementation-Vendor set. (" + getLocation() + ")");
+} else {
+if (mainSection.getAttribute("Implementation-Title") == null) {
+log("No Implementation-Title set. (" + getLocation() + ")");

Re: Props Antlib

2007-07-06 Thread Matt Benson

--- Kevin Jackson <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> I've just got the props antlib working within my odd
> usecase.
> 
> I'm using mvn + antrun plugin and I've installed the
> patched version
> of ant and the props antlib.  Then in a parent pom,
> I've got the
> complete  etc setup for the property helper
> ie
> 
>   
> 
> 
> I munge the property with a regexp (very nice Matt,
> worked perfectly).
>  Finally in the child pom.xml I set the property
> value that will be
> munged.
> 
> Issues I came across.
> 
> 1- Without the ant-nodeps jar, the propertyhelper
> task fails with a
> ClassNotFoundException for ...Jdk14Regexp.Regexp
> 
> I fixed this by installing this jar in my
> ~/.m2/repository, and
> altering the classpath for the typedef

Alternately you could use the ant-apache-oro jar, I
guess.  :)

> 
> 2- Munging the property directly won't work.  I had
> to first copy the
> child property into an intermediate property and
> then perform the
> regexp on that - I guess this has to do with the
> mvn->ant mapping in
> some way - and it's not much of a hassle when you
> know the workaround
> 

Ugh!  You've just discovered one more example of
client code that extends PropertyHelper, in the antrun
plugin... I'd better drop a note over there to read up
on our related threads to get their input and find out
how hard it'll be for them to manage compatibility...
:(

> Anyway, for my use case of removing a hardcoded svn
> repo URL in the
> pom/profile when it's already available in the
>  in
> the pom, this antlib works perfectly.

Glad to hear it.  And ultimately I suppose it's a good
thing we learn about the Maven thing sooner rather
than later.

-Matt

> 
> Ta Matt,
> Kev
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



   

Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[antrun-plugin] impending PropertyHelper compatibility issues

2007-07-06 Thread Matt Benson
Forgive my ignorance of the subject line conventions
of this mailing list, and please note in advance that
I personally am not subscribed to any Maven lists (I
believe Kevin Jackson is subscribed to one or more of
them).  At any rate, it has come to the attention of
the Ant developers that Maven's antrun plugin
customizes Ant's PropertyHelper architecture.  A
discussion of drastic refactorings to these APIs is by
this time nearing its conclusion, but we are trying to
reach out to affected parties to gauge impact before
finalizing these changes for an Ant 1.8 version
sometime in the not-too-near future.  A fairly
complete picture of what has happened can be gotten by
reading the e-mail threads at these links:

http://marc.info/?t=11818165307&r=2&w=2
http://marc.info/?t=11835551689&r=1&w=2&n=2
http://marc.info/?t=11837196861&r=1&w=2&n=2

Regards,
Matt


   

Moody friends. Drama queens. Your life? Nope! - their life, your story. Play 
Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 42828] New: - Preserve return code of called batch files from exec task

2007-07-06 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42828

   Summary: Preserve return code of called batch files from exec
task
   Product: Ant
   Version: 1.7.0
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Core tasks
AssignedTo: dev@ant.apache.org
ReportedBy: [EMAIL PROTECTED]


For the WinNT platform, if a batch script is called from the  task
normally any batch error codes aren't propagated back to ant from the command
shell.  This causes a lot of headaches for those who expect or want an "exit /b
1" command to cause ant to fail the build process.  

I've been getting around this by using a very simple batch wrapper when I exec a
batch file.  It simply takes the return code from the wrapped batch file and
exits the shell with the same code.  

I'm thinking that it's not too big of a job to hack the exec task to
automatically use a wrapper such as this anytime a "*.cmd" or "*.bat" is set as
the executable on a winnt platform.  

In the interests of backwards compatibility this would be an option that
defaults off, but in the interests of saving traffic on the mail lists, and
making ant do what most people expect out of the box, I'd vote to have this on
by default...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 42828] - Preserve return code of called batch files from exec task

2007-07-06 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42828





--- Additional Comments From [EMAIL PROTECTED]  2007-07-06 11:52 ---
Created an attachment (id=20469)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20469&action=view)
this is the wrapper I'm using


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



1.7.x branch

2007-07-06 Thread Matt Benson
I'd like to create one.  Any objections?

-Matt


  

Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]