Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple script to compile package

 
santoshkumar savadatti
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • 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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18154
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic