blob: cb68340b3f5ec9e00ac8ca520631359f7bd867d0 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16LOCAL_PATH := $(my-dir)
17include $(CLEAR_VARS)
18
19#
20# Define rules to build temp_layoutlib.jar, which contains a subset of
21# the classes in framework.jar. The layoutlib_create tool is used to
22# transform the framework jar into the temp_layoutlib jar.
23#
24
25# We need to process the framework classes.jar file, but we can't
26# depend directly on it (private vars won't be inherited correctly).
27# So, we depend on framework's BUILT file.
Jeff Brownb9ff7132013-07-18 16:37:44 -070028built_framework_dep := $(call java-lib-deps,framework-base)
29built_framework_classes := $(call java-lib-files,framework-base)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030
Ying Wangc486da42010-09-28 14:33:58 -070031built_core_dep := $(call java-lib-deps,core)
32built_core_classes := $(call java-lib-files,core)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033
Deepanshu Gupta1f92d7f2013-11-13 17:22:22 +053034built_ext_dep := $(call java-lib-deps,ext)
35built_ext_classes := $(call java-lib-files,ext)
Deepanshu Gupta58037a42014-01-16 14:16:23 -080036built_ext_data := $(call intermediates-dir-for, \
37 JAVA_LIBRARIES,ext,,COMMON)/javalib.jar
Deepanshu Gupta1f92d7f2013-11-13 17:22:22 +053038
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039built_layoutlib_create_jar := $(call intermediates-dir-for, \
40 JAVA_LIBRARIES,layoutlib_create,HOST)/javalib.jar
41
42# This is mostly a copy of config/host_java_library.mk
43LOCAL_MODULE := temp_layoutlib
44LOCAL_MODULE_CLASS := JAVA_LIBRARIES
45LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)
46LOCAL_IS_HOST_MODULE := true
47LOCAL_BUILT_MODULE_STEM := javalib.jar
48
49#######################################
50include $(BUILD_SYSTEM)/base_rules.mk
51#######################################
52
53$(LOCAL_BUILT_MODULE): $(built_core_dep) \
54 $(built_framework_dep) \
Deepanshu Gupta1f92d7f2013-11-13 17:22:22 +053055 $(built_ext_dep) \
Deepanshu Gupta411b96912014-03-31 16:11:13 -070056 $(built_ext_data) \
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057 $(built_layoutlib_create_jar)
Joe Onorato80a60ba2010-07-14 19:58:30 -070058 $(hide) echo "host layoutlib_create: $@"
59 $(hide) mkdir -p $(dir $@)
60 $(hide) rm -f $@
61 $(hide) ls -l $(built_framework_classes)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062 $(hide) java -jar $(built_layoutlib_create_jar) \
63 $@ \
64 $(built_core_classes) \
Deepanshu Gupta1f92d7f2013-11-13 17:22:22 +053065 $(built_framework_classes) \
Deepanshu Gupta58037a42014-01-16 14:16:23 -080066 $(built_ext_classes) \
67 $(built_ext_data)
Joe Onorato80a60ba2010-07-14 19:58:30 -070068 $(hide) ls -l $(built_framework_classes)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069
70
71#
72# Include the subdir makefiles.
73#
74include $(call all-makefiles-under,$(LOCAL_PATH))