mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: The Gradle codegen integration requires the JS CLI to be first built via `yarn run build`. This commit puts that logic in a `build.sh` script, then defines a Gradle task to build it. Changelog: [Internal] Reviewed By: hramos Differential Revision: D24556992 fbshipit-source-id: 7092de7c1126edc157b122f4b2243e55f7188846
47 lines
1.1 KiB
Groovy
47 lines
1.1 KiB
Groovy
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenLocal()
|
|
google()
|
|
jcenter()
|
|
}
|
|
dependencies {
|
|
classpath("com.android.tools.build:gradle:4.0.1")
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
mavenLocal()
|
|
google()
|
|
jcenter()
|
|
}
|
|
}
|
|
|
|
// This task is required when using react-native-codegen from source, instead of npm.
|
|
task('buildCodegenCLI', type: Exec) {
|
|
def codegenRoot = "$projectDir/.."
|
|
|
|
inputs.files(
|
|
file("$codegenRoot/scripts"),
|
|
file("$codegenRoot/src"),
|
|
file("$codegenRoot/package.json"),
|
|
file("$codegenRoot/.babelrc"),
|
|
file("$codegenRoot/.prettierrc"),
|
|
)
|
|
|
|
def libDir = file("$codegenRoot/lib")
|
|
libDir.mkdirs()
|
|
def nodeModulesDir = file("$codegenRoot/node_modules")
|
|
nodeModulesDir.mkdirs();
|
|
outputs.dirs(libDir, nodeModulesDir)
|
|
|
|
commandLine("$codegenRoot/scripts/oss/build.sh")
|
|
}
|