OSDN Git Service

Fix an issue where src files can be deleted in ADT.
authorXavier Ducrohet <xav@android.com>
Wed, 22 Sep 2010 17:23:38 +0000 (10:23 -0700)
committerRaphael Moll <ralf@android.com>
Wed, 22 Sep 2010 19:25:45 +0000 (12:25 -0700)
commit3ae5eada2aa2c2e64f915369aed53a350ddbbf8b
treecbafdcd86a37ed6fb2ff21ea0025d7cca296d65a
parentcc338e26ff0bef408498c19e14fa608e76412ea3
Fix an issue where src files can be deleted in ADT.

Older projects generated the java class (R, aidl) into
the main src folder.

There is code in ADT to migrate them to the new model
(where generated classes go in gen/) by removing derived
resources from the source folder. This is also used
by the clean feature of the pre-compiler builder
to clean the content of gen.

To make it better, in ADT 0.9.8, we added something to
delete the folder containing the derived resources.
Except this doesn't check if the folder is not empty
after the derived resources have been deleted (or
not if it contained non-derived resources).

this means importing older projects (or possibly
team projects -- see http://b.android.com/11347)
would delete the whole content of the source folder.

This change makes sure that only folders for which
all members have been deleted are deleted.

Change-Id: I1ddbb3bd4c37859c7ddbf660377c598bae246269
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BaseBuilder.java