Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jaring an images folder

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm experimenting with a very simple setup:

i have this frame that displays an icon in the title bar

then i have these folders:

img

jars - where i want to store the generated jars

source



so far i can run the application and jar it

i'd like to jar the img folder too, but i just cant - it includes all the stuff i'v got inside my project ... lol

another byas is that everytime i make a jar i'v to previously delete the former, because it says it cant contain a zip...

i guess i'm doing something wrong in creating the jar in the jars folder, but dont know...

here's my build file: (the Teste.jar is ok, but i cant jar only the images inside the img file, when creating the img.jar file - that's where i need help)



 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i just realized a mistake, so now i can properly jar the images folder:



also, i strangely stopped receiving those messages related with zips

so, for now, its case solved
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops

after all the imgjar isnt updated

i read from the ant documentation:

update indicates whether to update or overwrite the destination file if it already exists. Default is "false". No


so i'm using it without any result:



what is wrong now?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the date of the JAR file is more recent that the date of the prospective contents (the image in this case), Ant will not recreate the JAR file, even though you changed the build.xml to build the JAR differently. You will need to delete the JAR file and run Ant again. Hopefully your 'clean' target will do that.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:If the date of the JAR file is more recent that the date of the prospective contents (the image in this case), Ant will not recreate the JAR file, even though you changed the build.xml to build the JAR differently. You will need to delete the JAR file and run Ant again. Hopefully your 'clean' target will do that.


thank you for the idea: i'll include a delete jars folder in the clean and make it dependable for jaring
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic