Merge "Set the default app sdk verstion to LOCAL_SDK_VERSION"
diff --git a/core/apicheck_msg_current.txt b/core/apicheck_msg_current.txt
index 5d3a913..440e7f8 100644
--- a/core/apicheck_msg_current.txt
+++ b/core/apicheck_msg_current.txt
@@ -6,10 +6,10 @@
    1) You can add "@hide" javadoc comments to the methods, etc. listed in the
       errors above.
 
-   2) You can update current.xml by executing the following command:
+   2) You can update current.txt by executing the following command:
          make update-api
 
-      To submit the revised current.xml to the main Android repository,
+      To submit the revised current.txt to the main Android repository,
       you will need approval.
 ******************************
 
diff --git a/core/config.mk b/core/config.mk
index 3b0e92e..20a2582 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -277,6 +277,11 @@
 MD5SUM:=md5sum
 endif
 
+APICHECK_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
+APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
+APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX)
+APICHECK_COMMAND := $(APICHECK) -JXmx1024m -J"classpath $(APICHECK_CLASSPATH)"
+
 # ###############################################################
 # Set up final options.
 # ###############################################################
@@ -349,7 +354,7 @@
     $(patsubst $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r%,%, \
     $(wildcard $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r*)))
 
-INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.xml
+INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.txt
 
 # This is the standard way to name a directory containing prebuilt target
 # objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
diff --git a/core/tasks/apicheck.mk b/core/tasks/apicheck.mk
index 99a3227..96e0f44 100644
--- a/core/tasks/apicheck.mk
+++ b/core/tasks/apicheck.mk
@@ -19,24 +19,20 @@
 
 ifneq ($(BUILD_TINY_ANDROID), true)
 
-APICHECK_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
-APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
-APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX)
-
 .PHONY: checkapi
 
 # eval this to define a rule that runs apicheck.
 #
 # Args:
 #    $(1)  target
-#    $(2)  stable api xml file
-#    $(3)  api xml file to be tested
+#    $(2)  stable api file
+#    $(3)  api file to be tested
 #    $(4)  arguments for apicheck
 #    $(5)  command to run if apicheck failed
 define check-api
 $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp: $(2) $(3) $(APICHECK)
 	@echo "Checking API:" $(1)
-	$(hide) ( $(APICHECK) -JXmx1024m -J"classpath $(APICHECK_CLASSPATH)" $(4) $(2) $(3) || ( $(5) ; exit 38 ) )
+	$(hide) ( $(APICHECK_COMMAND) $(4) $(2) $(3) || ( $(5) ; exit 38 ) )
 	$(hide) mkdir -p $$(dir $$@)
 	$(hide) touch $$@
 checkapi: $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp
@@ -45,10 +41,11 @@
 # Run the checkapi rules by default.
 droidcore: checkapi
 
-last_released_sdk_version := $(lastword $(call numerically_sort,\
-    $(patsubst $(SRC_API_DIR)/%.xml,%, \
-    $(filter-out $(SRC_API_DIR)/current.xml, \
-    $(wildcard $(SRC_API_DIR)/*.xml)))))
+last_released_sdk_version := $(lastword $(call numerically_sort, \
+            $(filter-out $(SRC_API_DIR)/current, \
+                $(patsubst $(SRC_API_DIR)/%.txt,%, $(wildcard $(SRC_API_DIR)/*.txt)) \
+             )\
+        ))
 
 # INTERNAL_PLATFORM_API_FILE is the one build by droiddoc.
 
@@ -56,7 +53,7 @@
 # SDK version.
 $(eval $(call check-api, \
 	checkapi-last, \
-	$(SRC_API_DIR)/$(last_released_sdk_version).xml, \
+	$(SRC_API_DIR)/$(last_released_sdk_version).txt, \
 	$(INTERNAL_PLATFORM_API_FILE), \
 	-hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 \
 	-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
@@ -68,7 +65,7 @@
 # SDK version.
 $(eval $(call check-api, \
 	checkapi-current, \
-	$(SRC_API_DIR)/current.xml, \
+	$(SRC_API_DIR)/current.txt, \
 	$(INTERNAL_PLATFORM_API_FILE), \
 	-error 2 -error 3 -error 4 -error 5 -error 6 \
 	-error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 \
@@ -79,7 +76,7 @@
 
 .PHONY: update-api
 update-api: $(INTERNAL_PLATFORM_API_FILE) | $(ACP)
-	@echo Copying current.xml
-	$(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) $(SRC_API_DIR)/current.xml
+	@echo Copying current.txt
+	$(hide) $(ACP) $(INTERNAL_PLATFORM_API_FILE) $(SRC_API_DIR)/current.txt
 
 endif