aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager
diff options
context:
space:
mode:
Diffstat (limited to 'sdkmanager')
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java7
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java10
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java18
3 files changed, 25 insertions, 10 deletions
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java
index 4f3ed9f..e21e14f 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java
@@ -166,8 +166,10 @@ public final class SdkConstants {
*/
public final static String FN_GDBSERVER = "gdbserver"; //$NON-NLS-1$
- /** default proguard config file */
- public final static String FN_PROGUARD_CFG = "proguard.cfg"; //$NON-NLS-1$
+ /** global Android proguard config file */
+ public final static String FN_ANDROID_PROGUARD_FILE = "proguard-android.txt"; //$NON-NLS-1$
+ /** default proguard config file with new file extension (for project specific stuff) */
+ public final static String FN_PROJECT_PROGUARD_FILE = "proguard-project.txt"; //$NON-NLS-1$
/* Folder Names for Android Projects . */
@@ -385,7 +387,6 @@ public final class SdkConstants {
/** SDK property: default skin */
public final static String PROP_SDK_DEFAULT_SKIN = "sdk.skin.default"; //$NON-NLS-1$
-
/* Android Class Constants */
public final static String CLASS_ACTIVITY = "android.app.Activity"; //$NON-NLS-1$
public final static String CLASS_APPLICATION = "android.app.Application"; //$NON-NLS-1$
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java
index c3d7993..721d165 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java
@@ -369,8 +369,8 @@ public class ProjectCreator {
keywords);
// install the proguard config file.
- installTemplate(SdkConstants.FN_PROGUARD_CFG,
- new File(projectFolder, SdkConstants.FN_PROGUARD_CFG),
+ installTemplate(SdkConstants.FN_PROJECT_PROGUARD_FILE,
+ new File(projectFolder, SdkConstants.FN_PROJECT_PROGUARD_FILE),
null /*keywords*/);
} catch (Exception e) {
mLog.error(e, null);
@@ -751,8 +751,10 @@ public class ProjectCreator {
if (hasProguard == false) {
try {
- installTemplate(SdkConstants.FN_PROGUARD_CFG,
- new File(projectFolder, SdkConstants.FN_PROGUARD_CFG),
+ installTemplate(SdkConstants.FN_PROJECT_PROGUARD_FILE,
+ // Write ProGuard config files with the extension .pro which
+ // is what is used in the ProGuard documentation and samples
+ new File(projectFolder, SdkConstants.FN_PROJECT_PROGUARD_FILE),
null /*placeholderMap*/);
} catch (ProjectCreateException e) {
mLog.error(e, null);
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java
index 3a73bef..2bb6b71 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java
@@ -16,6 +16,11 @@
package com.android.sdklib.internal.project;
+import static com.android.sdklib.SdkConstants.FD_PROGUARD;
+import static com.android.sdklib.SdkConstants.FD_TOOLS;
+import static com.android.sdklib.SdkConstants.FN_ANDROID_PROGUARD_FILE;
+import static com.android.sdklib.SdkConstants.FN_PROJECT_PROGUARD_FILE;
+
import com.android.io.FolderWrapper;
import com.android.io.IAbstractFile;
import com.android.io.IAbstractFolder;
@@ -24,6 +29,7 @@ import com.android.sdklib.ISdkLog;
import com.android.sdklib.SdkConstants;
import java.io.BufferedReader;
+import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -163,7 +169,7 @@ public class ProjectProperties {
"# This file is automatically generated by Android Tools.\n" +
"# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n" +
"#\n" +
- "# This file must *NOT* be checked in Version Control Systems,\n" +
+ "# This file must *NOT* be checked into Version Control Systems,\n" +
"# as it contains information specific to your local configuration.\n" +
"\n";
@@ -174,16 +180,22 @@ public class ProjectProperties {
"#\n" +
"# This file must be checked in Version Control Systems.\n" +
"#\n" +
- "# To customize properties used by the Ant build system use,\n" +
+ "# To customize properties used by the Ant build system edit\n" +
"# \"ant.properties\", and override values to adapt the script to your\n" +
"# project structure.\n" +
+ "#\n" +
+ "# To enable ProGuard to shrink and obfuscate your code, uncomment this "
+ + "(available properties: sdk.dir, user.home):\n" +
+ "#" + PROPERTY_PROGUARD_CONFIG + "=${" + PROPERTY_SDK +"}" + File.separator
+ + FD_TOOLS + File.separator + FD_PROGUARD + File.separator
+ + FN_ANDROID_PROGUARD_FILE + ':' + FN_PROJECT_PROGUARD_FILE +'\n' +
"\n";
private final static String BUILD_HEADER =
// 1-------10--------20--------30--------40--------50--------60--------70--------80
"# This file is used to override default values used by the Ant build system.\n" +
"#\n" +
- "# This file must be checked in Version Control Systems, as it is\n" +
+ "# This file must be checked into Version Control Systems, as it is\n" +
"# integral to the build system of your project.\n" +
"\n" +
"# This file is only used by the Ant script.\n" +