SDK: source.properties templates.

This adds support for "templates" source.properties files that can
inherit the platform version/codename/api level from the build.

The purpose is for a given build to always generate SDK files that
match the platform generated in the same branch.

Change-Id: Id623bbef45a04d953da8eade7e8c34c77709f9c3
diff --git a/sdk/doc_source.prop_template b/sdk/doc_source.prop_template
new file mode 100644
index 0000000..d3cdfd5
--- /dev/null
+++ b/sdk/doc_source.prop_template
@@ -0,0 +1,4 @@
+Pkg.UserSrc=false
+Pkg.Revision=1
+AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
+AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
diff --git a/sdk/doc_source.properties b/sdk/doc_source.properties
deleted file mode 100644
index 5b3dce6..0000000
--- a/sdk/doc_source.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-Pkg.UserSrc=false
-Pkg.Revision=1
-AndroidVersion.ApiLevel=15
-#AndroidVersion.CodeName=
-
diff --git a/sdk/images_armeabi-v7a_source.prop_template b/sdk/images_armeabi-v7a_source.prop_template
new file mode 100644
index 0000000..ae67647
--- /dev/null
+++ b/sdk/images_armeabi-v7a_source.prop_template
@@ -0,0 +1,6 @@
+Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
+Pkg.UserSrc=false
+Pkg.Revision=1
+AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
+AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
+SystemImage.Abi=armeabi-v7a
diff --git a/sdk/images_armeabi-v7a_source.properties b/sdk/images_armeabi-v7a_source.properties
deleted file mode 100644
index 9280fdd..0000000
--- a/sdk/images_armeabi-v7a_source.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-Pkg.Desc=Android SDK Platform 4.1
-Pkg.UserSrc=false
-Pkg.Revision=1
-AndroidVersion.ApiLevel=15
-#AndroidVersion.CodeName=
-SystemImage.Abi=armeabi-v7a
diff --git a/sdk/images_armeabi_source.prop_template b/sdk/images_armeabi_source.prop_template
new file mode 100644
index 0000000..b100e53
--- /dev/null
+++ b/sdk/images_armeabi_source.prop_template
@@ -0,0 +1,6 @@
+Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
+Pkg.UserSrc=false
+Pkg.Revision=1
+AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
+AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
+SystemImage.Abi=armeabi
diff --git a/sdk/images_armeabi_source.properties b/sdk/images_armeabi_source.properties
deleted file mode 100644
index 63fc677..0000000
--- a/sdk/images_armeabi_source.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-Pkg.Desc=Android SDK Platform 4.1
-Pkg.UserSrc=false
-Pkg.Revision=1
-AndroidVersion.ApiLevel=15
-#AndroidVersion.CodeName=
-SystemImage.Abi=armeabi
diff --git a/sdk/images_x86_source.prop_template b/sdk/images_x86_source.prop_template
new file mode 100644
index 0000000..62e2e0d
--- /dev/null
+++ b/sdk/images_x86_source.prop_template
@@ -0,0 +1,6 @@
+Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
+Pkg.UserSrc=false
+Pkg.Revision=1
+AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
+AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
+SystemImage.Abi=x86
diff --git a/sdk/images_x86_source.properties b/sdk/images_x86_source.properties
deleted file mode 100644
index bb82577..0000000
--- a/sdk/images_x86_source.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-Pkg.Desc=Android SDK Platform 4.1
-Pkg.UserSrc=false
-Pkg.Revision=1
-AndroidVersion.ApiLevel=15
-#AndroidVersion.CodeName=
-SystemImage.Abi=x86
diff --git a/sdk/platform_source.prop_template b/sdk/platform_source.prop_template
new file mode 100644
index 0000000..17a5e4e
--- /dev/null
+++ b/sdk/platform_source.prop_template
@@ -0,0 +1,9 @@
+Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
+Pkg.UserSrc=false
+Platform.Version=${PLATFORM_VERSION}
+Pkg.Revision=1
+AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
+AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
+Layoutlib.Api=7
+Layoutlib.Revision=1
+Platform.MinToolsRev=15
diff --git a/sdk/platform_source.properties b/sdk/platform_source.properties
deleted file mode 100644
index 0e70356..0000000
--- a/sdk/platform_source.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-Pkg.Desc=Android SDK Platform 4.1
-Pkg.UserSrc=false
-Platform.Version=4.1
-Pkg.Revision=1
-AndroidVersion.ApiLevel=15
-#AndroidVersion.CodeName=
-Layoutlib.Api=7
-Layoutlib.Revision=1
-Platform.MinToolsRev=15
diff --git a/sdk/source_source.prop_template b/sdk/source_source.prop_template
new file mode 100644
index 0000000..d3cdfd5
--- /dev/null
+++ b/sdk/source_source.prop_template
@@ -0,0 +1,4 @@
+Pkg.UserSrc=false
+Pkg.Revision=1
+AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
+AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
diff --git a/sdk/source_source.properties b/sdk/source_source.properties
deleted file mode 100644
index d0b390b..0000000
--- a/sdk/source_source.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-Pkg.UserSrc=false
-Pkg.Revision=1
-AndroidVersion.ApiLevel=15
-#AndroidVersion.CodeName=
diff --git a/sdk/support_source.properties b/sdk/support_source.properties
index 16d5cd8..28d3579 100644
--- a/sdk/support_source.properties
+++ b/sdk/support_source.properties
@@ -3,4 +3,3 @@
 Extra.Vendor=android
 Extra.Path=support
 Extra.OldPaths=compatibility
-