How to exclude files in the / res folder for Android Eclipse Project

Is there a way to exclude some files from the / res folder from the Android handler?

I have several Android projects that I create using Eclipse. I uploaded these projects to our version control system. The problem is that version control adds the "project.pj" file to each folder.

Because of these project.pj files, my projects will no longer be created in Eclipse. I get errors because the builder is trying to process these files in / res. I know that I can exclude these files for the / src and / gen folders, but how to exclude them from the / res (and / assets) folder?

+6
android eclipse adt resources
source share
4 answers

aapt is a program that processes files under res /. There is no way to tell him to ignore certain files. So the short answer is: you cannot. Your VCS is bad for Android projects. Have you heard about git?

However, your build system can be expanded to move these unwanted files out of the way, run aapt, and then move them back. When you use Eclipse, it means hacking the Android plugin to add these extra steps. Or perhaps write your own plugin that takes these steps around calling the Android plugin - I never hacked Eclipse myself and would not want to do that. For any other build system (for example, using maven or ant, or make or scripts) it is as simple as understanding how this system does something. Eclipse is just more involved . As a final option, you can write your own scripts in the project directory that move these .pj files, and run these scripts yourself at the appropriate time without getting any help from Eclipse.

+2
source share

If you prefix any file name with a period ( . ), It will be hidden from Eclipse and will not be included in your assembly.

If you are working on a computer running Windows, you can still see them without problems in Explorer. If you are on a Mac, you will need to make sure that hidden files are discovered if you want to find the file again.

+6
source share

there are actually several ways to get aapt to ignore such resources.

one of these methods involves activating -ignore-activation when you invoke the command line, if you can affect this (perhaps in the build.xml file, if used).

you can also use aapt.ignore.assets= in your ant.properties if you have this.

+3
source share

Use ant to control the build process, compilation.

0
source share

All Articles