Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

build.xml: optimization.

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,

I have about 8 jar files that I need to sign and rename them. My xml look like this:



Is there any way that let me sign the 8 jars at one signjar, and renaming each jar as follow:
original_name+Signed.jar, where original_name is the name of the jar before renaming, the one that is in jar attribute.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what you are trying to avoid is writing the same code multiple times because then it becomes a maintenance nightmare. One way to achieve this would be to define your own task using presetdef and then using it. Something like this:



Another mechanism would be to use antcall, passing parameters. Something like this:



 
Mariam A. Shamsi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Peter Johnson wrote:I think what you are trying to avoid is writing the same code multiple times because then it becomes a maintenance nightmare. One way to achieve this would be to define your own task using presetdef and then using it. Something like this:



Another mechanism would be to use antcall, passing parameters. Something like this:





Hello, thanks for your response. But, if I want to consider the 2nd suggestion, for signing the eight
jars that I have: do I need to antcall 8 times?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you would need 8 antcalls.

Another alternative would be to use the foreach task from antcontrib, but first you would have to find and install antcontrib (my last search for it didn't yield a download page).
 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Peter Johnson wrote: you would have to find and install antcontrib (my last search for it didn't yield a download page).


The download page
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne, as I pointed out in another forum post, that download page provides only the C++-related tasks, not any of the other tasks that I have come to know and love, such as the foreach task I mentioned. Fortunately, I have a copy of a prior release of antcontrib (version 1.0b3, as opposed to the latest which is 1.0b5) which contains all of the tasks, but I can no longer find where to downlaod that from.
 
Jeanne Boyarsky
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Peter Johnson wrote:Jeanne, as I pointed out in another forum post, that download page provides only the C++-related tasks, not any of the other tasks that I have come to know and love, such as the foreach task I mentioned. Fortunately, I have a copy of a prior release of antcontrib (version 1.0b3, as opposed to the latest which is 1.0b5) which contains all of the tasks, but I can no longer find where to downlaod that from.


When I click on ant-contrib on that page (first column), it takes me to a download page with more options. Clicking 1.0b3 expands the options for the jar you mentioned. That's the one I'm using too. It may not be the latest, but it still available for download - which is what I think Mariam is looking for.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting. The antcontrib home page, which I think is http://ant-contrib.sourceforge.net/ has download link with the URL http://sourceforge.net/project/showfiles.php?group_id=36177 (this is the same URL from your first post), which has a download link with URL http://sourceforge.net/project/showfiles.php?group_id=36177&package_id=28636&release_id=589175. That page has only the download for cpptasks.

What I don't understand is what link on the http://sourceforge.net/project/showfiles.php?group_id=36177&package_id=28636&release_id=589175 can I click to get to the http://sourceforge.net/project/showfiles.php?group_id=36177&package_id=28636 page you mentioned in your second post. I can see from the URLs that the only difference is the lack of the "&release_id=589175" parameter in the URL.

Finally! The light has dawned! When you are on the first download page (http://sourceforge.net/project/showfiles.php?group_id=36177), DO NOT CLICK THE DOWNLOAD LINK!!! Instead, click the ant-contrib link. I guess it must be obvious to people who are not morons like me that that if you want to download ant-contrib that you should not click on the download link.
 
Jeanne Boyarsky
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,
It's certainly not intuitive. I'm glad you see it now.
 
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic