Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7dc90435 authored by Colin Cross's avatar Colin Cross
Browse files

Allow disabling turbine

m -j TURBINE_ENABLED=false will build without turbine.  This is
primarily useful for A/B comparisions of turbine builds, but will
also be used to temporarily disable turbine for unbundled builds
until we have turbine prebuilts.

Bug: 64308460
Test: m -j TURBINE_ENABLED=false java
Test: m -j java
Change-Id: Ie48746c8bfc60c361be9634cb1805ca1c09aa1fe
parent 9b2e4c69
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -683,9 +683,15 @@ endef
# Java libraries that you want to link against.
# Java libraries that you want to link against.
# $(1): library name list
# $(1): library name list
# $(2): Non-empty if IS_HOST_MODULE
# $(2): Non-empty if IS_HOST_MODULE
ifneq ($(TURBINE_ENABLED),false)
define java-lib-header-files
define java-lib-header-files
$(foreach lib,$(1),$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),$(2),COMMON)/classes-header.jar)
$(foreach lib,$(1),$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),$(2),COMMON)/classes-header.jar)
endef
endef
else
define java-lib-header-files
$(call java-lib-files,$(1),$(2))
endef
endif


# Get the dependency files (you can put on the right side of "|" of a build rule)
# Get the dependency files (you can put on the right side of "|" of a build rule)
# of the Java libraries.
# of the Java libraries.
@@ -709,9 +715,15 @@ endef
# Get the header jar files (you can pass to "javac -classpath") of static or shared
# Get the header jar files (you can pass to "javac -classpath") of static or shared
# APK libraries that you want to link against.
# APK libraries that you want to link against.
# $(1): library name list
# $(1): library name list
ifneq ($(TURBINE_ENABLED),false)
define app-lib-header-files
define app-lib-header-files
$(foreach lib,$(1),$(call intermediates-dir-for,APPS,$(lib),,COMMON)/classes-header.jar)
$(foreach lib,$(1),$(call intermediates-dir-for,APPS,$(lib),,COMMON)/classes-header.jar)
endef
endef
else
define app-lib-header-files
$(call app-lib-files,$(1))
endef
endif


###########################################################
###########################################################
## Convert "core ext framework" to "out/.../classes.jack ..."
## Convert "core ext framework" to "out/.../classes.jack ..."
+4 −0
Original line number Original line Diff line number Diff line
@@ -119,6 +119,8 @@ $(full_classes_compiled_jar): \
    | $(SOONG_JAVAC_WRAPPER)
    | $(SOONG_JAVAC_WRAPPER)
	$(transform-host-java-to-dalvik-package)
	$(transform-host-java-to-dalvik-package)


ifneq ($(TURBINE_ENABLED),false)

$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_turbine_jar): \
$(full_classes_turbine_jar): \
@@ -147,6 +149,8 @@ endif


$(eval $(call copy-one-file,$(full_classes_header_jarjar),$(full_classes_header_jar)))
$(eval $(call copy-one-file,$(full_classes_header_jarjar),$(full_classes_header_jar)))


endif # TURBINE_ENABLED != false

$(full_classes_combined_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_combined_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_combined_jar): $(full_classes_compiled_jar) \
$(full_classes_combined_jar): $(full_classes_compiled_jar) \
                              $(jar_manifest_file) \
                              $(jar_manifest_file) \
+2 −0
Original line number Original line Diff line number Diff line
@@ -122,4 +122,6 @@ include $(BUILD_SYSTEM)/jacoco.mk
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(LOCAL_BUILT_MODULE)))
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(LOCAL_BUILT_MODULE)))
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_jar)))
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_jar)))


ifneq ($(TURBINE_DISABLED),false)
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_header_jar)))
$(eval $(call copy-one-file,$(LOCAL_FULL_CLASSES_JACOCO_JAR),$(full_classes_header_jar)))
endif
+4 −0
Original line number Original line Diff line number Diff line
@@ -499,6 +499,8 @@ $(full_classes_compiled_jar): \
    | $(SOONG_JAVAC_WRAPPER)
    | $(SOONG_JAVAC_WRAPPER)
	$(transform-java-to-classes.jar)
	$(transform-java-to-classes.jar)


ifneq ($(TURBINE_ENABLED),false)

$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_turbine_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS) $(annotation_processor_flags)
$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_turbine_jar): PRIVATE_DONT_DELETE_JAR_META_INF := $(LOCAL_DONT_DELETE_JAR_META_INF)
$(full_classes_turbine_jar): \
$(full_classes_turbine_jar): \
@@ -527,6 +529,8 @@ endif


$(eval $(call copy-one-file,$(full_classes_header_jarjar),$(full_classes_header_jar)))
$(eval $(call copy-one-file,$(full_classes_header_jarjar),$(full_classes_header_jar)))


endif # TURBINE_ENABLED != false

javac-check : $(full_classes_compiled_jar)
javac-check : $(full_classes_compiled_jar)
javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar)
javac-check-$(LOCAL_MODULE) : $(full_classes_compiled_jar)


+5 −1
Original line number Original line Diff line number Diff line
@@ -300,7 +300,11 @@ ifdef LOCAL_INSTRUMENTATION_FOR
      APPS,$(LOCAL_INSTRUMENTATION_FOR),,COMMON)
      APPS,$(LOCAL_INSTRUMENTATION_FOR),,COMMON)
  # link against the jar with full original names (before proguard processing).
  # link against the jar with full original names (before proguard processing).
  link_instr_classes_jar := $(link_instr_intermediates_dir.COMMON)/classes-pre-proguard.jar
  link_instr_classes_jar := $(link_instr_intermediates_dir.COMMON)/classes-pre-proguard.jar
  ifneq ($(TURBINE_ENABLED),false)
    link_instr_classes_header_jar := $(link_instr_intermediates_dir.COMMON)/classes-header.jar
    link_instr_classes_header_jar := $(link_instr_intermediates_dir.COMMON)/classes-header.jar
  else
    link_instr_classes_header_jar := $(link_instr_intermediates_dir.COMMON)/classes.jar
  endif
  full_java_libs += $(link_instr_classes_jar)
  full_java_libs += $(link_instr_classes_jar)
  full_java_header_libs += $(link_instr_classes_header_jar)
  full_java_header_libs += $(link_instr_classes_header_jar)
endif  # LOCAL_INSTRUMENTATION_FOR
endif  # LOCAL_INSTRUMENTATION_FOR
Loading