Commit e98bcec0 authored by cjhopman's avatar cjhopman Committed by Commit bot

Fix generation of java enums

java_cpp_enum.gypi was creating all enums in the same root folder and
then adding that folder to its dependents generated_src_dirs. This has
two issues: first, incremental builds will include stale files when
things are moved/renamed/etc. second, all libraries that depend on such
an enum target will actually compile and include all the enum targets
(and in fact may even include different versions of one enum in
 different libraries).

This change just makes each such target use its own unique directory
(this will still have the stale enum issue when renaming an enum if the
 target name doesn't change, but that is very rare).

The GN version already used unique directories.

TBR=mkosiba

Review URL: https://codereview.chromium.org/578363002

Cr-Commit-Position: refs/heads/master@{#295595}
parent ab2f6b9c
...@@ -39,8 +39,8 @@ LOCAL_SRC_FILES += \ ...@@ -39,8 +39,8 @@ LOCAL_SRC_FILES += \
# Java files generated from .template rules. This list should match list of java dependencies in # Java files generated from .template rules. This list should match list of java dependencies in
# android_webview/android_webview.gyp # android_webview/android_webview.gyp
LOCAL_GENERATED_SOURCES := \ LOCAL_GENERATED_SOURCES := \
$(call intermediates-dir-for,GYP,shared)/enums/org/chromium/ui/WindowOpenDisposition.java \ $(call intermediates-dir-for,GYP,shared)/enums/window_open_disposition_java/org/chromium/ui/WindowOpenDisposition.java \
$(call intermediates-dir-for,GYP,shared)/enums/org/chromium/ui/gfx/BitmapFormat.java \ $(call intermediates-dir-for,GYP,shared)/enums/bitmap_format_java/org/chromium/ui/gfx/BitmapFormat.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/base/ApplicationState.java \ $(call intermediates-dir-for,GYP,shared)/templates/org/chromium/base/ApplicationState.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/base/MemoryPressureLevelList.java \ $(call intermediates-dir-for,GYP,shared)/templates/org/chromium/base/MemoryPressureLevelList.java \
$(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/GestureEventType.java \ $(call intermediates-dir-for,GYP,shared)/templates/org/chromium/content/browser/GestureEventType.java \
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
{ {
'variables': { 'variables': {
# Location where all generated Java sources will be placed. # Location where all generated Java sources will be placed.
'output_dir': '<(SHARED_INTERMEDIATE_DIR)/enums', 'output_dir': '<(SHARED_INTERMEDIATE_DIR)/enums/<(_target_name)',
'generator_path': '<(DEPTH)/build/android/gyp/java_cpp_enum.py', 'generator_path': '<(DEPTH)/build/android/gyp/java_cpp_enum.py',
'generator_args': '--output_dir=<(output_dir) <(source_file)', 'generator_args': '--output_dir=<(output_dir) <(source_file)',
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment