Merge "AVD/SDK Launchers win build." into idea133
automerge: c86e450

* commit 'c86e450e6ad3bdc6a8ba134e7c56ecb49e8a38ee':
  AVD/SDK Launchers win build.
diff --git a/adtproductbuild/build.xml b/adtproductbuild/build.xml
index 4c5cbb9..3b53823 100644
--- a/adtproductbuild/build.xml
+++ b/adtproductbuild/build.xml
@@ -100,15 +100,15 @@
         <mkdir dir="${targetDir}/deltapack" />
         <mkdir dir="${targetDir}/repos" />
 
-        <unzip src="${deltaPackTargetSrcDir}/deltapack/eclipse-4.2.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" />
-        <unzip src="${targetSrcDir}/platform/org.eclipse.platform-4.2.2.zip" dest="${targetDir}/repos/platform" overwrite="false" />
-        <unzip src="${targetSrcDir}/cdt/cdt-master-8.0.2.zip" dest="${targetDir}/repos/cdt" overwrite="false" />
-        <unzip src="${targetSrcDir}/emf/emf-xsd-SDK-M201201231045.zip" dest="${targetDir}/repos/emf" overwrite="false" />
-        <unzip src="${targetSrcDir}/jdt/org.eclipse.jdt.source-4.2.2.zip" dest="${targetDir}/repos/jdt" overwrite="false" />
-        <unzip src="${targetSrcDir}/wtp/wtp-repo-R-3.3.2-20120210195245.zip" dest="${targetDir}/repos/wtp" overwrite="false" />
-        <unzip src="${targetSrcDir}/gef/GEF-SDK-3.7.2.zip" dest="${targetDir}/repos/gef" overwrite="false" />
-        <unzip src="${targetSrcDir}/pde/org.eclipse.pde-3.8.zip" dest="${targetDir}/repos/pde" overwrite="false" />
-        <unzip src="${targetSrcDir}/egit/org.eclipse.egit.repository-2.2.0.201212191850-r.zip" dest="${targetDir}/repos/egit" overwrite="false" />
+        <unzip src="${deltaPackTargetSrcDir}/deltapack/eclipse-4.3.1-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" />
+        <unzip src="${targetSrcDir}/platform/org.eclipse.platform-4.3.1.zip" dest="${targetDir}/repos/platform" overwrite="false" />
+        <unzip src="${targetSrcDir}/cdt/cdt-master-8.2.1.zip" dest="${targetDir}/repos/cdt" overwrite="false" />
+        <unzip src="${targetSrcDir}/emf/emf-xsd-SDK-2.9.1.zip" dest="${targetDir}/repos/emf" overwrite="false" />
+        <unzip src="${targetSrcDir}/jdt/org.eclipse.jdt.source-4.3.1.zip" dest="${targetDir}/repos/jdt" overwrite="false" />
+        <unzip src="${targetSrcDir}/wtp/wtp4x-repo-R-3.5.1-20130913223750.zip" dest="${targetDir}/repos/wtp" overwrite="false" />
+        <unzip src="${targetSrcDir}/gef/GEF-SDK-3.9.1RC1.zip" dest="${targetDir}/repos/gef" overwrite="false" />
+        <unzip src="${targetSrcDir}/pde/org.eclipse.pde-4.3.1.zip" dest="${targetDir}/repos/pde" overwrite="false" />
+        <unzip src="${targetSrcDir}/egit/org.eclipse.egit.repository-3.1.0.201310021548-r.zip" dest="${targetDir}/repos/egit" overwrite="false" />
     </target>
 
     <target name="create-translation-target" if="translation.plugin.present">
diff --git a/build/patch_windows_sdk.sh b/build/patch_windows_sdk.sh
index 54fc7b7..addcc02 100755
--- a/build/patch_windows_sdk.sh
+++ b/build/patch_windows_sdk.sh
@@ -23,12 +23,11 @@
 set -e # any error stops the build
 
 # Verbose by default. Use -q to make more silent.
-V=""
 if [[ "$1" == "-q" ]]; then
   shift
 else
   echo "Win SDK: $0 $*"
-  set -x # show bash commands; no need for V=-v
+  set -x # show bash commands
 fi
 
 TEMP_SDK_DIR=$1
@@ -36,9 +35,10 @@
 TOPDIR=${TOPDIR:-$3}
 
 # Invoke atree to copy the files
-# TODO: pass down OUT_HOST_EXECUTABLE to get the right bin/atree directory
-${TOPDIR}out/host/linux-x86/bin/atree -f ${TOPDIR}sdk/build/tools.windows.atree \
-      -I $WIN_OUT_DIR/host/windows-x86 \
-      -I ${TOPDIR:-.} \
-      -o $TEMP_SDK_DIR
+if [[ -f ${TOPDIR}sdk/build/tools.windows.atree ]]; then
+  ${TOPDIR}out/host/linux-x86/bin/atree -f ${TOPDIR}sdk/build/tools.windows.atree \
+        -I $WIN_OUT_DIR/host/windows-x86 \
+        -I ${TOPDIR:-.} \
+        -o $TEMP_SDK_DIR
+fi
 
diff --git a/build/product_sdk.mk b/build/product_sdk.mk
index 7938300..f1acd5f 100644
--- a/build/product_sdk.mk
+++ b/build/product_sdk.mk
@@ -27,10 +27,4 @@
 
 # Host tools and java libraries that are parts of the SDK.
 PRODUCT_PACKAGES += \
-#	ant-glob \
-#	annotations \
-#	mksdcard \
-#	monitor \
-#	fastboot \
-#	emugen
 
