Merge "Use doclava for apicheck"

This commit is contained in:
Ben Dodson 2010-08-11 09:27:04 -07:00 committed by Android (Google) Code Review
commit 6629a4a08e
3 changed files with 11 additions and 5 deletions

View file

@ -19,6 +19,10 @@
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.
@ -32,7 +36,7 @@ ifneq ($(BUILD_TINY_ANDROID), true)
define check-api
$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp: $(2) $(3) $(APICHECK)
@echo "Checking API:" $(1)
$(hide) ( $(APICHECK) $(4) $(2) $(3) || ( $(5) ; exit 38 ) )
$(hide) ( $(APICHECK) -J"classpath $(APICHECK_CLASSPATH)" $(4) $(2) $(3) || ( $(5) ; exit 38 ) )
$(hide) mkdir -p $$(dir $$@)
$(hide) touch $$@
checkapi: $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp

View file

@ -29,7 +29,7 @@ LOCAL_MODULE := apicheck
include $(BUILD_SYSTEM)/base_rules.mk
$(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/apicheck$(COMMON_JAVA_PACKAGE_SUFFIX)
$(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/apicheck | $(ACP)
@echo "Copy: $(PRIVATE_MODULE) ($@)"
$(copy-file-to-new-target)

View file

@ -16,6 +16,10 @@
# Set up prog to be the path of this script, including following symlinks,
# and set up progdir to be the fully-qualified pathname of its directory.
#
# The classpath and other java options used in apicheck are specified in
# build/core/tasks/apicheck.mk.
prog="$0"
while [ -h "${prog}" ]; do
newProg=`/bin/ls -ld "${prog}"`
@ -34,8 +38,6 @@ progdir=`pwd`
prog="${progdir}"/`basename "${prog}"`
cd "${oldwd}"
libdir=`dirname $progdir`/framework
javaOpts=""
while expr "x$1" : 'x-J' >/dev/null; do
opt=`expr "x$1" : 'x-J\(.*\)'`
@ -43,4 +45,4 @@ while expr "x$1" : 'x-J' >/dev/null; do
shift
done
exec java $javaOpts -jar $libdir/apicheck.jar "$@"
exec java $javaOpts com.google.doclava.apicheck.ApiCheck "$@"