Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android exclude file from build in eclipse

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.

like image 548
Aleks G Avatar asked Apr 11 '12 12:04

Aleks G


People also ask

How do you exclude files from a build?

In Visual Studio, right-click on the file to be excluded from build, choose Properties, Configuration Properties -> General -> Excluded From Build -> Yes -> OK. In Eclipse, right-click on the file to be excluded from build, choose Properties, C/C++ Build -> Excluded from build -> OK.

How do I exclude files in Eclipse?

To exclude specified files using the standard Eclipse preferences: Select Window | Preferences. The Preferences dialog box appears. Click the plus sign next to Team and select Ignore Resources.


2 Answers

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

like image 94
ioums Avatar answered Sep 29 '22 12:09

ioums


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

like image 41
Rohan Gala Avatar answered Sep 29 '22 12:09

Rohan Gala