diff --git a/build/tools.atree.old b/build/tools.atree.old
deleted file mode 100644
index 7a992df..0000000
--- a/build/tools.atree.old
+++ /dev/null
@@ -1,140 +0,0 @@
-#
-# Copyright (C) 2010 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-##############################################################################
-# Tools Component
-##############################################################################
-
-#
-# These are the files that comprise the tools component of the SDK.
-#
-
-prebuilts/devtools/tools/lib                        tools/lib
-prebuilts/devtools/notices/NOTICE.txt               tools/NOTICE.txt
-
-prebuilts/devtools/tools/android                    tools/android
-prebuilts/devtools/tools/draw9patch                 tools/draw9patch
-prebuilts/devtools/tools/ddms                       tools/ddms
-prebuilts/devtools/tools/hierarchyviewer            tools/hierarchyviewer
-prebuilts/devtools/tools/jobb                       tools/jobb
-prebuilts/devtools/tools/lint                       tools/lint
-prebuilts/devtools/tools/monkeyrunner               tools/monkeyrunner
-prebuilts/devtools/tools/traceview                  tools/traceview
-prebuilts/devtools/tools/uiautomatorviewer          tools/uiautomatorviewer
-
-
-
-# version files for the SDK updater, from sdk.git
-sdk/files/tools_source.properties                   tools/source.properties
-
-# copy plugin.prop from sdk.git
-sdk/files/plugin.prop                               tools/lib/plugin.prop
-
-# readme regarding adb move to platform-tools
-sdk/files/adb_has_moved.txt                         tools/adb_has_moved.txt
-
-# native host tools from out/host/$(HOST_OS)-$(HOST_ARCH)/
-bin/sqlite3                                   strip tools/sqlite3
-bin/dmtracedump                               strip tools/dmtracedump
-bin/etc1tool                                  strip tools/etc1tool
-bin/hprof-conv                                strip tools/hprof-conv
-bin/mksdcard                                  strip tools/mksdcard
-
-# emulator
-###RM(2014-05-05) temporarily do not include emulator in sdk
-###bin/emulator                                  strip tools/emulator
-###bin/emulator-x86                              strip tools/emulator-x86
-###bin/emulator-arm                              strip tools/emulator-arm
-###bin/emulator-mips                             strip tools/emulator-mips
-###bin/emulator64-x86                            strip tools/emulator64-x86
-###bin/emulator64-arm                            strip tools/emulator64-arm
-###bin/emulator64-mips                           strip tools/emulator64-mips
-###sdk/emulator/snapshot/snapshots.img                 tools/lib/emulator/snapshots.img
-###usr/share/pc-bios/bios.bin                          tools/lib/pc-bios/bios.bin
-###usr/share/pc-bios/vgabios-cirrus.bin                tools/lib/pc-bios/vgabios-cirrus.bin
-###sdk/emulator/skins/dynamic                          tools/lib/emulator/skins/dynamic
-###
-#### OpenGLES emulation libraries
-###lib/libOpenglRender${DLL_EXTENSION}           strip tools/lib/libOpenglRender${DLL_EXTENSION}
-###lib/libGLES_CM_translator${DLL_EXTENSION}     strip tools/lib/libGLES_CM_translator${DLL_EXTENSION}
-###lib/libGLES_V2_translator${DLL_EXTENSION}     strip tools/lib/libGLES_V2_translator${DLL_EXTENSION}
-###lib/libEGL_translator${DLL_EXTENSION}         strip tools/lib/libEGL_translator${DLL_EXTENSION}
-###lib/lib64OpenglRender${DLL_EXTENSION}         strip tools/lib/lib64OpenglRender${DLL_EXTENSION}
-###lib/lib64GLES_CM_translator${DLL_EXTENSION}   strip tools/lib/lib64GLES_CM_translator${DLL_EXTENSION}
-###lib/lib64GLES_V2_translator${DLL_EXTENSION}   strip tools/lib/lib64GLES_V2_translator${DLL_EXTENSION}
-###lib/lib64EGL_translator${DLL_EXTENSION}       strip tools/lib/lib64EGL_translator${DLL_EXTENSION}
-
-
-# sdk.git Ant and gradle templates for project build files
-sdk/templates/build.template                        tools/lib/build.template
-sdk/templates/uibuild.template                      tools/lib/uibuild.template
-sdk/templates/build_gradle.template                 tools/lib/build_gradle.template
-sdk/files/proguard-project.txt                      tools/lib/proguard-project.txt
-sdk/files/proguard-android.txt                      tools/proguard/proguard-android.txt
-sdk/files/proguard-android-optimize.txt             tools/proguard/proguard-android-optimize.txt
-
-# Ant Build Rules
-sdk/files/ant                                       tools/ant
-sdk/files/sdk_files_NOTICE.txt                      tools/ant/NOTICE.txt
-
-# layout device definition
-sdk/files/devices.xml                               tools/lib/devices.xml
-
-# AVD Hardware property list
-external/qemu/android/avd/hardware-properties.ini   tools/lib/hardware-properties.ini
-
-# emacs support from sdk.git
-sdk/files/android.el tools/lib/android.el
-
-# 3rd Party java libraries
-framework/emmalib.jar                                                               tools/lib/emma_device.jar
-external/emma/lib/emma.jar                                                          tools/lib/emma.jar
-external/emma/lib/emma_ant.jar                                                      tools/lib/emma_ant.jar
-
-# Proguard
-# We're skipping the build and src/ trees (except for src/proguard/ant/task.properties)
-# and copying in a license.html file
-prebuilts/tools/common/proguard/license.html                   tools/proguard/license.html
-prebuilts/tools/common/proguard/proguard4.7/README             tools/proguard/README
-prebuilts/tools/common/proguard/proguard4.7/docs               tools/proguard/docs
-prebuilts/tools/common/proguard/proguard4.7/examples           tools/proguard/examples
-prebuilts/tools/common/proguard/proguard4.7/lib                tools/proguard/lib
-prebuilts/tools/common/proguard/proguard4.7/bin/proguard.sh    tools/proguard/bin/proguard.sh
-prebuilts/tools/common/proguard/proguard4.7/bin/proguardgui.sh tools/proguard/bin/proguardgui.sh
-prebuilts/tools/common/proguard/proguard4.7/bin/retrace.sh     tools/proguard/bin/retrace.sh
-prebuilts/tools/common/proguard/proguard4.7/src/proguard/ant/task.properties  tools/proguard/ant/task.properties
-
-# Templates
-tools/base/templates/projects                  tools/templates/projects
-tools/base/templates/activities                tools/templates/activities
-tools/base/templates/gradle                    tools/templates/gradle
-tools/base/templates/other                     tools/templates/other
-
-# SDK Controller
-sdk/apps/SdkController                  tools/apps/SdkController
-
-# tools specific support jar
-framework/annotations.jar               tools/support/annotations.jar
-
-# Misspelling databases for lint
-sdk/files/typos                         tools/support
-
-##############################################################################
-# Tests Component
-##############################################################################
-
-sdk/testapps                            tests/testapps
-
diff --git a/build/tools.darwin.atree.old b/build/tools.darwin.atree.old
deleted file mode 100644
index d584231..0000000
--- a/build/tools.darwin.atree.old
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# These are the files that comprise the MacOS X tools component of the SDK.
-#
-
-##############################################################################
-# Tools Component
-##############################################################################
-
-# RCP Monitor.
-bin/monitor                                 tools/monitor
-eclipse/monitor-macosx.cocoa.x86_64/monitor tools/lib/monitor-x86_64
-
-# swt
-prebuilts/tools/darwin-x86/swt/swt.jar tools/lib/x86/swt.jar
-prebuilts/tools/darwin-x86_64/swt/swt.jar tools/lib/x86_64/swt.jar
-
-
-# JetCreator (only available on mac/windows)
-external/sonivox/jet_tools/JetCreator                     tools/Jet/JetCreator
-prebuilts/tools/darwin-x86/jetcreator/libEASLIb.dylib     tools/Jet/JetCreator/libEASLIb.dylib
-external/sonivox/jet_tools/JetCreator_content             tools/Jet/demo_content
-external/sonivox/jet_tools/logic_templates                tools/Jet/logic_templates
-
diff --git a/build/tools.linux.atree.old b/build/tools.linux.atree.old
deleted file mode 100644
index cdba1f2..0000000
--- a/build/tools.linux.atree.old
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# These are the files that comprise the Linux tools component of the SDK.
-#
-
-##############################################################################
-# Tools Component
-##############################################################################
-
-# RCP Monitor.
-bin/monitor                                 tools/monitor
-eclipse/monitor-linux.gtk.x86/monitor       tools/lib/monitor-x86
-eclipse/monitor-linux.gtk.x86_64/monitor    tools/lib/monitor-x86_64
-
-
-# swt
-prebuilts/tools/linux-x86/swt/swt.jar tools/lib/x86/swt.jar
-prebuilts/tools/linux-x86_64/swt/swt.jar tools/lib/x86_64/swt.jar
diff --git a/build/tools.windows.atree.old b/build/tools.windows.atree.old
deleted file mode 100755
index 7bab0bd..0000000
--- a/build/tools.windows.atree.old
+++ /dev/null
@@ -1,122 +0,0 @@
-#
-# Copyright (C) 2011 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# These are the files that comprise the tools component of the Windows SDK.
-#
-# IMPORTANT: for a binary to be included here, it must be built --
-# typically by adding it to WIN_SDK_TARGETS in windows_sdk_tools.mk.
-#
-
-rm tools/android
-prebuilts/devtools/tools/android.bat              tools/android.bat
-
-rm tools/ddms
-prebuilts/devtools/tools/ddms.bat                 tools/ddms.bat
-
-rm tools/dmtracedump
-bin/dmtracedump.exe                         strip tools/dmtracedump.exe
-
-rm tools/draw9patch
-prebuilts/devtools/tools/draw9patch.bat           tools/draw9patch.bat
-
-rm tools/lint
-prebuilts/devtools/tools/lint.bat                 tools/lint.bat
-
-rm tools/jobb
-prebuilts/devtools/tools/jobb.bat                 tools/jobb.bat
-
-
-###RM(2014-05-05) temporarily do not include emulator in sdk
-###rm tools/emulator
-###rm tools/emulator-arm
-###rm tools/emulator-x86
-###rm tools/emulator-mips
-###bin/emulator.exe                            strip tools/emulator.exe
-###bin/emulator-arm.exe                        strip tools/emulator-arm.exe
-###bin/emulator-x86.exe                        strip tools/emulator-x86.exe
-###bin/emulator-mips.exe                       strip tools/emulator-mips.exe
-#### Emulator libraries
-###rm tools/lib/libOpenglRender.so
-###rm tools/lib/libGLES_CM_translator.so
-###rm tools/lib/libGLES_V2_translator.so
-###rm tools/lib/libEGL_translator.so
-###lib/libOpenglRender.dll                           tools/lib/libOpenglRender.dll
-###lib/libGLES_CM_translator.dll                     tools/lib/libGLES_CM_translator.dll
-###lib/libGLES_V2_translator.dll                     tools/lib/libGLES_V2_translator.dll
-###lib/libEGL_translator.dll                         tools/lib/libEGL_translator.dll
-#### Copy the emulator NOTICE in the tools dir
-###external/qemu/NOTICE                              tools/emulator_NOTICE.txt
-
-rm tools/etc1tool
-bin/etc1tool.exe                            strip tools/etc1tool.exe
-
-rm tools/hierarchyviewer
-prebuilts/devtools/tools/hierarchyviewer.bat      tools/hierarchyviewer.bat
-
-rm tools/hprof-conv
-bin/hprof-conv.exe                          strip tools/hprof-conv.exe
-
-rm tools/mksdcard
-bin/mksdcard.exe                            strip tools/mksdcard.exe
-
-rm tools/monkeyrunner
-prebuilts/devtools/tools/monkeyrunner.bat         tools/monkeyrunner.bat
-
-rm tools/proguard/bin
-prebuilts/tools/common/proguard/proguard4.7/bin/proguard.bat    tools/proguard/bin/proguard.bat
-prebuilts/tools/common/proguard/proguard4.7/bin/retrace.bat     tools/proguard/bin/retrace.bat
-prebuilts/tools/common/proguard/proguard4.7/bin/proguardgui.bat tools/proguard/bin/proguardgui.bat
-
-rm tools/sqlite3
-bin/sqlite3.exe                             strip tools/sqlite3.exe
-
-rm tools/traceview
-prebuilts/devtools/tools/traceview.bat            tools/traceview.bat
-
-rm tools/uiautomatorviewer
-prebuilts/devtools/tools/uiautomatorviewer.bat    tools/uiautomatorviewer.bat
-
-# RCP Monitor. Remove linux stuff and replace by Windows files.
-rm tools/monitor
-rm tools/lib/monitor-x86
-rm tools/lib/monitor-x86_64
-sdk/monitor/monitor.bat                           tools/monitor.bat
-eclipse/monitor-win32.win32.x86/monitor           tools/lib/monitor-x86
-eclipse/monitor-win32.win32.x86_64/monitor        tools/lib/monitor-x86_64
-
-
-# Copy the AVD & SDK Manager (aka avd/sdklauncher) to the root of the SDK as
-# well as in SDK/tools/lib (so that tools updates can update the root one too)
-bin/avdlauncher.exe                               "AVD Manager.exe"
-bin/sdklauncher.exe                               "SDK Manager.exe"
-bin/avdlauncher.exe                               "tools/lib/AVD Manager.exe"
-bin/sdklauncher.exe                               "tools/lib/SDK Manager.exe"
-
-# Supporting bat files
-sdk/files/post_tools_install.bat                  tools/lib/post_tools_install.bat
-sdk/find_java/find_java.bat                       tools/lib/find_java.bat
-bin/find_java.exe                           strip tools/lib/find_java.exe
-bin/find_lock.exe                           strip tools/lib/find_lock.exe
-
-prebuilts/tools/windows/swt/swt.jar               tools/lib/x86/swt.jar
-prebuilts/tools/windows-x86_64/swt/swt.jar        tools/lib/x86_64/swt.jar
-
-external/sonivox/jet_tools/JetCreator             tools/Jet/JetCreator
-external/sonivox/jet_tools/JetCreator_content     tools/Jet/demo_content
-external/sonivox/jet_tools/logic_templates        tools/Jet/logic_templates
-prebuilts/tools/windows/jetcreator/EASDLL.dll     tools/Jet/JetCreator/EASDLL.dll
-
diff --git a/build/windows_sdk_tools.mk b/build/windows_sdk_tools.mk
index ee4ca7f..8bdcdba 100644
--- a/build/windows_sdk_tools.mk
+++ b/build/windows_sdk_tools.mk
@@ -3,32 +3,17 @@
 # This makefile is included by development/build/tools/windows_sdk.mk
 # to device which tools we want to build from the sdk.git project.
 
