On project creation, put the app package in build.properties
This enabled 'ant uninstall' to work. Also, add an error message to the uninstall rules in case the property is not defined. BUG: 2050451
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<String, String> COMMENT_MAP = new HashMap<String, String>();
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user