• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Simple script to compile package

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm learning automated unit testing. i can run tests on classes that are in default package e.g: my directory is src/java/main and the class is in the default package.I specify source location as {src.java.main.dir} and it works. What if i add the class to a package "com.xyz.org" under src/java/main?
How to modify the build file to compile a file in a package?
Thanks.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You really shouldn't build anything in the default package. A lot of Java systems will get annoyed at you if you do.

Complex Java applications are too much trouble to build using generic OS script files. I recommend that you use a tool designed specifically to do that sort of work, such as Ant or Maven.
 
santoshkumar savadatti
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sorry i wasn't clear
I'm using ant and need to know how to declare the package and how to specify the srcdir in javac task.
I will have src/java/main and src/java/test with java and junit classes in packages under them.
 
santoshkumar savadatti
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

santoshkumar savadatti wrote:I'm learning automated unit testing. i can run tests on classes that are in default package e.g: my directory is src/java/main and the class is in the default package.I specify source location as {src.java.main.dir} and it works. What if i add the class to a package "com.xyz.org" under src/java/main?
How to modify the build file to compile a file in a package?
Thanks.


Found the solution.
i have to define a property


and in javac task,


i wasn't aware of the "includes" attribute
 
reply
    Bookmark Topic Watch Topic
  • New Topic