-# Define the list of tool-dependent modules to build for the Windows SDK.
-# All these will be build using USE_MINGW=1
-WIN_SDK_TARGETS := \
-	avdlauncher \
-	emulator \
-	emulator-arm \
-	emulator-x86 \
-	emulator-mips \
-	find_java \
-	find_lock \
-	mksdcard \
-	monitor \
-	sdklauncher
+# This contains the SDK Tools modules to build during a
+# *platform* builds. Right now we are not building any SDK Tools
+# during platform builds anymore.
+# They are now built in an unbundled branch.
 
+WIN_SDK_TARGETS := 
 
-# Add OpenGLES emulation host libraries if needed.
-ifeq (true,$(BUILD_EMULATOR_OPENGL))
-WIN_SDK_TARGETS += \
-	libOpenglRender \
-	libGLES_CM_translator \
-	libGLES_V2_translator \
-	libEGL_translator
-endif
 
 # Define the list of tool-dependent modules requisites needed
 # for the Windows SDK. These will be built using HOST_OS=linux.
-WIN_SDK_BUILD_PREREQ := \
-	monitor
+# Temporarily disabled: See b/8992787
+#WIN_SDK_BUILD_PREREQ := \
+#	monitor
 
diff --git a/build/windows_sdk_whitelist.mk b/build/windows_sdk_whitelist.mk
index f10545e..ea29f11 100644
--- a/build/windows_sdk_whitelist.mk
+++ b/build/windows_sdk_whitelist.mk
@@ -27,28 +27,27 @@
 
 subdirs += \
 	external/openssl \
