diff --git a/tools/scripts/android_rules.xml b/tools/scripts/android_rules.xml index 1f5daac83..be532643e 100644 --- a/tools/scripts/android_rules.xml +++ b/tools/scripts/android_rules.xml @@ -201,7 +201,15 @@ - + + + + + + + Unable to run 'ant unintall', application-package is not defined in build.properties + + Uninstalling ${application-package} from the default emulator... diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java index 1e16a8365..916fa7c40 100644 --- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java +++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java @@ -199,9 +199,10 @@ public class ProjectCreator { defaultProperties.setAndroidTarget(target); defaultProperties.save(); - // create an empty build.properties + // create a build.properties file with just the application package ProjectProperties buildProperties = ProjectProperties.create(folderPath, PropertyType.BUILD); + buildProperties.setProperty(ProjectProperties.PROPERTY_APP_PACKAGE, packageName); buildProperties.save(); // create the map for place-holders of values to replace in the templates diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java index 33f88372a..d71491c72 100644 --- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java +++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java @@ -22,7 +22,6 @@ import com.android.sdklib.SdkManager; import java.io.File; import java.io.FileOutputStream; -import java.io.FileWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.HashMap; @@ -38,6 +37,7 @@ public final class ProjectProperties { public final static String PROPERTY_TARGET = "target"; public final static String PROPERTY_APK_CONFIGS = "apk-configurations"; public final static String PROPERTY_SDK = "sdk-location"; + public final static String PROPERTY_APP_PACKAGE = "application-package"; public static enum PropertyType { BUILD("build.properties", BUILD_HEADER), @@ -85,15 +85,9 @@ public final class ProjectProperties { "# This file must be checked in Version Control Systems, as it is\n" + "# integral to the build system of your project.\n" + "\n" + - "# The name of your application package as defined in the manifest.\n" + - "# Used by the 'uninstall' rule.\n"+ - "#application-package=com.example.myproject\n" + - "\n" + - "# The name of the source folder.\n" + - "#source-folder=src\n" + - "\n" + - "# The name of the output folder.\n" + - "#out-folder=bin\n" + + "# You can use this to override default values such as\n" + + "# 'source-folder' for the location of your java source folder and\n" + + "# 'out-folder' for the location of your output folder.\n" + "\n"; private final static Map COMMENT_MAP = new HashMap(); @@ -116,6 +110,9 @@ public final class ProjectProperties { "# location of the SDK. This is only used by Ant\n" + "# For customization when using a Version Control System, please read the\n" + "# header note.\n"); + COMMENT_MAP.put(PROPERTY_APP_PACKAGE, + "# The name of your application package as defined in the manifest.\n" + + "# Used by the 'uninstall' rule.\n"); } private final String mProjectFolderOsPath;