forked from facebook/litho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LITHO_DEFS
163 lines (136 loc) · 8.73 KB
/
LITHO_DEFS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
LITHO_ROOT = '//'
LITHO_VISIBILITY = [
'PUBLIC',
]
LITHO_TESTING_UTIL_VISIBILITY = [
'PUBLIC',
]
LITHO_IS_OSS_BUILD = True
def make_dep_path(pth):
return LITHO_ROOT + pth
LITHO_ROOT_TARGET = make_dep_path(":components")
# Java source
LITHO_JAVA_TARGET = make_dep_path('litho-core/src/main/java/com/facebook/litho:litho')
LITHO_ANNOTATIONS_TARGET = make_dep_path('litho-annotations/src/main/java/com/facebook/litho/annotations:annotations')
LITHO_CONFIG_TARGET = make_dep_path('litho-core/src/main/java/com/facebook/litho/config:config')
LITHO_DISPLAYLISTSTUBS_TARGET = make_dep_path('litho-stubs:stubs')
LITHO_VIEWCOMPAT_TARGET = make_dep_path('litho-core/src/main/java/com/facebook/litho/viewcompat:viewcompat')
LITHO_UTILS_TARGET = make_dep_path('litho-core/src/main/java/com/facebook/litho/utils:utils')
LITHO_WIDGET_ACCESSIBILITIES_TARGET = make_dep_path('litho-widget/src/main/java/com/facebook/litho/widget/accessibility:accessibility')
LITHO_WIDGET_TARGET = make_dep_path('litho-widget/src/main/java/com/facebook/litho/widget:widget')
LITHO_LITHO_FRESCO_TARGET = make_dep_path('litho-fresco/src/main/java/com/facebook/litho/fresco:fresco')
LITHO_TESTING_CORE_TARGET = make_dep_path('litho-testing/src/main/java/com/facebook/litho:litho')
LITHO_TESTING_TARGET = make_dep_path('litho-testing/src/main/java/com/facebook/litho/testing:testing')
LITHO_TESTING_ASSERTJ_TARGET = make_dep_path('litho-testing/src/main/java/com/facebook/litho/testing/assertj:assertj')
LITHO_TESTING_HELPER_TARGET = make_dep_path('litho-testing/src/main/java/com/facebook/litho/testing/helper:helper')
LITHO_TESTING_SUBCOMPONENTS_TARGET = make_dep_path('litho-testing/src/main/java/com/facebook/litho/testing/subcomponents:subcomponents')
LITHO_TESTING_WIDGET_TARGET = make_dep_path('litho-testing/src/main/java/com/facebook/litho/widget:widget')
LITHO_TEST_RES = make_dep_path('litho-it/src/main:res')
LITHO_SECTIONS_TARGET = make_dep_path('litho-sections-core/src/main/java/com/facebook/litho/sections:sections')
LITHO_SECTIONS_COMMON_TARGET = make_dep_path('litho-sections-core/src/main/java/com/facebook/litho/sections/common:common')
LITHO_SECTIONS_WIDGET_TARGET = make_dep_path('litho-sections-widget/src/main/java/com/facebook/litho/sections/widget:widget')
LITHO_SECTIONS_ANNOTATIONS_TARGET = make_dep_path('litho-sections-annotations/src/main/java/com/facebook/litho/sections/annotations:annotations')
LITHO_SECTIONS_PROCESSOR_TARGET = make_dep_path('litho-sections-processor/src/main/java/com/facebook/litho/sections/specmodels/processor:processor')
LITHO_SECTIONS_CONFIG_TARGET = make_dep_path('litho-sections-core/src/main/java/com/facebook/litho/sections/config:config')
LITHO_FBJNI_JAVA_TARGET = make_dep_path('lib/fbjni/src/main/java/com/facebook/jni:jni')
# Test source
LITHO_TEST_TARGET = make_dep_path('litho-it/src/test/java/com/facebook/litho:litho')
# Java source with local upstream
LITHO_PROGUARDANNOTATIONS_TARGET = make_dep_path('litho-annotations/src/main/java/com/facebook/proguard/annotations:annotations')
# Resources
LITHO_RES_TARGET = make_dep_path('litho-core:res')
# Libraries
LITHO_INFERANNOTATIONS_TARGET = make_dep_path('lib/infer-annotations:infer-annotations')
LITHO_JSR_TARGET = make_dep_path('lib/jsr-305:jsr-305')
LITHO_ANDROIDSUPPORT_TARGET = make_dep_path('lib/android-support:android-support')
LITHO_ANDROIDSUPPORT_RECYCLERVIEW_TARGET = make_dep_path('lib/android-support:android-support-recyclerview')
LITHO_ANDROIDSUPPORT_APPCOMPAT_TARGET = make_dep_path('lib/appcompat:appcompat')
LITHO_ANDROIDSUPPORT_TESTING_TARGET = make_dep_path('lib/android-support:android-support-testing')
LITHO_YOGA_TARGET = make_dep_path('lib/yoga:yoga')
LITHO_YOGAJNI_TARGET = make_dep_path('lib/yogajni:jni')
LITHO_BUILD_CONFIG_TARGET = make_dep_path(':build_config')
LITHO_COMMONS_CLI_TARGET = make_dep_path('lib/commons-cli:commons-cli')
LITHO_TEXTLAYOUTBUILDER_TARGET = make_dep_path('lib/textlayoutbuilder:textlayoutbuilder')
LITHO_JAVAPOET_TARGET = make_dep_path('lib/javapoet:javapoet')
LITHO_FBCORE_TARGET = make_dep_path('lib/fbcore:fbcore')
LITHO_SOLOADER_TARGET = make_dep_path('lib/soloader:soloader')
LITHO_ASSERTJ_TARGET = make_dep_path('lib/assertj:assertj')
LITHO_COMPILE_TESTING_TARGET = make_dep_path('lib/compile-testing:compile-testing')
LITHO_TRUTH_TARGET = make_dep_path('lib/truth:truth')
LITHO_MOCKITO_TARGET = make_dep_path('lib/mockito:mockito')
LITHO_POWERMOCK_REFLECT_TARGET = make_dep_path('lib/powermock:powermock-reflect')
LITHO_POWERMOCK_MOCKITO_TARGET = make_dep_path('lib/powermock:powermock-mockito')
LITHO_JNI_TARGET = make_dep_path('lib/jni-hack:jni-hack')
LITHO_FBJNI_TARGET = make_dep_path('lib/fbjni:jni')
LITHO_GUAVA_TARGET = make_dep_path('lib/guava:guava')
LITHO_DIFFUTILS_TARGET = make_dep_path('lib/diff-utils:diff-utils')
LITHO_ESPRESSO_TARGET = make_dep_path('lib/espresso:espresso')
LITHO_SCREENSHOT_TARGET = make_dep_path('lib/screenshot:screenshot')
LITHO_JAVAC_TOOLS_TARGET = make_dep_path('lib/javac-tools:javac-tools')
# Fresco
LITHO_FRESCO_TARGET = make_dep_path('lib/fresco:fresco')
LITHO_ROBOLECTRIC_TARGET = make_dep_path('lib/robolectric3:robolectric3')
LITHO_JUNIT_TARGET = make_dep_path('lib/junit:junit')
LITHO_HAMCREST_LIBRARY_TARGET = make_dep_path('lib/hamcrest:hamcrest')
LITHO_HAMCREST_CORE_TARGET = make_dep_path('lib/hamcrest:hamcrest')
# Annotation processors
LITHO_PROCESSOR_TARGET = make_dep_path('litho-processor/src/main/java/com/facebook/litho/specmodels/processor:processor')
LITHO_PROCESSOR_LIB_TARGET = make_dep_path('litho-processor/src/main/java/com/facebook/litho/specmodels/processor:processor-lib')
LITHO_SECTIONS_PROCESSOR_LIB_TARGET = make_dep_path('litho-sections-processor/src/main/java/com/facebook/litho/sections/specmodels/processor:processor-lib')
# Sample app
LITHO_SAMPLE_JAVA = make_dep_path('sample/src/main/java/com/facebook/samples/litho:litho')
LITHO_SAMPLE_APP_TARGET = make_dep_path('sample/src/oss-only/java/com/facebook/samples/litho:litho')
LITHO_SAMPLE_APP_EXTRAS = []
LITHO_SAMPLE_BAREBONES_JAVA = make_dep_path('sample-barebones/src/main/java/com/facebook/samples/lithobarebones:lithobarebones')
LITHO_SAMPLE_CODELAB_JAVA = make_dep_path('sample-codelab/src/main/java/com/facebook/samples/lithocodelab:lithocodelab')
LITHO_SAMPLE_CODELAB_RES = make_dep_path('sample-codelab:res')
LITHO_SAMPLE_RES = make_dep_path('sample:res')
# Other targets
LITHO_OSS_TARGET = make_dep_path(":components")
# Targets that sometimes exist and sometimes don't
LITHO_TEXTLAYOUTBUILDER_UTILS_TARGET = []
LITHO_FRESCO_TARGETS = [
make_dep_path('lib/fbcore:fbcore'),
make_dep_path('lib/fresco:fresco-drawee'),
make_dep_path('lib/fresco:fresco'),
]
LITHO_FRESCO_PIPELINE_TARGET = [make_dep_path('lib/fresco:imagepipeline')]
LITHO_FRESCO_CONTROLLER_TARGET = []
LITHO_FRESCO_INTERFACES_TARGET = []
def components_robolectric_test(
name,
*args,
**kwargs):
"""Tests that can successfully run from the library root folder."""
extra_vm_args = [
'-Drobolectric.dependency.dir=lib/android-all',
'-Dcom.facebook.litho.is_oss=true',
]
kwargs['vm_args'] = extra_vm_args
kwargs['use_cxx_libraries'] = True
kwargs['cxx_library_whitelist'] = [
'//lib/yogajni:jni',
'//lib/fbjni:jni',
]
native.robolectric_test(
name=name,
*args,
**kwargs)
def fb_instrumentation_test(*args, **kwargs):
# Not supported in OSS at the moment.
pass
def fb_java_test(*args, **kwargs):
"""Uses native java_test for OSS project."""
java_test(*args, **kwargs)
def litho_android_library(name, srcs=None, *args, **kwargs):
srcs = srcs or []
# This has no meaning in OSS.
kwargs.pop('fblite', None)
android_library(name, srcs=srcs, *args, **kwargs)
components_robolectric_powermock_test = components_robolectric_test
def fb_xplat_cxx_library(*args, **kwargs):
"""Delegates to cxx_library for OSS project."""
cxx_library(*args, **kwargs)
def fb_android_resource(**kwargs):
"""Delegates to native fb_android_resource rule."""
android_resource(**kwargs)