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) \
     27     $(call all-java-files-under, cglib-and-asm/src)
     28 
     29 LOCAL_JAVA_LIBRARIES := junit objenesis-host ant
     30 LOCAL_MODULE := mockito-host
     31 LOCAL_MODULE_TAGS := optional
     32 include $(BUILD_HOST_JAVA_LIBRARY)
     33 
     34 
     35 ###################################################################
     36 # Target build
     37 ###################################################################
     38 
     39 # Builds the Mockito source code, but does not include any run-time
     40 # dependencies. Most projects should use mockito-target instead, which includes
     41 # everything needed to run Mockito tests.
     42 include $(CLEAR_VARS)
     43 
     44 # Exclude source used to dynamically create classes since target builds use 
     45 # dexmaker instead and including it causes conflicts.
     46 explicit_target_excludes := \
     47     src/org/mockito/internal/creation/AbstractMockitoMethodProxy.java \
     48     src/org/mockito/internal/creation/AcrossJVMSerializationFeature.java \
     49     src/org/mockito/internal/creation/CglibMockMaker.java \
     50     src/org/mockito/internal/creation/DelegatingMockitoMethodProxy.java \
     51     src/org/mockito/internal/creation/MethodInterceptorFilter.java \
     52     src/org/mockito/internal/creation/MockitoMethodProxy.java \
     53     src/org/mockito/internal/creation/SerializableMockitoMethodProxy.java \
     54     src/org/mockito/internal/invocation/realmethod/FilteredCGLIBProxyRealMethod.java \
     55     src/org/mockito/internal/invocation/realmethod/CGLIBProxyRealMethod.java \
     56     src/org/mockito/internal/invocation/realmethod/HasCGLIBMethodProxy.java
     57 
     58 target_src_files := \
     59     $(call all-java-files-under, src)
     60 target_src_files := \
     61     $(filter-out src/org/mockito/internal/creation/cglib/%, $(target_src_files))
     62 target_src_files := \
     63     $(filter-out src/org/mockito/internal/creation/jmock/%, $(target_src_files))
     64 target_src_files := \
     65     $(filter-out $(explicit_target_excludes), $(target_src_files))
     66 
     67 LOCAL_SRC_FILES := $(target_src_files)
     68 LOCAL_JAVA_LIBRARIES := junit4-target objenesis-target
     69 LOCAL_MODULE := mockito-api
     70 LOCAL_SDK_VERSION := 10
     71 LOCAL_MODULE_TAGS := optional
     72 include $(BUILD_STATIC_JAVA_LIBRARY)
     73 
     74 # Main target for dependent projects. Bundles all the run-time dependencies
     75 # needed to run Mockito tests on the device.
     76 include $(CLEAR_VARS)
     77 
     78 LOCAL_MODULE := mockito-target
     79 LOCAL_STATIC_JAVA_LIBRARIES := mockito-api dexmaker dexmaker-mockmaker \
     80     objenesis-target junit4-target
     81 LOCAL_SDK_VERSION := 10
     82 LOCAL_MODULE_TAGS := optional
     83 include $(BUILD_STATIC_JAVA_LIBRARY)
     84 
     85 ###################################################
     86 # Clean up temp vars
     87 ###################################################
     88 explicit_target_excludes :=
     89 target_src_files :=
     90