Android.mk revision f99925591f9906f8d08f1bb65bd415cd51861617
1bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert#
2bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# Copyright (C) 2014 The Android Open Source Project
3bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert#
4bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# Licensed under the Apache License, Version 2.0 (the "License");
5bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# you may not use this file except in compliance with the License.
6bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# You may obtain a copy of the License at
7bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert#
8bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert#      http://www.apache.org/licenses/LICENSE-2.0
9bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert#
10bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# Unless required by applicable law or agreed to in writing, software
11bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# distributed under the License is distributed on an "AS IS" BASIS,
12bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# See the License for the specific language governing permissions and
14bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# limitations under the License.
15bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert#
16bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
17bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_PATH := $(call my-dir)
18bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
19bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# User-supplied locale service providers (using the java.text.spi or
20bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# java.util.spi mechanisms) are not supported in Android:
21bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert#
22bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# http://developer.android.com/reference/java/util/Locale.html
23bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
24bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Rouberticu4j_src_files := \
25bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(filter-out main/classes/localespi/%, \
26bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(call all-java-files-under,main/classes))
27bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
28bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Rouberticu4j_test_src_files := \
29bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(filter-out main/tests/localespi/%, \
30bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(call all-java-files-under,main/tests))
31bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
32bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# Not all src dirs contain resources, some instead contain other random files
33bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# that should not be included as resources. The ones that should be included
34bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# can be identifed by the fact that they contain particular subdir trees.
35bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
36bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertdefine all-subdir-with-subdir
37bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert$(patsubst $(LOCAL_PATH)/%/$(2),%,$(wildcard $(LOCAL_PATH)/$(1)/$(2)))
38bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertendef
39bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
40bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Rouberticu4j_resource_dirs := \
41bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(filter-out main/classes/localespi/%, \
42bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(call all-subdir-with-subdir,main/classes/*/src,com/ibm/icu))
43bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
44bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Rouberticu4j_test_resource_dirs := \
45bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(filter-out main/tests/localespi/%, \
46bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(call all-subdir-with-subdir,main/tests/*/src,com/ibm/icu/dev/data))
47bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
48bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# ICU4J depends on being able to use deprecated APIs and doing unchecked
49bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# conversions, so these otherwise noisy lint warnings must be turned off.
50bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
51bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Rouberticu4j_javac_flags := -encoding UTF-8 -Xlint:-deprecation,-unchecked
52bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Rouberticu4j_test_javac_flags := $(icu4j_javac_flags)
53bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
54bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# TODO: Replace use of ICU4J data JAR files with accessing ICU4C data (ie. by
55bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# setting the com.ibm.icu.impl.ICUBinary.dataPath property), after everything
56bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# else works and ICU4C in Android has been updated to ICU 54.
57bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
58bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert# For each data *.jar file, define a corresponding icu4j-* target.
59bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Rouberticu4j_data_jars := \
60bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    $(shell find $(LOCAL_PATH)/main/shared/data -name "*.jar" \
61bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert    | sed "s,^$(LOCAL_PATH)/\(.*/\(.*\)\.jar\)$$,icu4j-\2:\1,")
62bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
63bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(CLEAR_VARS)
64bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := $(icu4j_data_jars)
65bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(BUILD_MULTI_PREBUILT)
66bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
67bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(CLEAR_VARS)
68bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_IS_HOST_MODULE := true
69bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := $(icu4j_data_jars)
70bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(BUILD_MULTI_PREBUILT)
71bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
72bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(CLEAR_VARS)
73bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_SRC_FILES := $(icu4j_src_files)
74bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVA_RESOURCE_DIRS := $(icu4j_resource_dirs)
75bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_STATIC_JAVA_LIBRARIES := icu4j-icudata icu4j-icutzdata
76bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVACFLAGS := $(icu4j_javac_flags)
77bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_MODULE := icu4j
78bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(BUILD_STATIC_JAVA_LIBRARY)
79bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
80bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(CLEAR_VARS)
81bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_SRC_FILES := $(icu4j_src_files)
82bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVA_RESOURCE_DIRS := $(icu4j_resource_dirs)
83bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_STATIC_JAVA_LIBRARIES := icu4j-icudata icu4j-icutzdata
84bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVACFLAGS := $(icu4j_javac_flags)
85bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_MODULE := icu4j-hostdex
86bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
87bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
88bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(CLEAR_VARS)
89b891cb0330449b41281c41ed94d7657ccbcc0802Narayan KamathLOCAL_SRC_FILES := $(icu4j_src_files)
90b891cb0330449b41281c41ed94d7657ccbcc0802Narayan KamathLOCAL_JAVA_RESOURCE_DIRS := $(icu4j_resource_dirs)
91b891cb0330449b41281c41ed94d7657ccbcc0802Narayan KamathLOCAL_STATIC_JAVA_LIBRARIES := icu4j-icudata icu4j-icutzdata
92b891cb0330449b41281c41ed94d7657ccbcc0802Narayan KamathLOCAL_JAVACFLAGS := $(icu4j_javac_flags)
93b891cb0330449b41281c41ed94d7657ccbcc0802Narayan KamathLOCAL_MODULE := icu4j-host
94b891cb0330449b41281c41ed94d7657ccbcc0802Narayan Kamathinclude $(BUILD_HOST_JAVA_LIBRARY)
95b891cb0330449b41281c41ed94d7657ccbcc0802Narayan Kamath
96b891cb0330449b41281c41ed94d7657ccbcc0802Narayan Kamathinclude $(CLEAR_VARS)
97bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_SRC_FILES := $(icu4j_test_src_files)
98bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVA_RESOURCE_DIRS := $(icu4j_test_resource_dirs)
99bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_STATIC_JAVA_LIBRARIES := icu4j-testdata
100bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVA_LIBRARIES := icu4j
101bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVACFLAGS := $(icu4j_test_javac_flags)
102bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_MODULE := icu4j-tests
103bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(BUILD_STATIC_JAVA_LIBRARY)
104bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubert
105bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(CLEAR_VARS)
106bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_SRC_FILES := $(icu4j_test_src_files)
107bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVA_RESOURCE_DIRS := $(icu4j_test_resource_dirs)
108bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_STATIC_JAVA_LIBRARIES := icu4j-testdata
109f99925591f9906f8d08f1bb65bd415cd51861617Narayan KamathLOCAL_JAVA_LIBRARIES := icu4j-host
110f99925591f9906f8d08f1bb65bd415cd51861617Narayan KamathLOCAL_JAVACFLAGS := $(icu4j_test_javac_flags)
111f99925591f9906f8d08f1bb65bd415cd51861617Narayan KamathLOCAL_MODULE := icu4j-tests-host
112f99925591f9906f8d08f1bb65bd415cd51861617Narayan Kamathinclude $(BUILD_HOST_JAVA_LIBRARY)
113f99925591f9906f8d08f1bb65bd415cd51861617Narayan Kamath
114f99925591f9906f8d08f1bb65bd415cd51861617Narayan Kamathinclude $(CLEAR_VARS)
115f99925591f9906f8d08f1bb65bd415cd51861617Narayan KamathLOCAL_SRC_FILES := $(icu4j_test_src_files)
116f99925591f9906f8d08f1bb65bd415cd51861617Narayan KamathLOCAL_JAVA_RESOURCE_DIRS := $(icu4j_test_resource_dirs)
117f99925591f9906f8d08f1bb65bd415cd51861617Narayan KamathLOCAL_STATIC_JAVA_LIBRARIES := icu4j-testdata
118bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVA_LIBRARIES := icu4j-hostdex
119bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_JAVACFLAGS := $(icu4j_test_javac_flags)
120bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik RoubertLOCAL_MODULE := icu4j-tests-hostdex
121bda1c8664cd13a84d000ff94fc59145e83a49f43Fredrik Roubertinclude $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
122