aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--anttasks/src/com/android/ant/AaptExecTask.java38
-rw-r--r--files/ant/build.xml4
-rw-r--r--files/proguard-android.txt29
-rw-r--r--templates/build.template16
-rw-r--r--testapps/customPropAnimTest/.classpath8
-rw-r--r--testapps/customPropAnimTest/.project33
-rw-r--r--testapps/customPropAnimTest/AndroidManifest.xml23
-rw-r--r--testapps/customPropAnimTest/build.xml90
-rw-r--r--testapps/customPropAnimTest/proguard-project.txt20
-rw-r--r--testapps/customPropAnimTest/project.properties15
-rw-r--r--testapps/customPropAnimTest/res/drawable-hdpi/ic_launcher.pngbin0 -> 9397 bytes
-rw-r--r--testapps/customPropAnimTest/res/drawable-ldpi/ic_launcher.pngbin0 -> 2729 bytes
-rw-r--r--testapps/customPropAnimTest/res/drawable-mdpi/ic_launcher.pngbin0 -> 5237 bytes
-rw-r--r--testapps/customPropAnimTest/res/drawable-xhdpi/ic_launcher.pngbin0 -> 14383 bytes
-rw-r--r--testapps/customPropAnimTest/res/layout/main.xml8
-rw-r--r--testapps/customPropAnimTest/res/values/strings.xml7
-rw-r--r--testapps/customPropAnimTest/src/com/android/custompropertyanimation/CustomPropertyAnimationActivity.java22
-rw-r--r--testapps/customPropAnimTest/src/com/android/custompropertyanimation/MyView.java24
-rw-r--r--testapps/customViewTest/libWithCustomView/build.xml39
-rw-r--r--testapps/customViewTest/mainProject/build.xml39
-rw-r--r--testapps/customViewTest/mainProject/proguard.cfg40
-rw-r--r--testapps/customViewTest/mainProject/project.properties3
-rw-r--r--testapps/customViewTest/mainProject/res/values/strings.xml2
-rw-r--r--testapps/libsAndJarTest/app/build.xml11
-rw-r--r--testapps/libsAndJarTest/app/project.properties6
-rw-r--r--testapps/libsAndJarTest/lib1/build.xml11
-rw-r--r--testapps/libsAndJarTest/lib2/build.xml11
27 files changed, 365 insertions, 134 deletions
diff --git a/anttasks/src/com/android/ant/AaptExecTask.java b/anttasks/src/com/android/ant/AaptExecTask.java
index 2b57277..c96f7d0 100644
--- a/anttasks/src/com/android/ant/AaptExecTask.java
+++ b/anttasks/src/com/android/ant/AaptExecTask.java
@@ -97,6 +97,7 @@ public final class AaptExecTask extends SingleDependencyTask {
private String mLibraryPackagesRefid;
private boolean mNonConstantId;
private String mIgnoreAssets;
+ private String mProguardFile;
/**
* Input path that ignores the same folders/files that aapt does.
@@ -321,6 +322,10 @@ public final class AaptExecTask extends SingleDependencyTask {
mLibraryPackagesRefid = libraryPackagesRefid;
}
+ public void setProguardFile(Path proguardFile) {
+ mProguardFile = TaskHelper.checkSinglePath("proguardFile", proguardFile);
+ }
+
/**
* Returns an object representing a nested <var>nocompress</var> element.
*/
@@ -344,6 +349,11 @@ public final class AaptExecTask extends SingleDependencyTask {
return path;
}
+ @Override
+ protected String getExecTaskName() {
+ return "aapt";
+ }
+
/*
* (non-Javadoc)
*
@@ -375,24 +385,6 @@ public final class AaptExecTask extends SingleDependencyTask {
libPkgProp = libPkgProp.replace(';', ':');
}
}
- // Call aapt. If there are libraries, we'll pass a non-null string of libs.
- callAapt(libPkgProp);
- }
-
- @Override
- protected String getExecTaskName() {
- return "aapt";
- }
-
- /**
- * Calls aapt with the given parameters.
- * @param resourceFilter the resource configuration filter to pass to aapt (if configName is
- * non null)
- * @param extraPackages an optional list of colon-separated packages. Can be null
- * Ex: com.foo.one:com.foo.two:com.foo.lib
- */
- private void callAapt(String extraPackages) {
- Project taskProject = getProject();
final boolean generateRClass = mRFolder != null && new File(mRFolder).isDirectory();
@@ -538,9 +530,9 @@ public final class AaptExecTask extends SingleDependencyTask {
}
}
- if (mNonConstantId == false && extraPackages != null && extraPackages.length() > 0) {
+ if (mNonConstantId == false && libPkgProp != null && libPkgProp.length() > 0) {
task.createArg().setValue("--extra-packages");
- task.createArg().setValue(extraPackages);
+ task.createArg().setValue(libPkgProp);
}
// if the project contains libraries, force auto-add-overlay
@@ -635,6 +627,12 @@ public final class AaptExecTask extends SingleDependencyTask {
// Use dependency generation
task.createArg().setValue("--generate-dependencies");
+ // use the proguard file
+ if (mProguardFile != null && mProguardFile.length() > 0) {
+ task.createArg().setValue("-G");
+ task.createArg().setValue(mProguardFile);
+ }
+
// final setup of the task
task.setProject(taskProject);
task.setOwningTarget(getOwningTarget());
diff --git a/files/ant/build.xml b/files/ant/build.xml
index 1f85f5e..cd1bc7d 100644
--- a/files/ant/build.xml
+++ b/files/ant/build.xml
@@ -648,7 +648,8 @@
nonConstantId="${android.library}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
- ignoreAssets="${aapt.ignore.assets}">
+ ignoreAssets="${aapt.ignore.assets}"
+ proguardFile="${out.absolute.dir}/proguard.txt">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
</aapt>
@@ -821,6 +822,7 @@
destfile="${preobfuscate.jar.file}" />
<proguard>
-include "${proguard.configcmd}"
+ -include "${out.absolute.dir}/proguard.txt"
-injars ${project.all.classes.value}
-outjars "${obfuscated.jar.file}"
-libraryjars ${project.target.classpath.value}
diff --git a/files/proguard-android.txt b/files/proguard-android.txt
index 6613823..3cc5c8a 100644
--- a/files/proguard-android.txt
+++ b/files/proguard-android.txt
@@ -24,15 +24,7 @@
# file from your project's proguard.config path property.
-keepattributes *Annotation*
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgent
--keep public class * extends android.preference.Preference
--keep public class * extends android.support.v4.app.Fragment
--keep public class * extends android.app.Fragment
+-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
@@ -40,21 +32,14 @@
native <methods>;
}
--keep public class * extends android.view.View {
- public <init>(android.content.Context);
- public <init>(android.content.Context, android.util.AttributeSet);
- public <init>(android.content.Context, android.util.AttributeSet, int);
- public void set*(...);
-}
-
--keepclasseswithmembers class * {
- public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
- public <init>(android.content.Context, android.util.AttributeSet, int);
+# keep setters in Views so that animations can still work.
+# see http://proguard.sourceforge.net/manual/examples.html#beans
+-keepclassmembers public class * extends android.view.View {
+ void set*(***);
+ *** get*();
}
+# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
diff --git a/templates/build.template b/templates/build.template
index 1ab7ea2..aea57a2 100644
--- a/templates/build.template
+++ b/templates/build.template
@@ -28,6 +28,15 @@
-->
<property file="ant.properties" />
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var.
+ This must be done before we load project.properties since
+ the proguard config can use sdk.dir -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
@@ -39,13 +48,6 @@
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
- <!-- if sdk.dir was not set from one of the property file, then
- get it from the ANDROID_HOME env var. -->
- <property environment="env" />
- <condition property="sdk.dir" value="${env.ANDROID_HOME}">
- <isset property="env.ANDROID_HOME" />
- </condition>
-
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
diff --git a/testapps/customPropAnimTest/.classpath b/testapps/customPropAnimTest/.classpath
new file mode 100644
index 0000000..a4763d1
--- /dev/null
+++ b/testapps/customPropAnimTest/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
diff --git a/testapps/customPropAnimTest/.project b/testapps/customPropAnimTest/.project
new file mode 100644
index 0000000..0d12fe9
--- /dev/null
+++ b/testapps/customPropAnimTest/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>customPropAnimTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/testapps/customPropAnimTest/AndroidManifest.xml b/testapps/customPropAnimTest/AndroidManifest.xml
new file mode 100644
index 0000000..72c58d0
--- /dev/null
+++ b/testapps/customPropAnimTest/AndroidManifest.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.custompropertyanimation"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk android:minSdkVersion="15" />
+
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name" >
+ <activity
+ android:name=".CustomPropertyAnimationActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest> \ No newline at end of file
diff --git a/testapps/customPropAnimTest/build.xml b/testapps/customPropAnimTest/build.xml
new file mode 100644
index 0000000..d6ee0bc
--- /dev/null
+++ b/testapps/customPropAnimTest/build.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="CustomPropertyAnimationActivity" default="help">
+
+ <!-- The local.properties file is created and updated by the 'android' tool.
+ It contains the path to the SDK. It should *NOT* be checked into
+ Version Control Systems. -->
+ <property file="local.properties" />
+
+ <!-- The ant.properties file can be created by you. It is only edited by the
+ 'android' tool to add properties to it.
+ This is the place to change some Ant specific build properties.
+ Here are some properties you may want to change/update:
+
+ source.dir
+ The name of the source directory. Default is 'src'.
+ out.dir
+ The name of the output directory. Default is 'bin'.
+
+ For other overridable properties, look at the beginning of the rules
+ files in the SDK, at tools/ant/build.xml
+
+ Properties related to the SDK location or the project target should
+ be updated using the 'android' tool with the 'update' action.
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems.
+
+ -->
+ <property file="ant.properties" />
+
+ <!-- The project.properties file is created and updated by the 'android'
+ tool, as well as ADT.
+
+ This contains project specific properties such as project target, and library
+ dependencies. Lower level build properties are stored in ant.properties
+ (or in .classpath for Eclipse projects).
+
+ This file is an integral part of the build system for your
+ application and should be checked into Version Control Systems. -->
+ <loadproperties srcFile="project.properties" />
+
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var. -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
+ <!-- quick check on sdk.dir -->
+ <fail
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
+ unless="sdk.dir"
+ />
+
+ <!--
+ Import per project custom build rules if present at the root of the project.
+ This is the place to put custom intermediary targets such as:
+ -pre-build
+ -pre-compile
+ -post-compile (This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir})
+ -post-package
+ -post-build
+ -pre-clean
+ -->
+ <import file="custom_rules.xml" optional="true" />
+
+ <!-- Import the actual build file.
+
+ To customize existing targets, there are two options:
+ - Customize only one target:
+ - copy/paste the target into this file, *before* the
+ <import> task.
+ - customize it to your needs.
+ - Customize the whole content of build.xml
+ - copy/paste the content of the rules files (minus the top node)
+ into this file, replacing the <import> task.
+ - customize to your needs.
+
+ ***********************
+ ****** IMPORTANT ******
+ ***********************
+ In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+ in order to avoid having your file be overridden by tools such as "android update project"
+ -->
+ <!-- version-tag: 1 -->
+ <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>
diff --git a/testapps/customPropAnimTest/proguard-project.txt b/testapps/customPropAnimTest/proguard-project.txt
new file mode 100644
index 0000000..f2fe155
--- /dev/null
+++ b/testapps/customPropAnimTest/proguard-project.txt
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/testapps/customPropAnimTest/project.properties b/testapps/customPropAnimTest/project.properties
new file mode 100644
index 0000000..1a88dc6
--- /dev/null
+++ b/testapps/customPropAnimTest/project.properties
@@ -0,0 +1,15 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-15
+
diff --git a/testapps/customPropAnimTest/res/drawable-hdpi/ic_launcher.png b/testapps/customPropAnimTest/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..96a442e
--- /dev/null
+++ b/testapps/customPropAnimTest/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/testapps/customPropAnimTest/res/drawable-ldpi/ic_launcher.png b/testapps/customPropAnimTest/res/drawable-ldpi/ic_launcher.png
new file mode 100644
index 0000000..9923872
--- /dev/null
+++ b/testapps/customPropAnimTest/res/drawable-ldpi/ic_launcher.png
Binary files differ
diff --git a/testapps/customPropAnimTest/res/drawable-mdpi/ic_launcher.png b/testapps/customPropAnimTest/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..359047d
--- /dev/null
+++ b/testapps/customPropAnimTest/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/testapps/customPropAnimTest/res/drawable-xhdpi/ic_launcher.png b/testapps/customPropAnimTest/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..71c6d76
--- /dev/null
+++ b/testapps/customPropAnimTest/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/testapps/customPropAnimTest/res/layout/main.xml b/testapps/customPropAnimTest/res/layout/main.xml
new file mode 100644
index 0000000..40f9f1a
--- /dev/null
+++ b/testapps/customPropAnimTest/res/layout/main.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:id="@+id/container">
+
+</LinearLayout> \ No newline at end of file
diff --git a/testapps/customPropAnimTest/res/values/strings.xml b/testapps/customPropAnimTest/res/values/strings.xml
new file mode 100644
index 0000000..9c3c31b
--- /dev/null
+++ b/testapps/customPropAnimTest/res/values/strings.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <string name="hello">Hello World, CustomPropertyAnimationActivity!</string>
+ <string name="app_name">CustomPropertyAnimation</string>
+
+</resources> \ No newline at end of file
diff --git a/testapps/customPropAnimTest/src/com/android/custompropertyanimation/CustomPropertyAnimationActivity.java b/testapps/customPropAnimTest/src/com/android/custompropertyanimation/CustomPropertyAnimationActivity.java
new file mode 100644
index 0000000..b1b91b9
--- /dev/null
+++ b/testapps/customPropAnimTest/src/com/android/custompropertyanimation/CustomPropertyAnimationActivity.java
@@ -0,0 +1,22 @@
+package com.android.custompropertyanimation;
+
+import android.animation.ObjectAnimator;
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.LinearLayout;
+
+public class CustomPropertyAnimationActivity extends Activity {
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ LinearLayout container = (LinearLayout) findViewById(R.id.container);
+
+ MyView view = new MyView(this);
+ container.addView(view);
+
+ ObjectAnimator anim = ObjectAnimator.ofFloat(view, "foo", 1);
+ anim.start();
+ }
+} \ No newline at end of file
diff --git a/testapps/customPropAnimTest/src/com/android/custompropertyanimation/MyView.java b/testapps/customPropAnimTest/src/com/android/custompropertyanimation/MyView.java
new file mode 100644
index 0000000..e557fda
--- /dev/null
+++ b/testapps/customPropAnimTest/src/com/android/custompropertyanimation/MyView.java
@@ -0,0 +1,24 @@
+package com.android.custompropertyanimation;
+
+import android.content.Context;
+import android.view.View;
+
+public class MyView extends View {
+
+ float mFoo = 0;
+
+ public MyView(Context context) {
+ super(context);
+ }
+
+ public void setFoo(float foo) {
+ System.out.println("foo = " + foo);
+ mFoo = foo;
+ }
+
+ public float getFoo() {
+ System.out.println("getFoo() returning " + mFoo);
+ return mFoo;
+ }
+
+}
diff --git a/testapps/customViewTest/libWithCustomView/build.xml b/testapps/customViewTest/libWithCustomView/build.xml
index 772f422..7d9e032 100644
--- a/testapps/customViewTest/libWithCustomView/build.xml
+++ b/testapps/customViewTest/libWithCustomView/build.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="basicLibWithSupport" default="help">
+<project name="libWithCustomView" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
@@ -39,27 +39,32 @@
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var. -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
<!-- quick check on sdk.dir -->
<fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
- in between standard targets -->
-<!--
- <target name="-pre-build">
- </target>
- <target name="-pre-compile">
- </target>
-
- /* This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir} */
- <target name="-post-compile">
- </target>
--->
+ <!--
+ Import per project custom build rules if present at the root of the project.
+ This is the place to put custom intermediary targets such as:
+ -pre-build
+ -pre-compile
+ -post-compile (This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir})
+ -post-package
+ -post-build
+ -pre-clean
+ -->
+ <import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
diff --git a/testapps/customViewTest/mainProject/build.xml b/testapps/customViewTest/mainProject/build.xml
index f3a3d91..2f98bb5 100644
--- a/testapps/customViewTest/mainProject/build.xml
+++ b/testapps/customViewTest/mainProject/build.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="basicProjectWithSupport" default="help">
+<project name="customViewTest-mainProject" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
@@ -39,27 +39,32 @@
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var. -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
<!-- quick check on sdk.dir -->
<fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
- in between standard targets -->
-<!--
- <target name="-pre-build">
- </target>
- <target name="-pre-compile">
- </target>
-
- /* This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir} */
- <target name="-post-compile">
- </target>
--->
+ <!--
+ Import per project custom build rules if present at the root of the project.
+ This is the place to put custom intermediary targets such as:
+ -pre-build
+ -pre-compile
+ -post-compile (This is typically used for code obfuscation.
+ Compiled code location: ${out.classes.absolute.dir}
+ If this is not done in place, override ${out.dex.input.absolute.dir})
+ -post-package
+ -post-build
+ -pre-clean
+ -->
+ <import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
diff --git a/testapps/customViewTest/mainProject/proguard.cfg b/testapps/customViewTest/mainProject/proguard.cfg
deleted file mode 100644
index b1cdf17..0000000
--- a/testapps/customViewTest/mainProject/proguard.cfg
+++ /dev/null
@@ -1,40 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
- native <methods>;
-}
-
--keepclasseswithmembers class * {
- public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
- public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
- public void *(android.view.View);
-}
-
--keepclassmembers enum * {
- public static **[] values();
- public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
- public static final android.os.Parcelable$Creator *;
-}
diff --git a/testapps/customViewTest/mainProject/project.properties b/testapps/customViewTest/mainProject/project.properties
index b80c0cf..21d68c5 100644
--- a/testapps/customViewTest/mainProject/project.properties
+++ b/testapps/customViewTest/mainProject/project.properties
@@ -10,3 +10,6 @@
# Project target.
target=android-15
android.library.reference.1=../libWithCustomView
+
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
diff --git a/testapps/customViewTest/mainProject/res/values/strings.xml b/testapps/customViewTest/mainProject/res/values/strings.xml
index 3fa203a..e86ca41 100644
--- a/testapps/customViewTest/mainProject/res/values/strings.xml
+++ b/testapps/customViewTest/mainProject/res/values/strings.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">MyActivity</string>
+ <string name="app_name">customViewTest</string>
</resources>
diff --git a/testapps/libsAndJarTest/app/build.xml b/testapps/libsAndJarTest/app/build.xml
index 1160e8a..c084512 100644
--- a/testapps/libsAndJarTest/app/build.xml
+++ b/testapps/libsAndJarTest/app/build.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="app" default="help">
+<project name="libsAndJarTest-app" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
@@ -28,6 +28,13 @@
-->
<property file="ant.properties" />
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var. -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
@@ -41,7 +48,7 @@
<!-- quick check on sdk.dir -->
<fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
diff --git a/testapps/libsAndJarTest/app/project.properties b/testapps/libsAndJarTest/app/project.properties
index 4fe0502..9df4221 100644
--- a/testapps/libsAndJarTest/app/project.properties
+++ b/testapps/libsAndJarTest/app/project.properties
@@ -7,9 +7,9 @@
# "ant.properties", and override values to adapt the script to your
# project structure.
#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
# Project target.
target=android-15
android.library.reference.1=../lib1
+
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
diff --git a/testapps/libsAndJarTest/lib1/build.xml b/testapps/libsAndJarTest/lib1/build.xml
index 2a15ae6..ed25521 100644
--- a/testapps/libsAndJarTest/lib1/build.xml
+++ b/testapps/libsAndJarTest/lib1/build.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="lib1" default="help">
+<project name="libsAndJarTest-lib1" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
@@ -39,9 +39,16 @@
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var. -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
<!-- quick check on sdk.dir -->
<fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
diff --git a/testapps/libsAndJarTest/lib2/build.xml b/testapps/libsAndJarTest/lib2/build.xml
index 3d36fda..4f351c8 100644
--- a/testapps/libsAndJarTest/lib2/build.xml
+++ b/testapps/libsAndJarTest/lib2/build.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="lib2" default="help">
+<project name="libsAndJarTest-lib2" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
@@ -39,9 +39,16 @@
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
+ <!-- if sdk.dir was not set from one of the property file, then
+ get it from the ANDROID_HOME env var. -->
+ <property environment="env" />
+ <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+ <isset property="env.ANDROID_HOME" />
+ </condition>
+
<!-- quick check on sdk.dir -->
<fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+ message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>