13d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# Copyright (C) 2014 The Android Open Source Project 23d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# 33d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# Licensed under the Apache License, Version 2.0 (the "License"); 43d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# you may not use this file except in compliance with the License. 53d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# You may obtain a copy of the License at 63d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# 73d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# http://www.apache.org/licenses/LICENSE-2.0 83d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# 93d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# Unless required by applicable law or agreed to in writing, software 103d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# distributed under the License is distributed on an "AS IS" BASIS, 113d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 123d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# See the License for the specific language governing permissions and 133d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel# limitations under the License. 143d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 153d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann RousselLOCAL_PATH:= $(call my-dir) 163d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 173d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 183d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel## The application with a minimal main dex 193d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Rousselinclude $(CLEAR_VARS) 203d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 213d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann RousselLOCAL_STATIC_JAVA_LIBRARIES := android-support-multidex 223d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann RousselLOCAL_MODULE_TAGS := tests 233d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 243d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann RousselLOCAL_SRC_FILES := $(call all-java-files-under, src) 253d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 263d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann RousselLOCAL_SDK_VERSION := current 273d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 283d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann RousselLOCAL_PACKAGE_NAME := MultiDexLegacyAndException 293d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 30bf5ad8d9943c0e1b0b3f1b4524c277f369065d08Yohann RousselLOCAL_DEX_PREOPT := false 31bf5ad8d9943c0e1b0b3f1b4524c277f369065d08Yohann Roussel 323d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann RousselmainDexList:= \ 33248ef6f9c414db26fd1bc7ec3d4ee4f3b87d54cfYohann Roussel $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),$(LOCAL_IS_HOST_MODULE),common)/maindex.list 343d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 353d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann RousselLOCAL_DX_FLAGS := --multi-dex --main-dex-list=$(mainDexList) --minimal-main-dex 36248ef6f9c414db26fd1bc7ec3d4ee4f3b87d54cfYohann RousselLOCAL_JACK_FLAGS := -D jack.dex.output.policy=minimal-multidex -D jack.preprocessor=true\ 37248ef6f9c414db26fd1bc7ec3d4ee4f3b87d54cfYohann Roussel -D jack.preprocessor.file=$(LOCAL_PATH)/test.jpp -D jack.dex.output.multidex.legacy=true 38f50a51fb4c8d5ca973ce910a21bddf9f8466cb51Yohann Roussel 39bf5ad8d9943c0e1b0b3f1b4524c277f369065d08Yohann Roussel################################# 40bf5ad8d9943c0e1b0b3f1b4524c277f369065d08Yohann Rousselinclude $(BUILD_SYSTEM)/configure_local_jack.mk 41bf5ad8d9943c0e1b0b3f1b4524c277f369065d08Yohann Roussel################################# 42bf5ad8d9943c0e1b0b3f1b4524c277f369065d08Yohann Roussel 43bf5ad8d9943c0e1b0b3f1b4524c277f369065d08Yohann Rousselifdef LOCAL_JACK_ENABLED 44248ef6f9c414db26fd1bc7ec3d4ee4f3b87d54cfYohann RousselLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/test.jpp 45248ef6f9c414db26fd1bc7ec3d4ee4f3b87d54cfYohann Rousselendif 463d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 473d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Rousselinclude $(BUILD_PACKAGE) 483d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 49bf5ad8d9943c0e1b0b3f1b4524c277f369065d08Yohann Rousselifndef LOCAL_JACK_ENABLED 503d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel$(mainDexList): $(full_classes_proguard_jar) | $(HOST_OUT_EXECUTABLES)/mainDexClasses 51248ef6f9c414db26fd1bc7ec3d4ee4f3b87d54cfYohann Roussel $(hide) mkdir -p $(dir $@) 523d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel $(HOST_OUT_EXECUTABLES)/mainDexClasses $< 1>$@ 533d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel echo "com/android/multidexlegacyandexception/Test.class" >> $@ 543d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel 553d736bc13c9d3d4f87e1295a215bbe13af49e7b4Yohann Roussel$(built_dex_intermediate): $(mainDexList) 56f50a51fb4c8d5ca973ce910a21bddf9f8466cb51Yohann Rousselendif 57