-	external/qemu \
-	prebuilts/tools \
-	sdk/avdlauncher \
-	sdk/emulator/mksdcard \
-	sdk/emulator/opengl \
-	sdk/find_java \
-	sdk/find_lock \
-	sdk/sdklauncher
+#	external/qemu \
+#	prebuilts/tools \
+#	sdk/avdlauncher \
+#	sdk/emulator/mksdcard \
+#	sdk/emulator/opengl \
+#	sdk/find_java \
+#	sdk/find_lock \
+#	sdk/sdklauncher
 
 # -----
 # Whitelist of SDK specific projects that DO require Java
 
 ifneq (,$(shell which javac 2>/dev/null))
 subdirs += \
-	external/ant-glob \
-	external/eclipse-windowbuilder/propertysheet \
-	external/hamcrest \
-	external/junit \
-	sdk/apkbuilder \
-	sdk/eclipse/scripts/rcp \
-	sdk/monitor \
-	sdk/testutils
+#	external/ant-glob \
+#	external/eclipse-windowbuilder/propertysheet \
+#	external/hamcrest \
+#	external/junit \
+#	sdk/apkbuilder \
+#	sdk/eclipse/scripts/rcp \
+#	sdk/testutils
 
 else
 $(warning SDK_ONLY: javac not available.)
diff --git a/eclipse/scripts/build_server.sh b/eclipse/scripts/build_server.sh
index 54deaa6..46947ed 100755
--- a/eclipse/scripts/build_server.sh
+++ b/eclipse/scripts/build_server.sh
@@ -16,6 +16,14 @@
 # Note: currently wrap around existing shell script, reuse most of it,
 # eventually both might merge as needed.
 
+
+###################
+# temporary disable to deal with build server issues
+# see b/14685861
+exit 0
+###################
+
+
 set -e  # Fail this script as soon as a command fails -- fail early, fail fast
 
 PROG_DIR=$(dirname "$0")
diff --git a/emulator/opengl/Android.mk b/emulator/opengl/Android.mk
index 6cab042..856826a 100644
--- a/emulator/opengl/Android.mk
+++ b/emulator/opengl/Android.mk
@@ -1,13 +1,10 @@
 # This is the top-level build file for the Android HW OpenGL ES emulation
 # in Android.
 #
-# You must define BUILD_EMULATOR_OPENGL to 'true' in your environment to
+# You must define BUILD_EMULATOR_HOST_OPENGL to 'true' in your environment to
 # build the following files.
 #
-# Also define BUILD_EMULATOR_OPENGL_DRIVER to 'true' to build the gralloc
-# stuff as well.
-#
-ifeq (true,$(BUILD_EMULATOR_OPENGL))
+ifeq (true,$(BUILD_EMULATOR_HOST_OPENGL))
 
 # Top-level for all modules
 EMUGL_PATH := $(call my-dir)
@@ -104,4 +101,4 @@
 include $(EMUGL_PATH)/tests/translator_tests/GLES_CM/Android.mk
 include $(EMUGL_PATH)/tests/translator_tests/GLES_V2/Android.mk
 
-endif # BUILD_EMULATOR_OPENGL == true
+endif # BUILD_EMULATOR_HOST_OPENGL == true
diff --git a/monitor/Android.mk b/monitor/Android.mk
index 60e4966..8e3f000 100644
--- a/monitor/Android.mk
+++ b/monitor/Android.mk
@@ -1,5 +1,13 @@
 # Copyright 2012 The Android Open Source Project
 
+# Temporarily disable building monitor
+# The current mechanism for building monitor using PDE build does
+# not work with Java7 on Macs. So building monitor is temporarily
+# disabled until we figure out how to build monitor using Tycho
+# and incorporate it into this build script.
+# See b/8992787
+ifeq (0,1)
+
 # Expose the Monitor RCP only for the SDK builds.
 ifneq (,$(is_sdk_build)$(filter sdk sdk_x86 sdk_mips,$(TARGET_PRODUCT)))
 
@@ -60,3 +68,4 @@
 	$(hide)$(ACP) -fp $(V) $(TOPDIR)sdk/monitor/monitor $@
 
 endif
