Merge changes from topics "soong_logtags", "droiddoc_srcjars"

* changes:
  Allow converting logtags to java without merged logtags file
  Add support for srcjars to droiddoc
This commit is contained in:
Colin Cross 2017-11-17 21:32:27 +00:00 committed by Gerrit Code Review
commit f1f66974c6
2 changed files with 37 additions and 21 deletions

View file

@ -91,8 +91,11 @@ intermediates.COMMON := $(call local-intermediates-dir,COMMON)
$(full_target): PRIVATE_SOURCE_PATH := $(call normalize-path-list,$(LOCAL_DROIDDOC_SOURCE_PATH))
$(full_target): PRIVATE_JAVA_FILES := $(filter %.java,$(full_src_files))
$(full_target): PRIVATE_JAVA_FILES += $(addprefix $($(my_prefix)OUT_COMMON_INTERMEDIATES)/, $(filter %.java,$(LOCAL_INTERMEDIATE_SOURCES)))
$(full_target): PRIVATE_SRCJARS := $(LOCAL_SRCJARS)
$(full_target): PRIVATE_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/src
$(full_target): PRIVATE_SRCJAR_INTERMEDIATES_DIR := $(intermediates.COMMON)/srcjars
$(full_target): PRIVATE_SRC_LIST_FILE := $(intermediates.COMMON)/droiddoc-src-list
$(full_target): PRIVATE_SRCJAR_LIST_FILE := $(intermediates.COMMON)/droiddoc-srcjar-list
ifneq ($(strip $(LOCAL_ADDITIONAL_JAVA_DIR)),)
$(full_target): PRIVATE_ADDITIONAL_JAVA_DIR := $(LOCAL_ADDITIONAL_JAVA_DIR)
@ -173,17 +176,21 @@ $(full_target): \
$(droiddoc) \
$(html_dir_files) \
$(full_java_libs) \
$(EXTRACT_SRCJARS) \
$(LOCAL_SRCJARS) \
$(LOCAL_ADDITIONAL_DEPENDENCIES)
@echo Docs droiddoc: $(PRIVATE_OUT_DIR)
$(hide) mkdir -p $(dir $@)
$(addprefix $(hide) rm -rf ,$(PRIVATE_STUB_OUT_DIR))
$(hide) rm -rf $(PRIVATE_STUB_OUT_DIR) $(PRIVATE_SRCJAR_INTERMEDIATES_DIR)
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
$(EXTRACT_SRCJARS) $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) $(PRIVATE_SRCJAR_LIST_FILE) $(PRIVATE_SRCJARS)
$(hide) ( \
$(JAVADOC) \
-encoding UTF-8 \
-source 1.8 \
\@$(PRIVATE_SRC_LIST_FILE) \
\@$(PRIVATE_SRCJAR_LIST_FILE) \
-J-Xmx1600m \
-J-XX:-OmitStackTraceInFastThrow \
-XDignore.symbol.file \
@ -223,17 +230,19 @@ else
# For OpenJDK 8 we can use -bootclasspath to define the core libraries code.
$(full_target): PRIVATE_BOOTCLASSPATH_ARG := $(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH))
endif
$(full_target): $(full_src_files) $(full_java_libs)
$(full_target): $(full_src_files) $(full_java_libs) $(EXTRACT_SRCJARS) $(LOCAL_SRCJARS) $(LOCAL_ADDITIONAL_DEPENDENCIES)
@echo Docs javadoc: $(PRIVATE_OUT_DIR)
@mkdir -p $(dir $@)
rm -rf $(PRIVATE_SRCJAR_INTERMEDIATES_DIR)
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
$(EXTRACT_SRCJARS) $(PRIVATE_SRCJAR_INTERMEDIATES_DIR) $(PRIVATE_SRCJAR_LIST_FILE) $(PRIVATE_SRCJARS)
$(hide) ( \
$(JAVADOC) \
-encoding UTF-8 \
$(PRIVATE_DROIDDOC_OPTIONS) \
\@$(PRIVATE_SRC_LIST_FILE) \
\@$(PRIVATE_SRCJAR_LIST_FILE) \
-J-Xmx1024m \
-XDignore.symbol.file \
-Xdoclint:none \

View file

@ -51,30 +51,37 @@ for o, a in opts:
print >> sys.stderr, "unhandled option %s" % (o,)
sys.exit(1)
if len(args) != 2:
print "need exactly two input files, not %d" % (len(args),)
if len(args) != 1 and len(args) != 2:
print "need one or two input files, not %d" % (len(args),)
print __doc__
sys.exit(1)
fn = args[0]
tagfile = event_log_tags.TagFile(fn)
# Load the merged tag file (which should have numbers assigned for all
# tags. Use the numbers from the merged file to fill in any missing
# numbers from the input file.
merged_fn = args[1]
merged_tagfile = event_log_tags.TagFile(merged_fn)
merged_by_name = dict([(t.tagname, t) for t in merged_tagfile.tags])
for t in tagfile.tags:
if t.tagnum is None:
if t.tagname in merged_by_name:
t.tagnum = merged_by_name[t.tagname].tagnum
else:
# We're building something that's not being included in the
# product, so its tags don't appear in the merged file. Assign
# them all an arbitrary number so we can emit the java and
# compile the (unused) package.
t.tagnum = 999999
if len(args) > 1:
# Load the merged tag file (which should have numbers assigned for all
# tags. Use the numbers from the merged file to fill in any missing
# numbers from the input file.
merged_fn = args[1]
merged_tagfile = event_log_tags.TagFile(merged_fn)
merged_by_name = dict([(t.tagname, t) for t in merged_tagfile.tags])
for t in tagfile.tags:
if t.tagnum is None:
if t.tagname in merged_by_name:
t.tagnum = merged_by_name[t.tagname].tagnum
else:
# We're building something that's not being included in the
# product, so its tags don't appear in the merged file. Assign
# them all an arbitrary number so we can emit the java and
# compile the (unused) package.
t.tagnum = 999999
else:
# Not using the merged tag file, so all tags must have manually assigned
# numbers
for t in tagfile.tags:
if t.tagnum is None:
tagfilef.AddError("tag \"%s\" has no number" % (tagname,), tag.linenum)
if "java_package" not in tagfile.options:
tagfile.AddError("java_package option not specified", linenum=0)