• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

How to get package name for a directory?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a very large projectd with 300 packages and 1000s of source files. In each package, we created a build.xml file for that package.
We also have a master build.xml file under our <workspace>/build directory which has targets to rebuild all the packages by invoking the "compile" target on all 200 build.xml files.

Everything works, but I am trying to see if there is a way to simplify the build.xml files in each directory, so that it is even easier to add a new build.xml for a new package.

Here is an example build.xml that is in each package directory.



I am trying to find some way to make the assignement of project name and the TOP variable automatic. I want to do something like.



For the package api.abc, I would need
${ant.package.name} = api.abc
${ant.package.path} = api/abc

Is there anyway for me to construct this information based on the basedir, or would this require a custom task?

I would think this would be a commmon request, but I can't find any builtin tasks or predefined variables which would help me find out the java package name or base path for the package.
I found BaseName and DirName but these are very limited.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic