8

I have an Android project, which I'm working on in Eclipse. There are no special requirements, however I do have a couple of files in the project which I do not want/need to include into the final build, yet I do want to keep them where they are. They are all java source files and are all in the same package. There are no files in that package, which I do need to include - so I can safely skip that whole package from build.

So, to my question: is there a way in Eclipse to exclude a package (or an individual file for that matter) from the build when the android app is built?

Thanks in advance.

Charles
  • 50,943
  • 13
  • 104
  • 142
Aleks G
  • 56,435
  • 29
  • 168
  • 265

3 Answers3

14

In Eclipse right click on a file (or package) in the Package Explorer. There should be a Build Path > Exclude option

ioums
  • 1,367
  • 14
  • 20
  • i'm not entirely sure android uses eclipse preferences for excludes in builds – njzk2 Apr 11 '12 at 13:02
  • 2
    Is there a similar way to handle this for other files such as raw resources or assets used in debugging as well perhaps? – Jay Snayder Jan 22 '14 at 21:24
  • 1
    @Jay Snayder I'm not sure about that, but maybe [this](http://stackoverflow.com/q/9289232/1133144) question will help you. – ioums Jan 24 '14 at 14:35
3

Go to eclipse File->new->Other->Faceted Project->Give project name and add it to a working set if u want

Eclipse will not build that project or working set

Rohan Gala
  • 641
  • 5
  • 18
0

Make sure you are in the right perspective. I just ran into a similar problem and was getting really frustrated because I could not exclude any files. Turns out, before I went on vaca, I was fiddling around with PHP perspective and never changed it back.