+endif
diff --git a/templates/docs/default.css b/templates/docs/default.css
index 37d3977..76718ac 100644
--- a/templates/docs/default.css
+++ b/templates/docs/default.css
@@ -67,11 +67,17 @@
   position: fixed;
   left: 0;
   top: 0;
-  width: 224px;
-  height: 100%;
-  padding: 48px 0 48px 32px;
+  box-sizing: border-box;
+  width: 256px;
+  bottom: 0;
+  margin: 32px 0;
+  padding: 16px 0 16px 32px;
+  overflow-y: scroll;
   font-size: 14px;
   line-height: 16px;
+  border-top: 2px solid #eee;
+  border-bottom: 2px solid #eee;
+  border-right: 2px solid #eee;
 }
 
 nav span {
@@ -80,7 +86,6 @@
   padding-left: 16px;
   padding-top: 4px;
   padding-bottom: 4px;
-  border-right: 2px solid #eee;
 }
 
 nav span:hover {
@@ -88,8 +93,8 @@
 }
 
 nav .selected > span {
-  background-color: rgba(51,181,229,0.05);
-  border-right: 2px solid #33b5e5;
+  background-color: #eee;
+  border-right: 2px solid #333;
 }
 
 nav > .item > span {
@@ -229,6 +234,27 @@
   margin-bottom: 16px;
 }
 
