Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ project.xcworkspace
/build/
/packages/react-native-codegen/android/build/
/packages/react-native-codegen/android/gradlePlugin-build/gradlePlugin/build
/packages/rn-tester/android/app/.cxx/
/packages/rn-tester/android/app/build/
/packages/rn-tester/android/app/gradle/
/packages/rn-tester/android/app/gradlew
Expand Down
19 changes: 0 additions & 19 deletions packages/react-native-codegen/android/generator/build.gradle

This file was deleted.

29 changes: 29 additions & 0 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ project.ext.react = [
hermesCommand: "$rootDir/node_modules/hermes-engine/%OS-BIN%/hermesc",
enableHermesForVariant: { def v -> v.name.contains("hermes") },
jsRootDir: "$rootDir/RNTester",
enableCodegen: (System.getenv('USE_CODEGEN') ?: '0').toBoolean(),
enableFabric: (System.getenv('USE_FABRIC') ?: '0').toBoolean(),
]

Expand All @@ -106,6 +107,11 @@ def enableSeparateBuildPerCPUArchitecture = true
*/
def enableProguardInReleaseBuilds = true

/**
* Build and enable codegen-related output in RN Tester app.
*/
def enableCodegen = project.ext.react.enableCodegen

/**
* Build and enable Fabric in RN Tester app.
*/
Expand Down Expand Up @@ -179,6 +185,29 @@ android {
}
}

if (enableCodegen) {
android {
defaultConfig {
externalNativeBuild {
ndkBuild {
abiFilters "armeabi-v7a", "x86", "x86_64", "arm64-v8a"
arguments "APP_PLATFORM=android-16",
"APP_STL=c++_shared",
"NDK_TOOLCHAIN_VERSION=clang"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++1y"
targets "rntester_appmodules"
}
}
}
externalNativeBuild {
ndkBuild {
path "$projectDir/src/main/jni/Android.mk"
}
}
}
}

configurations {
hermesDebugImplementation {}
hermesReleaseImplementation {}
Expand Down
29 changes: 29 additions & 0 deletions packages/rn-tester/android/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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.

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := rntester_appmodules

LOCAL_C_INCLUDES := $(LOCAL_PATH)

LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)

# TODO
# LOCAL_SHARED_LIBRARIES := libreact_nativemodule_core libreactnativejni

# TODO
# LOCAL_STATIC_LIBRARIES := libjsi

LOCAL_CFLAGS := \
-DLOG_TAG=\"ReactNative\"

LOCAL_CFLAGS += -fexceptions -frtti -std=c++14 -Wall

include $(BUILD_SHARED_LIBRARY)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.
*/

#include "RNTesterAppModuleProvider.h"

namespace facebook {
namespace react {

std::shared_ptr<void> RNTesterAppModuleProvider(const std::string moduleName) {
return nullptr;
}

} // namespace react
} // namespace facebook
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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.
*/

#pragma once

#include <memory>
#include <string>

namespace facebook {
namespace react {

std::shared_ptr<void> RNTesterAppModuleProvider(const std::string moduleName);

} // namespace react
} // namespace facebook