Continue wrapping functions as we prepare for skylark

Differential Revision: D6808010

fbshipit-source-id: f24e71558baed2c2da319e20e0faf66858eb27d5
This commit is contained in:
Michael Lee 2018-01-25 09:05:16 -08:00 committed by Facebook Github Bot
parent df6c48cf36
commit 869866cc5c
15 changed files with 72 additions and 59 deletions

View File

@ -1,8 +1,8 @@
load("//ReactNative:DEFS", "rn_android_library", "rn_android_binary", "rn_android_resource", "react_native_dep", "react_native_target")
load("//ReactNative:DEFS", "rn_android_library", "rn_android_binary", "rn_android_resource", "react_native_dep", "react_native_target", "KEYSTORE_TARGET")
rn_android_binary(
name = "app",
keystore = "//keystores:debug",
keystore = KEYSTORE_TARGET,
manifest = "src/main/AndroidManifest.xml",
deps = [
":rntester-lib",

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_binary", "react_native_dep", "react_native_integration_tests_target", "react_native_target")
load("//ReactNative:DEFS", "rn_android_binary", "react_native_dep", "react_native_integration_tests_target", "react_native_target", "KEYSTORE_TARGET")
# We are running instrumentation tests in simple mode: app code and instrumentation are in the same APK
# Currently you need to run these commands to execute tests:
@ -9,7 +9,7 @@ load("//ReactNative:DEFS", "rn_android_binary", "react_native_dep", "react_nativ
# ./scripts/run-android-instrumentation-tests.sh com.facebook.react.tests
rn_android_binary(
name = "instrumentation-tests",
keystore = "//keystores:debug",
keystore = KEYSTORE_TARGET,
manifest = "AndroidManifest.xml",
deps = [
react_native_dep("android_res/com/facebook/catalyst/appcompat:appcompat"),

View File

@ -1,8 +1,10 @@
load("//ReactNative:DEFS", "react_native_dep")
java_library(
name = "java",
srcs = glob(["**/*.java"]),
visibility = ["PUBLIC"],
deps = [
"//java/com/facebook/proguard/annotations:annotations",
react_native_dep("java/com/facebook/proguard/annotations:annotations"),
],
)

View File

@ -1,12 +1,13 @@
load("//ReactNative:DEFS", "rn_prebuilt_native_library", "rn_android_prebuilt_aar")
# Temp workaround to get the build working e2e, Gradle builds them for us
prebuilt_native_library(
rn_prebuilt_native_library(
name = "reactnative-libs",
native_libs = "lib",
visibility = ["PUBLIC"],
)
android_prebuilt_aar(
rn_android_prebuilt_aar(
name = "android-jsc",
aar = ":android-jsc-aar",
visibility = ["PUBLIC"],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library")
load("//ReactNative:DEFS", "rn_android_library", "rn_prebuilt_jar")
rn_android_library(
name = "powermock",
@ -19,7 +19,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
prebuilt_jar(
rn_prebuilt_jar(
name = "powermock-core",
binary_jar = ":download-powermock-core",
visibility = ["//ReactAndroid/..."],
@ -31,7 +31,7 @@ remote_file(
url = "mvn:org.powermock:powermock-core:jar:1.6.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "powermock-api-mockito",
binary_jar = ":download-powermock-api-mockito",
visibility = ["//ReactAndroid/..."],
@ -43,7 +43,7 @@ remote_file(
url = "mvn:org.powermock:powermock-api-mockito:jar:1.6.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "powermock-api-support",
binary_jar = ":download-powermock-api-support",
visibility = ["//ReactAndroid/..."],
@ -55,7 +55,7 @@ remote_file(
url = "mvn:org.powermock:powermock-api-support:jar:1.6.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "powermock-module-junit4-rule",
binary_jar = ":download-powermock-module-junit4-rule",
visibility = ["//ReactAndroid/..."],
@ -67,7 +67,7 @@ remote_file(
url = "mvn:org.powermock:powermock-module-junit4-rule:jar:1.6.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "powermock-classloading-xstream",
binary_jar = ":download-powermock-classloading-xstream",
visibility = ["//ReactAndroid/..."],
@ -79,7 +79,7 @@ remote_file(
url = "mvn:org.powermock:powermock-classloading-xstream:jar:1.6.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "powermock-classloading-base",
binary_jar = ":download-powermock-classloading-base",
visibility = ["//ReactAndroid/..."],
@ -91,7 +91,7 @@ remote_file(
url = "mvn:org.powermock:powermock-classloading-base:jar:1.6.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "xstream",
binary_jar = ":download-xstream",
visibility = ["//ReactAndroid/..."],
@ -103,7 +103,7 @@ remote_file(
url = "mvn:com.thoughtworks.xstream:xstream:jar:1.4.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "powermock-reflect",
binary_jar = ":download-powermock-reflect",
visibility = ["//ReactAndroid/..."],
@ -115,7 +115,7 @@ remote_file(
url = "mvn:org.powermock:powermock-reflect:jar:1.6.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "javassist",
binary_jar = ":download-javassist",
visibility = ["//ReactAndroid/..."],
@ -127,7 +127,7 @@ remote_file(
url = "mvn:org.javassist:javassist:jar:3.20.0-GA",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "mockito-all",
binary_jar = ":download-mockito-all",
visibility = ["//ReactAndroid/..."],
@ -139,7 +139,7 @@ remote_file(
url = "mvn:org.mockito:mockito-all:jar:1.10.19",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "xmlpull",
binary_jar = ":download-xmlpull",
visibility = ["//ReactAndroid/..."],
@ -151,7 +151,7 @@ remote_file(
url = "mvn:xmlpull:xmlpull:jar:1.1.3.1",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "xpp3",
binary_jar = ":download-xpp3",
visibility = ["//ReactAndroid/..."],

View File

@ -1,6 +1,6 @@
load("//ReactNative:DEFS", "rn_android_library")
load("//ReactNative:DEFS", "rn_android_library", "rn_android_prebuilt_aar", "rn_prebuilt_jar")
android_prebuilt_aar(
rn_android_prebuilt_aar(
name = "fresco-react-native",
aar = ":fresco-binary-aar",
visibility = ["//ReactAndroid/..."],
@ -34,7 +34,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
android_prebuilt_aar(
rn_android_prebuilt_aar(
name = "imagepipeline-base",
aar = ":imagepipeline-base-aar",
visibility = ["//ReactAndroid/..."],
@ -46,7 +46,7 @@ remote_file(
url = "mvn:com.facebook.fresco:imagepipeline-base:aar:1.3.0",
)
android_prebuilt_aar(
rn_android_prebuilt_aar(
name = "imagepipeline-core",
aar = ":imagepipeline-aar",
visibility = ["//ReactAndroid/..."],
@ -58,7 +58,7 @@ remote_file(
url = "mvn:com.facebook.fresco:imagepipeline:aar:1.3.0",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "bolts",
binary_jar = ":download-bolts",
visibility = ["//ReactAndroid/..."],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library")
load("//ReactNative:DEFS", "rn_android_library", "rn_android_prebuilt_aar", "rn_prebuilt_jar")
rn_android_library(
name = "textlayoutbuilder",
@ -9,7 +9,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
android_prebuilt_aar(
rn_android_prebuilt_aar(
name = "textlayoutbuilder-base",
aar = ":textlayoutbuilder-base-aar",
visibility = ["//ReactAndroid/..."],
@ -21,7 +21,7 @@ remote_file(
url = "mvn:com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:aar:1.0.0",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "staticlayoutproxy",
binary_jar = ":staticlayoutproxy-jar",
visibility = ["//ReactAndroid/..."],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library", "rn_android_resource")
load("//ReactNative:DEFS", "rn_android_library", "rn_android_resource", "rn_prebuilt_jar")
# This is a bit messy and hopefully a temporary thing
# The problem is that Gradle extracts appcompat resources into app namespace, com.facebook.react
@ -30,7 +30,7 @@ rn_android_resource(
visibility = ["//ReactAndroid/..."],
)
prebuilt_jar(
rn_prebuilt_jar(
name = "classes-for-react-native",
binary_jar = ":classes-unpacker-cmd",
visibility = ["//ReactAndroid/..."],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library")
load("//ReactNative:DEFS", "rn_android_library", "rn_prebuilt_jar")
rn_android_library(
name = "asm",
@ -12,7 +12,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
prebuilt_jar(
rn_prebuilt_jar(
name = "asm-core",
binary_jar = ":download-asm",
visibility = ["//ReactAndroid/..."],
@ -24,7 +24,7 @@ remote_file(
url = "mvn:org.ow2.asm:asm:jar:5.0.1",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "asm-commons",
binary_jar = ":download-asm-commons",
visibility = ["//ReactAndroid/..."],
@ -36,7 +36,7 @@ remote_file(
url = "mvn:org.ow2.asm:asm-commons:jar:5.0.1",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "asm-tree",
binary_jar = ":download-asm-tree",
visibility = ["//ReactAndroid/..."],
@ -48,7 +48,7 @@ remote_file(
url = "mvn:org.ow2.asm:asm-tree:jar:5.0.1",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "asm-util",
binary_jar = ":download-asm-util",
visibility = ["//ReactAndroid/..."],
@ -60,7 +60,7 @@ remote_file(
url = "mvn:org.ow2.asm:asm-util:jar:5.0.1",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "asm-analysis",
binary_jar = ":download-asm-analysis",
visibility = ["//ReactAndroid/..."],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library")
load("//ReactNative:DEFS", "rn_android_library", "rn_prebuilt_jar")
rn_android_library(
name = "fest",
@ -9,7 +9,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
prebuilt_jar(
rn_prebuilt_jar(
name = "fest-core",
binary_jar = ":fest-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -21,7 +21,7 @@ remote_file(
url = "mvn:org.easytesting:fest-assert-core:jar:2.0M10",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "fest-util",
binary_jar = ":fest-util-binary-jar",
visibility = ["//ReactAndroid/..."],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library")
load("//ReactNative:DEFS", "rn_android_library", "rn_prebuilt_jar")
rn_android_library(
name = "junit",
@ -9,7 +9,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
prebuilt_jar(
rn_prebuilt_jar(
name = "junit-core",
binary_jar = ":download-junit",
visibility = ["//ReactAndroid/..."],
@ -21,7 +21,7 @@ remote_file(
url = "mvn:junit:junit:jar:4.12",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "hamcrest",
binary_jar = ":download-hamcrest",
visibility = ["//ReactAndroid/..."],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library")
load("//ReactNative:DEFS", "rn_android_library", "rn_prebuilt_jar")
rn_android_library(
name = "mockito",
@ -9,7 +9,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
prebuilt_jar(
rn_prebuilt_jar(
name = "mockito-core",
binary_jar = ":mockito-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -21,7 +21,7 @@ remote_file(
url = "mvn:org.mockito:mockito-core:jar:1.10.19",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "objenesis",
binary_jar = ":objenesis-binary-jar",
visibility = ["//ReactAndroid/..."],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library", "react_native_dep")
load("//ReactNative:DEFS", "rn_android_library", "react_native_dep", "rn_prebuilt_jar")
rn_android_library(
name = "robolectric",
@ -20,7 +20,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
prebuilt_jar(
rn_prebuilt_jar(
name = "robolectric-core",
binary_jar = ":robolectric-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -32,7 +32,7 @@ remote_file(
url = "mvn:org.robolectric:robolectric:jar:3.0",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "robolectric-resources",
binary_jar = ":robolectric-resources-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -44,7 +44,7 @@ remote_file(
url = "mvn:org.robolectric:robolectric-resources:jar:3.0",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "robolectric-annotations",
binary_jar = ":robolectric-annotations-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -56,7 +56,7 @@ remote_file(
url = "mvn:org.robolectric:robolectric-annotations:jar:3.0",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "robolectric-utils",
binary_jar = ":robolectric-utils-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -68,7 +68,7 @@ remote_file(
url = "mvn:org.robolectric:robolectric-utils:jar:3.0",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "bouncycastle",
binary_jar = ":bouncycastle-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -80,7 +80,7 @@ remote_file(
url = "mvn:org.bouncycastle:bcprov-jdk16:jar:1.46",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "vtd-xml",
binary_jar = ":vtd-xml-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -92,7 +92,7 @@ remote_file(
url = "mvn:com.ximpleware:vtd-xml:jar:2.11",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "icu",
binary_jar = ":icu-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -104,7 +104,7 @@ remote_file(
url = "mvn:com.ibm.icu:icu4j:jar:53.1",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "android-all-4.1.2_r1-robolectric-0", # name defines filename used by robolectric in runtime
binary_jar = ":robolectric-android-all-binary-jar",
visibility = ["//ReactAndroid/..."],
@ -124,7 +124,7 @@ remote_file(
url = "mvn:org.robolectric:android-all:jar:4.1.2_r1-robolectric-0",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "json-20080701", # name defines filename used by robolectric in runtime
binary_jar = ":json-jar",
visibility = ["//ReactAndroid/..."],
@ -142,7 +142,7 @@ remote_file(
url = "mvn:org.json:json:jar:20080701",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "tagsoup-1.2", # name defines filename used by robolectric in runtime
binary_jar = ":tagsoup-jar",
visibility = ["//ReactAndroid/..."],
@ -160,7 +160,7 @@ remote_file(
url = "mvn:org.ccil.cowan.tagsoup:tagsoup:jar:1.2",
)
prebuilt_jar(
rn_prebuilt_jar(
name = "shadows-core-3.0-16", # name defines filename used by robolectric in runtime
binary_jar = ":robolectric-shadows-binary-jar",
visibility = ["//ReactAndroid/..."],

View File

@ -1,4 +1,4 @@
load("//ReactNative:DEFS", "rn_android_library")
load("//ReactNative:DEFS", "rn_android_library", "rn_prebuilt_jar")
rn_android_library(
name = "sqlite",
@ -8,7 +8,7 @@ rn_android_library(
visibility = ["//ReactAndroid/..."],
)
prebuilt_jar(
rn_prebuilt_jar(
name = "sqlite4java",
binary_jar = ":download-sqlite4java",
visibility = ["//ReactAndroid/..."],

View File

@ -24,6 +24,7 @@ YOGA_TARGET = '//ReactAndroid/src/main/java/com/facebook:yoga'
FBGLOGINIT_TARGET = '//ReactAndroid/src/main/jni/first-party/fbgloginit:fbgloginit'
FBJNI_TARGET = '//ReactAndroid/src/main/jni/first-party/fb:jni'
JNI_TARGET = '//ReactAndroid/src/main/jni/first-party/jni-hack:jni-hack'
KEYSTORE_TARGET = '//keystores:debug'
with allow_unsafe_import():
import os
@ -97,12 +98,21 @@ def rn_android_build_config(*args, **kwargs):
def rn_android_resource(*args, **kwargs):
android_resource(*args, **kwargs)
def rn_android_prebuilt_aar(*args, **kwargs):
android_prebuilt_aar(*args, **kwargs)
def rn_java_library(*args, **kwargs):
java_library(*args, **kwargs)
def rn_java_annotation_processor(*args, **kwargs):
java_annotation_processor(*args, **kwargs)
def rn_prebuilt_native_library(*args, **kwargs):
prebuilt_native_library(*args, **kwargs)
def rn_prebuilt_jar (*args, **kwargs):
prebuilt_jar (*args, **kwargs)
def rn_robolectric_test(name, srcs, vm_args = None, *args, **kwargs):
vm_args = vm_args or []