+.deprecated,
+.deprecated h4,
+.deprecated pre,
+.deprecated code {
+  color: #a77 !important;
+}
+
+.deprecated h4 {
+}
+
+.deprecated h4:after {
+  border-radius: 2px;
+  text-decoration: none;
+  background-color: #a77;
+  padding: 4px 6px;
+  margin-left: 10px;
+  color: #fff;
+  font-size: 12px;
+  content: 'DEPRECATED';
+}
+
 /* print */
 
 @media print {
diff --git a/templates/docs/default.js b/templates/docs/default.js
index 1722eea..4be99c9 100644
--- a/templates/docs/default.js
+++ b/templates/docs/default.js
@@ -16,13 +16,14 @@
 
 $(document).ready(function() {
   prettyPrint();
+  preventParentScrolls('nav');
 
   var sluggify_ = function(s) {
     return (s || '').replace(/ /g, '-').replace(/[^\w-]/g, '').toLowerCase();
   };
 
   $('h2, h3, h4.includetoc').each(function() {
-    $(this).attr('id', 'toc_' + sluggify_($(this).data('toctitle') || $(this).text()));
+    $(this).attr('id', 'toc_' + sluggify_($(this).data('tocid') || $(this).data('toctitle') || $(this).text()));
     $(this).click(function() {
       smoothScrollToId($(this).attr('id'));
     });
@@ -101,7 +102,6 @@
     for (var i = headerPositionCache.length - 1; i >= 0; i--) {
       if (scrollTop >= headerPositionCache[i].top) {
         $('#' + headerPositionCache[i].id).addClass('selected');
-        console.log($('#' + headerPositionCache[i].id));
         break;
       }
     }
@@ -124,3 +124,32 @@
     document.location.hash = id;
   });
 }
+
+// Based on http://stackoverflow.com/questions/5802467/prevent-scrolling-of-parent-element
+function preventParentScrolls($el) {
+  $($el).on('DOMMouseScroll mousewheel', function(ev) {
+    var $this = $(this),
+        scrollTop = this.scrollTop,
+        scrollHeight = this.scrollHeight,
+        height = $this.height(),
+        delta = (ev.type == 'DOMMouseScroll' ?
+            ev.originalEvent.detail * -40 :
+            ev.originalEvent.wheelDelta),
+        up = delta > 0;
+
+    if (!up && -delta > scrollHeight - height - scrollTop) {
+      // Scrolling down, but this will take us past the bottom.
+      $this.scrollTop(scrollHeight);
+    } else if (up && delta > scrollTop) {
+      // Scrolling up, but this will take us past the top.
+      $this.scrollTop(0);
+    } else {
+      $this.scrollTop(scrollTop - delta);
+    }
+
+    ev.stopPropagation();
+    ev.preventDefault();
+    ev.returnValue = false;
+    return false;
+  });
+}
\ No newline at end of file
diff --git a/templates/docs/index.html b/templates/docs/index.html
old mode 100644
new mode 100755
index 77623fb..d127bfe
--- a/templates/docs/index.html
+++ b/templates/docs/index.html
@@ -17,7 +17,7 @@
   -->
 <head>
   <meta charset="utf-8">
-  <title>ADT Template Format</title>
+  <title>Android IDE Template Format</title>
   <link rel="stylesheet" href="cssreset-min.css">
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold;Inconsolata" title="roboto">
   <link rel="stylesheet" href="prettify.css">
@@ -34,17 +34,14 @@
 
 <div id="page-content">
 
-<h1>ADT Template Format</h1>
+<h1>Android IDE Template Format</h1>
 <br>
 <dl style="margin:0">
-  <dt>Status</dt>
-  <dd style="margin:0">Draft</dd>
-
   <dt>Format Version</dt>
-  <dd style="margin:0">3</dd>
+  <dd style="margin:0">4</dd>
 
   <dt>Last Updated</dt>
-  <dd style="margin:0">8/30/2012</dd>
+  <dd style="margin:0">1/30/2014</dd>
 </dl>
 
 
@@ -78,7 +75,8 @@
 <pre class="prettyprint lang-xml">
 &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"&gt;
     &lt;application&gt;
-        &lt;activity android:name="<strong>.${activityClass}</strong>"
+        &lt;activity android:name="<strong>${packageName}.${activityClass}</strong>"
+            android:parentActivityName="<strong>${parentActivityClass}</strong>"
             android:label="@string/title_<strong>${activityToLayout(activityClass)}</strong>">
             <strong>&lt;#if parentActivityClass != ""&gt;</strong>
             &lt;meta-data android:name="android.support.PARENT_ACTIVITY"
@@ -99,8 +97,8 @@
 
 <ul>
   <li>The expression <code>${activityClass}</code> is bound to the value of the 'Activity Class' template parameter.</li>
-  <li>The expression <code>${activityToLayout(activityClass)}</code> uses the <code>activityToLayout</code> method built into ADT to convert an activity class such as <code>MyFooActivity</code> to <code>activity_my_foo</code>.</li>
-  <li>The <code>isLauncher</code> boolean variable and <code>parentActivityClass</code> string varaibles are bound to the values of the 'Launcher Activity' and 'Hierarchical Parent' template parameter, respectively.</li>
+  <li>The expression <code>${activityToLayout(activityClass)}</code> uses the <code>activityToLayout</code> method built into the template engine to convert an activity class such as <code>MyFooActivity</code> to <code>activity_my_foo</code>.</li>
+  <li>The <code>isLauncher</code> boolean variable and <code>parentActivityClass</code> string variables are bound to the values of the 'Launcher Activity' and 'Hierarchical Parent' template parameter, respectively.</li>
 </ul>
 
 
@@ -145,25 +143,19 @@
 
 <pre class="prettyprint lang-xml">
 &lt;!-- A template for a blank activity. Use template format
-     version 3, as described in this document. -->
+     version 4, as described in this document. -->
 &lt;template
-    format="3"
-    revision="1"
-    minApi="4"
-    minBuildApi="11"
-    name="New Blank Activity"
+    format="4"
+    revision="2"
+    minApi="7"
+    minBuildApi="16"
+    name="Blank Activity"
     description="Creates a new blank activity, with navigation."&gt;
 
-    &lt;!-- Indicate that the Android Support Library (r8) should be
-         added to the project, if it isn't already in the project. -->
-    &lt;dependency name="android-support-v4" revision="8" /&gt;
-
-    &lt;category value="Activities" /&gt;
-
     &lt;!-- A string parameter; the value is available to FreeMarker
          processed files (.ftl files) as ${activityName}. -->
     &lt;parameter
-        id="activityName"
+        id="activityClass"
         name="Activity Name"
         type="string"
         constraints="class|unique|nonempty"
@@ -175,22 +167,32 @@
         id="layoutName"
         name="Layout Name"
         type="string"
-        constraints="layout|unique"
+        constraints="layout|unique|nonempty"
         suggest="${activityToLayout(activityClass)}"
-        default="main"
+        default="activity_main"
         help="The name of the layout to create for the activity" /&gt;
 
     &lt;parameter
         id="navType"
         name="Navigation Type"
         type="enum"
-        default="none"&gt;
-        &lt;option id="none" default="true"&gt;None&lt;/option&gt;
+        default="none"
+        help="The type of navigation to use for the activity"&gt;
+        &lt;option id="none"&gt;None&lt;/option&gt;
         &lt;option id="tabs" minApi="11"&gt;Tabs&lt;/option&gt;
         &lt;option id="pager" minApi="11"&gt;Swipe Views&lt;/option&gt;
         &lt;option id="dropdown" minApi="11"&gt;Dropdown&lt;/option&gt;
     &lt;/parameter&gt;
 
+    &lt;parameter
+        id="fragmentName"
+        name="Fragment Name"
+        type="string"
+        constraints="class|unique|nonempty"
+        default="MainFragment"
+        visibility="navType != 'none'"
+        help="The name of the fragment class to create" /&gt;
+
     &lt;!-- 512x512 PNG thumbnails. --&gt;
     &lt;thumbs&gt;
         &lt;!-- Default thumbnail. --&gt;
@@ -217,7 +219,7 @@
 
 <dl>
   <dt><code>format</code></dt>
-  <dd>The template format version that this template adheres to. Should be <code>3</code>.</dd>
+  <dd>The template format version that this template adheres to. Should be <code>4</code>.</dd>
 
   <dt><code>revision</code></dt>
   <dd>Optional. The version of this template (which you can increment when updating the template), as an integer.</dd>
@@ -235,8 +237,11 @@
   <dd>Optional. The minimum build target (expressed as an API level) required for this template. The IDE will ensure that the target project is targeting an API level greater than or equal to this value before instantiating the template. This ensures that the template can safely use newer APIs (optionally guarded by runtime API level checks) without introducing compile-time errors into the target project.</dd>
 </dl>
 
+<div class="deprecated">
 <h4 class="includetoc">&lt;dependency&gt;</h4>
 
+<p>This tag is deprecated for use in <code>template.xml</code>. Use <a href="#toc_recipe_dependency"><code>&lt;dependency&gt;</code></a> in <code>recipe.xml.ftl</code> instead.</p>
+
 <p>Indicates that the template requires that a given library be present in the target project. If not present, the IDE will add the dependency to the project.</p>
 
 <dl>
@@ -249,7 +254,9 @@
   <dt><code>revision</code></dt>
   <dd>The minimum revision of the library required by this template.</dd>
 </dl>
+</div>
 
+<div class="deprecated">
 <h4 class="includetoc">&lt;category&gt;</h4>
 
 <p>The template type. This element is optional.</p>
@@ -262,6 +269,7 @@
     <li><code>UI Components</code></li>
   </ul></dd>
 </dl>
+</div>
 
 <h4 class="includetoc">&lt;parameter&gt;</h4>
 
@@ -282,6 +290,8 @@
     <li><code>nonempty</code> &mdash; the value must not be empty</li>
     <li><code>apilevel</code> &mdash; the value should represent a numeric API level</li>
     <li><code>package</code> &mdash; the value should represent a valid Java package name</li>
+    <li><code>app_package</code> &mdash; the value should represent a valid Android app package name</li>
+    <li><code>module</code> &mdash; the value should represent a valid Module name</li>
     <li><code>class</code> &mdash; the value should represent a valid Java class name</li>
     <li><code>activity</code> &mdash; the value should represent a fully-qualified activity class name</li>
     <li><code>layout</code> &mdash; the value should represent a valid layout resource name</li>
@@ -298,8 +308,11 @@
   <dt><code>default</code></dt>
   <dd>Optional. The default value for this parameter.</dd>
 
+  <dt><code>visibility</code></dt>
+  <dd>Optional. A FreeMarker expression that determines whether this parameter should be visible. The expression should evaluate to a boolean value (i.e. true or false).</dd>
+
   <dt><code>help</code></dt>
-  <dd>The help string to display to the user for this parameter.</dd>
+  <dd>Optional. The help string to display to the user for this parameter.</dd>
 
 </dl>
 
@@ -331,6 +344,18 @@
 
 <p>The template 'preview' thumbnail will show <code>template_tabs.png</code> if the value of the <code>navType</code> template parameter is <code>tabs</code> and <code>template.png</code> otherwise.</p>
 
+<h4 class="includetoc">&lt;icons&gt;</h4>
+
+<p>States that the template would like the Asset Studio icon creation tool of the given type to run, and save the output icons with the given name.</p>
+
+<dl>
+  <dt><code>type</code></dt>
+  <dd>The type of icon wizard to create. Valid values are <code>notification</code>, <code>actionbar</code>, <code>launcher</code>.</dd>
+
+  <dt><code>name</code></dt>
+  <dd>The base icon name to output, e.g. <code>ic_stat_my_notification</code>.</dd>
+</dl>
+
 <h3>globals.xml.ftl</h3>
 
 <p>The optional globals XML file contains global variable definitions, for use in all FreeMarker processing jobs for this template.</p>
@@ -350,7 +375,7 @@
 
 <h3>recipe.xml.ftl</h3>
 
-<p>The recipe XML file contains the individual instructions that should be executed when generating code from this template. For example, you can copy certain files or directories (the copy instruction), optionally running the source files through FreeMarker (the instantiate instruction), and ask ADT to open a file in Eclipse after the code has been generated (the open instruction).</p>
+<p>The recipe XML file contains the individual instructions that should be executed when generating code from this template. For example, you can copy certain files or directories (the copy instruction), optionally running the source files through FreeMarker (the instantiate instruction), and ask the IDE to open a file after the code has been generated (the open instruction).</p>
 
 <p class="note"><strong>Note:</strong> The name of the recipe file is up to you, and is defined in <code>template.xml</code>. By convention, however, it's best to call it <code>recipe.xml.ftl</code>.</p>
 
@@ -360,58 +385,84 @@
 
 <pre class="prettyprint lang-xml">
 &lt;recipe&gt;
+    &lt;#if appCompat?has_content&gt;
+    &lt;dependency mavenUrl="com.android.support:appcompat-v7:+"/&gt;
+    &lt;/#if&gt;
+
     &lt;!-- runs FreeMarker, then copies from
-         [template-directory]/root/ to [output-directory]. --&gt;
-    &lt;instantiate from="AndroidManifest.xml.ftl" /&gt;
+         [template-directory]/root/ to [output-directory],
+         automatically creating directories as needed. --&gt;
+    &lt;merge from="AndroidManifest.xml.ftl"
+             to="${escapeXmlAttribute(manifestDir)}/AndroidManifest.xml" /&gt;
 
-    &lt;!-- automatically creates directories as needed --&gt;
-    &lt;copy from="res/drawable-hdpi" /&gt;
-    &lt;copy from="res/drawable-mdpi" /&gt;
-    &lt;copy from="res/drawable-xhdpi" /&gt;
-    &lt;copy from="res/values/dimens.xml" /&gt;
-    &lt;copy from="res/values/styles.xml" /&gt;
-    &lt;copy from="res/values-large/dimens.xml" /&gt;
-
+    &lt;!-- simply copy file, don't run FreeMarker --&gt;
+    &lt;copy from="res/drawable-mdpi"
+            to="${escapeXmlAttribute(resDir)}/res/drawable-mdpi" /&gt;
+    &lt;copy from="res/drawable-hdpi"
+            to="${escapeXmlAttribute(resDir)}/res/drawable-hdpi" /&gt;
+    &lt;copy from="res/drawable-xhdpi"
+            to="${escapeXmlAttribute(resDir)}/res/drawable-xhdpi" /&gt;
+    &lt;copy from="res/drawable-xxhdpi"
+            to="${escapeXmlAttribute(resDir)}/res/drawable-xxhdpi" /&gt;
     &lt;copy from="res/menu/main.xml"
-            to="res/menu/${activityNameLower}.xml" /&gt;
+            to="${escapeXmlAttribute(resDir)}/res/menu/${activityNameLower}.xml" /&gt;
 
-    &lt;instantiate from="res/values/strings.xml.ftl" /&gt;
+    &lt;!-- run FreeMarker and then merge with existing files --&gt;
+    &lt;merge from="res/values/dimens.xml"
+             to="${escapeXmlAttribute(resDir)}/res/values/dimens.xml" /&gt;
+    &lt;merge from="res/values-large/dimens.xml"
+             to="${escapeXmlAttribute(resDir)}/res/values-large/dimens.xml" /&gt;
+    &lt;merge from="res/values/styles.xml"
+             to="${escapeXmlAttribute(resDir)}/res/values/styles.xml" /&gt;
+    &lt;merge from="res/values/strings.xml.ftl"
+             to="${escapeXmlAttribute(resDir)}/res/values/strings.xml" /&gt;
 
     &lt;!-- Decide which layout to add --&gt;
     &lt;#if navType?contains("pager")&gt;
         &lt;instantiate
-            from="res/layout/activity_pager.xml.ftl"
-              to="res/layout/activity_${activityNameLower}.xml" /&gt;
+            from="${escapeXmlAttribute(resDir)}/res/layout/activity_pager.xml.ftl"
+              to="${escapeXmlAttribute(resDir)}/res/layout/activity_${activityNameLower}.xml" /&gt;
     &lt;#elseif navType == "tabs" || navType == "dropdown"&gt;
-        &lt;copy from="res/layout/activity_fragment_container.xml"
-                to="res/layout/activity_${activityNameLower}.xml" /&gt;
+        &lt;copy from="${escapeXmlAttribute(resDir)}/res/layout/activity_fragment_container.xml"
+                to="${escapeXmlAttribute(resDir)}/res/layout/activity_${activityNameLower}.xml" /&gt;
     &lt;#else&gt;
-        &lt;copy from="res/layout/activity_simple.xml"
-                to="res/layout/activity_${activityNameLower}.xml" /&gt;
+        &lt;copy from="${escapeXmlAttribute(resDir)}/res/layout/activity_simple.xml"
+                to="${escapeXmlAttribute(resDir)}/res/layout/activity_${activityNameLower}.xml" /&gt;
     &lt;/#if&gt;
 
     &lt;!-- Decide which activity code to add --&gt;
     &lt;#if navType == "none"&gt;
         &lt;instantiate from="src/app_package/SimpleActivity.java.ftl"
-                       to="${srcOut}/${activityClass}.java" /&gt;
+                       to="${escapeXmlAttribute(srcOut)}/${activityClass}.java" /&gt;
     &lt;#elseif navType == "pager"&gt;
         &lt;instantiate from="src/app_package/PagerActivity.java.ftl"
-                       to="${srcOut}/${activityClass}.java" /&gt;
+                       to="${escapeXmlAttribute(srcOut)}/${activityClass}.java" /&gt;
     &lt;#elseif navType == "tabs"&gt;
         &lt;instantiate from="src/app_package/TabsActivity.java.ftl"
-                       to="${srcOut}/${activityClass}.java" /&gt;
+                       to="${escapeXmlAttribute(srcOut)}/${activityClass}.java" /&gt;
     &lt;#elseif navType == "dropdown"&gt;
         &lt;instantiate from="src/app_package/DropdownActivity.java.ftl"
-                       to="${srcOut}/${activityClass}.java" /&gt;
+                       to="${escapeXmlAttribute(srcOut)}/${activityClass}.java" /&gt;
     &lt;/#if&gt;
 
-    &lt;!-- open the layout file when done --&gt;
-    &lt;open file="res/layout/${activityNameLower}.xml" /&gt;
+    &lt;!-- open the layout file and Java class when done --&gt;
+    &lt;open file="${escapeXmlAttribute(resDir)}/res/layout/${activityNameLower}.xml" /&gt;
+    &lt;open file="${escapeXmlAttribute(srcOut)}/${activityClass}.java" /&gt;
 &lt;/recipe&gt;
 </pre>
 
 <p>The instructions below are supported:</p>
 
+<h4 class="includetoc" data-tocid="recipe_dependency">&lt;dependency&gt;</h4>
+
+<p>Indicates that the template requires that a given library be present in the target project. If not present, the IDE will add the dependency to the project.</p>
+
+<dl>
+  <dt><code>mavenUrl</code></dt>
+  <dd>The maven coordinates of the library. For example,
+    <code>com.android.support:appcompat-v7:+</code></dd>
+</dl>
+
 <h4 class="includetoc">&lt;copy&gt;</h4>
 
 <p>The only required argument is <code>from</code> which specifies the location of the source files to copy under the <code>root/</code> directory. All necessary ancestor directories are automatically created if needed.</p>
@@ -426,11 +477,15 @@
 
 <h4 class="includetoc">&lt;merge&gt;</h4>
 
-<p>This instruction will be used to merge the contents of a source file into an existing file in the project. The most common use case for this will be to add components to the <code>AndroidManifest.xml</code> file of the destination project, or to merge resources such as strings into an existing <code>strings.xml</code> file.</p>
+<p>This instruction will run the source file through FreeMarker and then merge the contents of the output into an existing file in the project, or create a new file. The most common use case for this is to add components to the <code>AndroidManifest.xml</code> file of the destination project, or to merge resources such as strings into an existing <code>strings.xml</code> file.</p>
 
 <h4 class="includetoc">&lt;open&gt;</h4>
 
-<p>Instruct ADT to open the file created by the specified <code>file</code> argument in Eclipse after code generation is complete.</p>
+<p>Instruct the IDE to open the file created by the specified <code>file</code> argument after code generation is complete.</p>
+
+<h4 class="includetoc">&lt;mkdir&gt;</h4>
+
+<p>Ensures the directory provided in the <code>at</code> argument exists.</p>
 
 <h3>root/</h3>
 
@@ -441,7 +496,7 @@
 
 
 
-<h2>Extra Template Functions</h2>
+<h2>Built-in Template Functions</h2>
 
 <p>Several functions are available to FreeMarker expressions and files beyond the standard set of built-in FreeMarker functions. These are listed below.</p>
 
@@ -471,6 +526,16 @@
 <h4>See also</h4>
 <p><a href="#toc_underscoretocamelcase"><code>underscoreToCamelCase</code></a></p>
 
+<h3 data-toctitle="escapePropertyValue">string <em>escapePropertyValue</em>(string)</h3>
+
+<p>This function escapes a string, such as <code>foo=bar</code> such that it is suitable to be inserted in a Java <code>.properties</code> file as a property value, such as <code>foo\=bar</code>.</p>
+
+<h4>Arguments</h4>
+<dl>
+  <dt><code>str</code></dt>
+  <dd>The string, e.g. <code>foo=bar</code> to escape to a proper property value.</dd>
+</dl>
+
 <h3 data-toctitle="escapeXmlAttribute">string <em>escapeXmlAttribute</em>(string)</h3>
 
 <p>This function escapes a string, such as <code>Android's</code> such that it can be used as an XML attribute value: <code>Android&amp;apos;s</code>. In particular, it will escape ', ", &lt; and &amp;.</p>
@@ -579,6 +644,68 @@
 <h4>See also</h4>
 <p><a href="#toc_camelcasetounderscore"><code>camelCaseToUnderscore</code></a></p>
 
+
+
+<h2>Built-in Template Parameters</h2>
+
+<p>Several parameters are available to FreeMarker expressions and files beyond <a href="#toc_parameter">those defined by the template</a>. These are listed below.</p>
+
+<h3>packageName</h3>
+
+<p>The Java-style Android package name for the project, e.g. <code>com.example.foo</code></p>
+
+<h3>applicationPackage</h3>
+
+<p>Will be the application package (i.e. the package name declared in the app manifest) if the target package for this template is not the application package. Otherwise, this parameter will be empty.</p>
+
+<h3>isNewProject</h3>
+
+<p>A boolean indicating whether or not this template is being instantiated as part of a New Project flow.</p>
+
+<h3>minApi</h3>
+
+<p>The minimum API level the project supports. Note that this value could be a string so consider using <a href="#toc_minapilevel"><code>minApiLevel</code></a> instead.</p>
+
+<h3>minApiLevel</h3>
+
+<p>The minimum API level the project supports, guaranteed to be a number. This is generally used to guard the generation of code based on the project's API level, for example:</p>
+
+<pre>
+int drawableResourceId = android.R.layout.simple_list_item_<strong>&lt;#if minApiLevel gte 11&gt;</strong>activated_<strong>&lt;/#if&gt;</strong>_1;
+</pre>
+
+<h3>buildApi</h3>
+
+<p>The API level that the project is building against, guaranteed to be a number. This is generally used to guard the generation of code based on what version of the Android SDK the project is being built against, for example:</p>
+
+<pre>
+&lt;TextView android:layout_width="wrap_content"
+    android:layout_height="<strong>&lt;#if buildApi gte 8&gt;</strong>match_parent<strong>&lt;#else&gt;</strong>fill_parent<strong>&lt;/#if&gt;</strong>" /&gt;
+</pre>
+
+<h3>manifestDir</h3>
+
+<p>The target output directory for the <code>AndroidManifest.xml</code> file. This varies depending on the project's directory structure (Gradle-style or Ant-style).</p>
+
+<h3>srcDir</h3>
+
+<p>The target Java source root directory for the project. This varies depending on the project's directory structure (Gradle-style or Ant-style). It's common to concatenate the package name:</p>
+
+<pre>
+${srcDir}/${slashedPackageName(packageName)}
+</pre>
+
+<h4>See also</h4>
+<p><a href="#toc_slashedpackagename"><code>slashedPackageName</code></a></p>
+
+<h3>resDir</h3>
+
+<p>The target resource directory root (<code>res/</code> folder) for the project. This varies depending on the project's directory structure (Gradle-style or Ant-style).</p>
+
+
+
+
+
 <h2>Notes for Template Authors</h2>
 
 <h3>Tools metadata</h3>