Home | History | Annotate | Download | only in mockito
      1 # Copyright (C) 2013 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 #
     15 #
     16 
     17 LOCAL_PATH := $(call my-dir)
     18 
     19 ###################################################################
     20 # Host build
     21 ###################################################################
     22 
     23 include $(CLEAR_VARS)
     24 
     25 LOCAL_SRC_FILES := \
     26     $(call all-java-files-under, src/main/java)
     27 
     28 LOCAL_JAVA_LIBRARIES := junit-host objenesis-host
     29 LOCAL_STATIC_JAVA_LIBRARIES := \
     30     mockito-byte-buddy-host \
     31     mockito-byte-buddy-agent-host
     32 LOCAL_MODULE := mockito-host
     33 LOCAL_MODULE_TAGS := optional
     34 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     35 include $(BUILD_HOST_JAVA_LIBRARY)
     36 
     37 ###################################################################
     38 # Target build
     39 ###################################################################
     40 
     41 # Builds the Mockito source code, but does not include any run-time
     42 # dependencies. Most projects should use mockito-target instead, which includes
     43 # everything needed to run Mockito tests.
     44 include $(CLEAR_VARS)
     45 
     46 # Exclude source used to dynamically create classes since target builds use 
     47 # dexmaker instead and including it causes conflicts.
     48 target_src_files := \
     49     $(call all-java-files-under, src/main/java)
     50 target_src_files := \
     51     $(filter-out src/main/java/org/mockito/internal/creation/bytebuddy/%, $(target_src_files))
     52 
     53 LOCAL_SRC_FILES := $(target_src_files)
     54 LOCAL_JAVA_LIBRARIES := junit objenesis-target
     55 LOCAL_MODULE := mockito-api
     56 LOCAL_SDK_VERSION := 16
     57 LOCAL_MODULE_TAGS := optional
     58 include $(BUILD_STATIC_JAVA_LIBRARY)
     59 
     60 # Main target for dependent projects. Bundles all the run-time dependencies
     61 # needed to run Mockito tests on the device.
     62 include $(CLEAR_VARS)
     63 
     64 LOCAL_MODULE := mockito-target
     65 LOCAL_STATIC_JAVA_LIBRARIES := mockito-target-minus-junit4 junit
     66 LOCAL_SDK_VERSION := 16
     67 LOCAL_MODULE_TAGS := optional
     68 include $(BUILD_STATIC_JAVA_LIBRARY)
     69 
     70 # A mockito target that doesn't pull in junit. This is used to work around
     71 # issues caused by multiple copies of junit in the classpath, usually when a test
     72 # using mockito is run using android.test.runner.
     73 include $(CLEAR_VARS)
     74 LOCAL_MODULE := mockito-target-minus-junit4
     75 LOCAL_STATIC_JAVA_LIBRARIES := mockito-api dexmaker dexmaker-mockmaker objenesis-target
     76 LOCAL_JAVA_LIBRARIES := junit
     77 LOCAL_SDK_VERSION := 16
     78 LOCAL_MODULE_TAGS := optional
     79 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
     80 include $(BUILD_STATIC_JAVA_LIBRARY)
     81 
     82 
     83 ###################################################################
     84 # Host build
     85 ###################################################################
     86 
     87 # Builds the Mockito source code, but does not include any run-time
     88 # dependencies.
     89 ifeq ($(HOST_OS),linux)
     90 include $(CLEAR_VARS)
     91 LOCAL_SRC_FILES := $(target_src_files)
     92 LOCAL_JAVA_LIBRARIES := \
     93     junit-hostdex \
     94     objenesis-hostdex
     95 LOCAL_MODULE := mockito-api-hostdex
     96 LOCAL_MODULE_TAGS := optional
     97 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
     98 endif # HOST_OS == linux
     99 
    100 # Host prebuilt dependencies.
    101 # ============================================================
    102 include $(CLEAR_VARS)
    103 
    104 LOCAL_PREBUILT_JAVA_LIBRARIES := \
    105     mockito-byte-buddy-host:lib/byte-buddy-1.6.9$(COMMON_JAVA_PACKAGE_SUFFIX) \
    106     mockito-byte-buddy-agent-host:lib/byte-buddy-agent-1.6.9$(COMMON_JAVA_PACKAGE_SUFFIX) \
    107 
    108 include $(BUILD_HOST_PREBUILT)
    109 
    110 ###################################################
    111 # Clean up temp vars
    112 ###################################################
    113 explicit_target_excludes :=
    114 target_src_files :=
    115