mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 13:23:12 +08:00 
			
		
		
		
	Update example 0.68
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| apply plugin: "com.android.application" | ||||
|  | ||||
| import com.android.build.OutputFile | ||||
| import org.apache.tools.ant.taskdefs.condition.Os | ||||
|  | ||||
| /** | ||||
|  * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets | ||||
| @@ -114,20 +115,23 @@ def jscFlavor = 'org.webkit:android-jsc:+' | ||||
| /** | ||||
|  * Whether to enable the Hermes VM. | ||||
|  * | ||||
|  * This should be set on project.ext.react and mirrored here.  If it is not set | ||||
|  * This should be set on project.ext.react and that value will be read here. If it is not set | ||||
|  * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode | ||||
|  * and the benefits of using Hermes will therefore be sharply reduced. | ||||
|  */ | ||||
| def enableHermes = project.ext.react.get("enableHermes", false); | ||||
|  | ||||
| /** | ||||
|  * Architectures to build native code for in debug. | ||||
|  * Architectures to build native code for. | ||||
|  */ | ||||
| def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") | ||||
|  | ||||
| def reactNativeArchitectures() { | ||||
|     def value = project.getProperties().get("reactNativeArchitectures") | ||||
|     return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] | ||||
| } | ||||
|  | ||||
| android { | ||||
|     ndkVersion rootProject.ext.ndkVersion | ||||
|  | ||||
|     compileSdkVersion rootProject.ext.compileSdkVersion | ||||
|  | ||||
|     defaultConfig { | ||||
| @@ -136,13 +140,85 @@ android { | ||||
|         targetSdkVersion rootProject.ext.targetSdkVersion | ||||
|         versionCode 1 | ||||
|         versionName "1.0" | ||||
|         buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() | ||||
|  | ||||
|         if (isNewArchitectureEnabled()) { | ||||
|             // We configure the NDK build only if you decide to opt-in for the New Architecture. | ||||
|             externalNativeBuild { | ||||
|                 ndkBuild { | ||||
|                     arguments "APP_PLATFORM=android-21", | ||||
|                         "APP_STL=c++_shared", | ||||
|                         "NDK_TOOLCHAIN_VERSION=clang", | ||||
|                         "GENERATED_SRC_DIR=$buildDir/generated/source", | ||||
|                         "PROJECT_BUILD_DIR=$buildDir", | ||||
|                         "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", | ||||
|                         "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build" | ||||
|                     cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1" | ||||
|                     cppFlags "-std=c++17" | ||||
|                     // Make sure this target name is the same you specify inside the | ||||
|                     // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable. | ||||
|                     targets "testhotupdate_appmodules" | ||||
|                     // Fix for windows limit on number of character in file paths and in command lines | ||||
|                     if (Os.isFamily(Os.FAMILY_WINDOWS)) { | ||||
|                         arguments "NDK_APP_SHORT_COMMANDS=true" | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|             if (!enableSeparateBuildPerCPUArchitecture) { | ||||
|                 ndk { | ||||
|                     abiFilters (*reactNativeArchitectures()) | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if (isNewArchitectureEnabled()) { | ||||
|         // We configure the NDK build only if you decide to opt-in for the New Architecture. | ||||
|         externalNativeBuild { | ||||
|             ndkBuild { | ||||
|                 path "$projectDir/src/main/jni/Android.mk" | ||||
|             } | ||||
|         } | ||||
|         def reactAndroidProjectDir = project(':ReactAndroid').projectDir | ||||
|         def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { | ||||
|             dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") | ||||
|             from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") | ||||
|             into("$buildDir/react-ndk/exported") | ||||
|         } | ||||
|         def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { | ||||
|             dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") | ||||
|             from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") | ||||
|             into("$buildDir/react-ndk/exported") | ||||
|         } | ||||
|         afterEvaluate { | ||||
|             // If you wish to add a custom TurboModule or component locally, | ||||
|             // you should uncomment this line. | ||||
|             // preBuild.dependsOn("generateCodegenArtifactsFromSchema") | ||||
|             preDebugBuild.dependsOn(packageReactNdkDebugLibs) | ||||
|             preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) | ||||
|  | ||||
|             // Due to a bug inside AGP, we have to explicitly set a dependency | ||||
|             // between configureNdkBuild* tasks and the preBuild tasks. | ||||
|             // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 | ||||
|             configureNdkBuildRelease.dependsOn(preReleaseBuild) | ||||
|             configureNdkBuildDebug.dependsOn(preDebugBuild) | ||||
|             reactNativeArchitectures().each { architecture -> | ||||
|                 tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure { | ||||
|                     dependsOn("preDebugBuild") | ||||
|                 } | ||||
|                 tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure { | ||||
|                     dependsOn("preReleaseBuild") | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     splits { | ||||
|         abi { | ||||
|             reset() | ||||
|             enable true | ||||
|             enable enableSeparateBuildPerCPUArchitecture | ||||
|             universalApk false  // If true, also generate a universal APK | ||||
|             include "x86", "arm64-v8a" | ||||
|             include (*reactNativeArchitectures()) | ||||
|         } | ||||
|     } | ||||
|     signingConfigs { | ||||
| @@ -156,14 +232,8 @@ android { | ||||
|     buildTypes { | ||||
|         debug { | ||||
|             signingConfig signingConfigs.debug | ||||
|             if (nativeArchitectures) { | ||||
|                 ndk { | ||||
|                     abiFilters nativeArchitectures.split(',') | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         release { | ||||
|             crunchPngs false | ||||
|             // Caution! In production, you need to generate your own keystore file. | ||||
|             // see https://reactnative.dev/docs/signed-apk-android. | ||||
|             signingConfig signingConfigs.debug | ||||
| @@ -191,13 +261,14 @@ android { | ||||
|  | ||||
| dependencies { | ||||
|     implementation fileTree(dir: "libs", include: ["*.jar"]) | ||||
|  | ||||
|     //noinspection GradleDynamicVersion | ||||
|     implementation "com.facebook.react:react-native:+"  // From node_modules | ||||
|  | ||||
|     implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" | ||||
|  | ||||
|     debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { | ||||
|       exclude group:'com.facebook.fbjni' | ||||
|         exclude group:'com.facebook.fbjni' | ||||
|     } | ||||
|  | ||||
|     debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { | ||||
| @@ -218,11 +289,31 @@ dependencies { | ||||
|     } | ||||
| } | ||||
|  | ||||
| if (isNewArchitectureEnabled()) { | ||||
|     // If new architecture is enabled, we let you build RN from source | ||||
|     // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. | ||||
|     // This will be applied to all the imported transtitive dependency. | ||||
|     configurations.all { | ||||
|         resolutionStrategy.dependencySubstitution { | ||||
|             substitute(module("com.facebook.react:react-native")) | ||||
|                     .using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source") | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| // Run this once to be able to run the application with BUCK | ||||
| // puts all implementation dependencies into folder libs for BUCK to use | ||||
| // puts all compile dependencies into folder libs for BUCK to use | ||||
| task copyDownloadableDepsToLibs(type: Copy) { | ||||
|     from configurations.implementation | ||||
|     into 'libs' | ||||
| } | ||||
|  | ||||
| apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) | ||||
| apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) | ||||
|  | ||||
| def isNewArchitectureEnabled() { | ||||
|     // To opt-in for the New Architecture, you can either: | ||||
|     // - Set `newArchEnabled` to true inside the `gradle.properties` file | ||||
|     // - Invoke gradle with `-newArchEnabled=true` | ||||
|     // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` | ||||
|     return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" | ||||
| } | ||||
|   | ||||
| @@ -4,7 +4,10 @@ | ||||
|  | ||||
|     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> | ||||
|  | ||||
|     <application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning"> | ||||
|       <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> | ||||
|     <application | ||||
|         android:usesCleartextTraffic="true" | ||||
|         tools:targetApi="28" | ||||
|         tools:ignore="GoogleAppIndexingWarning"> | ||||
|         <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" /> | ||||
|     </application> | ||||
| </manifest> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /** | ||||
|  * Copyright (c) Facebook, Inc. and its affiliates. | ||||
|  * Copyright (c) Meta Platforms, Inc. and affiliates. | ||||
|  * | ||||
|  * <p>This source code is licensed under the MIT license found in the LICENSE file in the root | ||||
|  * directory of this source tree. | ||||
| @@ -19,6 +19,7 @@ import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; | ||||
| import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; | ||||
| import com.facebook.flipper.plugins.react.ReactFlipperPlugin; | ||||
| import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; | ||||
| import com.facebook.react.ReactInstanceEventListener; | ||||
| import com.facebook.react.ReactInstanceManager; | ||||
| import com.facebook.react.bridge.ReactContext; | ||||
| import com.facebook.react.modules.network.NetworkingModule; | ||||
| @@ -51,7 +52,7 @@ public class ReactNativeFlipper { | ||||
|       ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); | ||||
|       if (reactContext == null) { | ||||
|         reactInstanceManager.addReactInstanceEventListener( | ||||
|             new ReactInstanceManager.ReactInstanceEventListener() { | ||||
|             new ReactInstanceEventListener() { | ||||
|               @Override | ||||
|               public void onReactContextInitialized(ReactContext reactContext) { | ||||
|                 reactInstanceManager.removeReactInstanceEventListener(this); | ||||
| @@ -69,4 +70,4 @@ public class ReactNativeFlipper { | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -4,7 +4,6 @@ | ||||
|     <uses-permission android:name="android.permission.INTERNET" /> | ||||
|  | ||||
|     <application | ||||
|       android:usesCleartextTraffic="true" | ||||
|       android:name=".MainApplication" | ||||
|       android:label="@string/app_name" | ||||
|       android:icon="@mipmap/ic_launcher" | ||||
| @@ -14,14 +13,14 @@ | ||||
|       <activity | ||||
|         android:name=".MainActivity" | ||||
|         android:label="@string/app_name" | ||||
|         android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" | ||||
|         android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" | ||||
|         android:launchMode="singleTask" | ||||
|         android:windowSoftInputMode="adjustResize"> | ||||
|         android:windowSoftInputMode="adjustResize" | ||||
|         android:exported="true"> | ||||
|         <intent-filter> | ||||
|             <action android:name="android.intent.action.MAIN" /> | ||||
|             <category android:name="android.intent.category.LAUNCHER" /> | ||||
|         </intent-filter> | ||||
|       </activity> | ||||
|     </application> | ||||
|  | ||||
| </manifest> | ||||
|   | ||||
| @@ -1,6 +1,8 @@ | ||||
| package com.testhotupdate; | ||||
|  | ||||
| import com.facebook.react.ReactActivity; | ||||
| import com.facebook.react.ReactActivityDelegate; | ||||
| import com.facebook.react.ReactRootView; | ||||
|  | ||||
| public class MainActivity extends ReactActivity { | ||||
|  | ||||
| @@ -10,6 +12,29 @@ public class MainActivity extends ReactActivity { | ||||
|    */ | ||||
|   @Override | ||||
|   protected String getMainComponentName() { | ||||
|     return "testHotUpdate"; | ||||
|     return "testHotupdate"; | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and | ||||
|    * you can specify the rendered you wish to use (Fabric or the older renderer). | ||||
|    */ | ||||
|   @Override | ||||
|   protected ReactActivityDelegate createReactActivityDelegate() { | ||||
|     return new MainActivityDelegate(this, getMainComponentName()); | ||||
|   } | ||||
|  | ||||
|   public static class MainActivityDelegate extends ReactActivityDelegate { | ||||
|     public MainActivityDelegate(ReactActivity activity, String mainComponentName) { | ||||
|       super(activity, mainComponentName); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     protected ReactRootView createRootView() { | ||||
|       ReactRootView reactRootView = new ReactRootView(getContext()); | ||||
|       // If you opted-in for the New Architecture, we enable the Fabric Renderer. | ||||
|       reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); | ||||
|       return reactRootView; | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -7,12 +7,12 @@ import com.facebook.react.ReactApplication; | ||||
| import com.facebook.react.ReactInstanceManager; | ||||
| import com.facebook.react.ReactNativeHost; | ||||
| import com.facebook.react.ReactPackage; | ||||
| import com.facebook.react.config.ReactFeatureFlags; | ||||
| import com.facebook.soloader.SoLoader; | ||||
| import com.testhotupdate.newarchitecture.MainApplicationReactNativeHost; | ||||
| import java.lang.reflect.InvocationTargetException; | ||||
| import java.util.List; | ||||
|  | ||||
| import cn.reactnative.modules.update.UpdateContext; | ||||
|  | ||||
| public class MainApplication extends Application implements ReactApplication { | ||||
|  | ||||
|   private final ReactNativeHost mReactNativeHost = | ||||
| @@ -42,19 +42,28 @@ public class MainApplication extends Application implements ReactApplication { | ||||
|         } | ||||
|       }; | ||||
|  | ||||
|   private final ReactNativeHost mNewArchitectureNativeHost = | ||||
|       new MainApplicationReactNativeHost(this); | ||||
|  | ||||
|   @Override | ||||
|   public ReactNativeHost getReactNativeHost() { | ||||
|     return mReactNativeHost; | ||||
|     if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||||
|       return mNewArchitectureNativeHost; | ||||
|     } else { | ||||
|       return mReactNativeHost; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public void onCreate() { | ||||
|     super.onCreate(); | ||||
|     // If you opted-in for the New Architecture, we enable the TurboModule system | ||||
|     ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; | ||||
|     SoLoader.init(this, /* native exopackage */ false); | ||||
|     initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); | ||||
|   } | ||||
|  | ||||
|    /** | ||||
|   /** | ||||
|    * Loads Flipper in React Native templates. Call this in the onCreate method with something like | ||||
|    * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); | ||||
|    * | ||||
|   | ||||
| @@ -0,0 +1,116 @@ | ||||
| package com.testhotupdate.newarchitecture; | ||||
|  | ||||
| import android.app.Application; | ||||
| import androidx.annotation.NonNull; | ||||
| import com.facebook.react.PackageList; | ||||
| import com.facebook.react.ReactInstanceManager; | ||||
| import com.facebook.react.ReactNativeHost; | ||||
| import com.facebook.react.ReactPackage; | ||||
| import com.facebook.react.ReactPackageTurboModuleManagerDelegate; | ||||
| import com.facebook.react.bridge.JSIModulePackage; | ||||
| import com.facebook.react.bridge.JSIModuleProvider; | ||||
| import com.facebook.react.bridge.JSIModuleSpec; | ||||
| import com.facebook.react.bridge.JSIModuleType; | ||||
| import com.facebook.react.bridge.JavaScriptContextHolder; | ||||
| import com.facebook.react.bridge.ReactApplicationContext; | ||||
| import com.facebook.react.bridge.UIManager; | ||||
| import com.facebook.react.fabric.ComponentFactory; | ||||
| import com.facebook.react.fabric.CoreComponentsRegistry; | ||||
| import com.facebook.react.fabric.EmptyReactNativeConfig; | ||||
| import com.facebook.react.fabric.FabricJSIModuleProvider; | ||||
| import com.facebook.react.uimanager.ViewManagerRegistry; | ||||
| import com.testhotupdate.BuildConfig; | ||||
| import com.testhotupdate.newarchitecture.components.MainComponentsRegistry; | ||||
| import com.testhotupdate.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both | ||||
|  * TurboModule delegates and the Fabric Renderer. | ||||
|  * | ||||
|  * <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the | ||||
|  * `newArchEnabled` property). Is ignored otherwise. | ||||
|  */ | ||||
| public class MainApplicationReactNativeHost extends ReactNativeHost { | ||||
|   public MainApplicationReactNativeHost(Application application) { | ||||
|     super(application); | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public boolean getUseDeveloperSupport() { | ||||
|     return BuildConfig.DEBUG; | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   protected List<ReactPackage> getPackages() { | ||||
|     List<ReactPackage> packages = new PackageList(this).getPackages(); | ||||
|     // Packages that cannot be autolinked yet can be added manually here, for example: | ||||
|     //     packages.add(new MyReactNativePackage()); | ||||
|     // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: | ||||
|     //     packages.add(new TurboReactPackage() { ... }); | ||||
|     // If you have custom Fabric Components, their ViewManagers should also be loaded here | ||||
|     // inside a ReactPackage. | ||||
|     return packages; | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   protected String getJSMainModuleName() { | ||||
|     return "index"; | ||||
|   } | ||||
|  | ||||
|   @NonNull | ||||
|   @Override | ||||
|   protected ReactPackageTurboModuleManagerDelegate.Builder | ||||
|       getReactPackageTurboModuleManagerDelegateBuilder() { | ||||
|     // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary | ||||
|     // for the new architecture and to use TurboModules correctly. | ||||
|     return new MainApplicationTurboModuleManagerDelegate.Builder(); | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   protected JSIModulePackage getJSIModulePackage() { | ||||
|     return new JSIModulePackage() { | ||||
|       @Override | ||||
|       public List<JSIModuleSpec> getJSIModules( | ||||
|           final ReactApplicationContext reactApplicationContext, | ||||
|           final JavaScriptContextHolder jsContext) { | ||||
|         final List<JSIModuleSpec> specs = new ArrayList<>(); | ||||
|  | ||||
|         // Here we provide a new JSIModuleSpec that will be responsible of providing the | ||||
|         // custom Fabric Components. | ||||
|         specs.add( | ||||
|             new JSIModuleSpec() { | ||||
|               @Override | ||||
|               public JSIModuleType getJSIModuleType() { | ||||
|                 return JSIModuleType.UIManager; | ||||
|               } | ||||
|  | ||||
|               @Override | ||||
|               public JSIModuleProvider<UIManager> getJSIModuleProvider() { | ||||
|                 final ComponentFactory componentFactory = new ComponentFactory(); | ||||
|                 CoreComponentsRegistry.register(componentFactory); | ||||
|  | ||||
|                 // Here we register a Components Registry. | ||||
|                 // The one that is generated with the template contains no components | ||||
|                 // and just provides you the one from React Native core. | ||||
|                 MainComponentsRegistry.register(componentFactory); | ||||
|  | ||||
|                 final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); | ||||
|  | ||||
|                 ViewManagerRegistry viewManagerRegistry = | ||||
|                     new ViewManagerRegistry( | ||||
|                         reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); | ||||
|  | ||||
|                 return new FabricJSIModuleProvider( | ||||
|                     reactApplicationContext, | ||||
|                     componentFactory, | ||||
|                     new EmptyReactNativeConfig(), | ||||
|                     viewManagerRegistry); | ||||
|               } | ||||
|             }); | ||||
|         return specs; | ||||
|       } | ||||
|     }; | ||||
|   } | ||||
| } | ||||
| @@ -0,0 +1,36 @@ | ||||
| package com.testhotupdate.newarchitecture.components; | ||||
|  | ||||
| import com.facebook.jni.HybridData; | ||||
| import com.facebook.proguard.annotations.DoNotStrip; | ||||
| import com.facebook.react.fabric.ComponentFactory; | ||||
| import com.facebook.soloader.SoLoader; | ||||
|  | ||||
| /** | ||||
|  * Class responsible to load the custom Fabric Components. This class has native methods and needs a | ||||
|  * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ | ||||
|  * folder for you). | ||||
|  * | ||||
|  * <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the | ||||
|  * `newArchEnabled` property). Is ignored otherwise. | ||||
|  */ | ||||
| @DoNotStrip | ||||
| public class MainComponentsRegistry { | ||||
|   static { | ||||
|     SoLoader.loadLibrary("fabricjni"); | ||||
|   } | ||||
|  | ||||
|   @DoNotStrip private final HybridData mHybridData; | ||||
|  | ||||
|   @DoNotStrip | ||||
|   private native HybridData initHybrid(ComponentFactory componentFactory); | ||||
|  | ||||
|   @DoNotStrip | ||||
|   private MainComponentsRegistry(ComponentFactory componentFactory) { | ||||
|     mHybridData = initHybrid(componentFactory); | ||||
|   } | ||||
|  | ||||
|   @DoNotStrip | ||||
|   public static MainComponentsRegistry register(ComponentFactory componentFactory) { | ||||
|     return new MainComponentsRegistry(componentFactory); | ||||
|   } | ||||
| } | ||||
| @@ -0,0 +1,48 @@ | ||||
| package com.testhotupdate.newarchitecture.modules; | ||||
|  | ||||
| import com.facebook.jni.HybridData; | ||||
| import com.facebook.react.ReactPackage; | ||||
| import com.facebook.react.ReactPackageTurboModuleManagerDelegate; | ||||
| import com.facebook.react.bridge.ReactApplicationContext; | ||||
| import com.facebook.soloader.SoLoader; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * Class responsible to load the TurboModules. This class has native methods and needs a | ||||
|  * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ | ||||
|  * folder for you). | ||||
|  * | ||||
|  * <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the | ||||
|  * `newArchEnabled` property). Is ignored otherwise. | ||||
|  */ | ||||
| public class MainApplicationTurboModuleManagerDelegate | ||||
|     extends ReactPackageTurboModuleManagerDelegate { | ||||
|  | ||||
|   private static volatile boolean sIsSoLibraryLoaded; | ||||
|  | ||||
|   protected MainApplicationTurboModuleManagerDelegate( | ||||
|       ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) { | ||||
|     super(reactApplicationContext, packages); | ||||
|   } | ||||
|  | ||||
|   protected native HybridData initHybrid(); | ||||
|  | ||||
|   native boolean canCreateTurboModule(String moduleName); | ||||
|  | ||||
|   public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { | ||||
|     protected MainApplicationTurboModuleManagerDelegate build( | ||||
|         ReactApplicationContext context, List<ReactPackage> packages) { | ||||
|       return new MainApplicationTurboModuleManagerDelegate(context, packages); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   protected synchronized void maybeLoadOtherSoLibraries() { | ||||
|     if (!sIsSoLibraryLoaded) { | ||||
|       // If you change the name of your application .so file in the Android.mk file, | ||||
|       // make sure you update the name here as well. | ||||
|       SoLoader.loadLibrary("testhotupdate_appmodules"); | ||||
|       sIsSoLibraryLoaded = true; | ||||
|     } | ||||
|   } | ||||
| } | ||||
							
								
								
									
										49
									
								
								Example/testHotUpdate/android/app/src/main/jni/Android.mk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								Example/testHotUpdate/android/app/src/main/jni/Android.mk
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| THIS_DIR := $(call my-dir) | ||||
|  | ||||
| include $(REACT_ANDROID_DIR)/Android-prebuilt.mk | ||||
|  | ||||
| # If you wish to add a custom TurboModule or Fabric component in your app you | ||||
| # will have to include the following autogenerated makefile. | ||||
| # include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk | ||||
| include $(CLEAR_VARS) | ||||
|  | ||||
| LOCAL_PATH := $(THIS_DIR) | ||||
|  | ||||
| # You can customize the name of your application .so file here. | ||||
| LOCAL_MODULE := testhotupdate_appmodules | ||||
|  | ||||
| LOCAL_C_INCLUDES := $(LOCAL_PATH) | ||||
| LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) | ||||
| LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) | ||||
|  | ||||
| # If you wish to add a custom TurboModule or Fabric component in your app you | ||||
| # will have to uncomment those lines to include the generated source  | ||||
| # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni) | ||||
| # | ||||
| # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni | ||||
| # LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp) | ||||
| # LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni | ||||
|  | ||||
| # Here you should add any native library you wish to depend on. | ||||
| LOCAL_SHARED_LIBRARIES := \ | ||||
|   libfabricjni \ | ||||
|   libfbjni \ | ||||
|   libfolly_futures \ | ||||
|   libfolly_json \ | ||||
|   libglog \ | ||||
|   libjsi \ | ||||
|   libreact_codegen_rncore \ | ||||
|   libreact_debug \ | ||||
|   libreact_nativemodule_core \ | ||||
|   libreact_render_componentregistry \ | ||||
|   libreact_render_core \ | ||||
|   libreact_render_debug \ | ||||
|   libreact_render_graphics \ | ||||
|   librrc_view \ | ||||
|   libruntimeexecutor \ | ||||
|   libturbomodulejsijni \ | ||||
|   libyoga | ||||
|  | ||||
| LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall | ||||
|  | ||||
| include $(BUILD_SHARED_LIBRARY) | ||||
| @@ -0,0 +1,24 @@ | ||||
| #include "MainApplicationModuleProvider.h" | ||||
|  | ||||
| #include <rncore.h> | ||||
|  | ||||
| namespace facebook { | ||||
| namespace react { | ||||
|  | ||||
| std::shared_ptr<TurboModule> MainApplicationModuleProvider( | ||||
|     const std::string moduleName, | ||||
|     const JavaTurboModule::InitParams ¶ms) { | ||||
|   // Here you can provide your own module provider for TurboModules coming from | ||||
|   // either your application or from external libraries. The approach to follow | ||||
|   // is similar to the following (for a library called `samplelibrary`: | ||||
|   // | ||||
|   // auto module = samplelibrary_ModuleProvider(moduleName, params); | ||||
|   // if (module != nullptr) { | ||||
|   //    return module; | ||||
|   // } | ||||
|   // return rncore_ModuleProvider(moduleName, params); | ||||
|   return rncore_ModuleProvider(moduleName, params); | ||||
| } | ||||
|  | ||||
| } // namespace react | ||||
| } // namespace facebook | ||||
| @@ -0,0 +1,16 @@ | ||||
| #pragma once | ||||
|  | ||||
| #include <memory> | ||||
| #include <string> | ||||
|  | ||||
| #include <ReactCommon/JavaTurboModule.h> | ||||
|  | ||||
| namespace facebook { | ||||
| namespace react { | ||||
|  | ||||
| std::shared_ptr<TurboModule> MainApplicationModuleProvider( | ||||
|     const std::string moduleName, | ||||
|     const JavaTurboModule::InitParams ¶ms); | ||||
|  | ||||
| } // namespace react | ||||
| } // namespace facebook | ||||
| @@ -0,0 +1,45 @@ | ||||
| #include "MainApplicationTurboModuleManagerDelegate.h" | ||||
| #include "MainApplicationModuleProvider.h" | ||||
|  | ||||
| namespace facebook { | ||||
| namespace react { | ||||
|  | ||||
| jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata> | ||||
| MainApplicationTurboModuleManagerDelegate::initHybrid( | ||||
|     jni::alias_ref<jhybridobject>) { | ||||
|   return makeCxxInstance(); | ||||
| } | ||||
|  | ||||
| void MainApplicationTurboModuleManagerDelegate::registerNatives() { | ||||
|   registerHybrid({ | ||||
|       makeNativeMethod( | ||||
|           "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), | ||||
|       makeNativeMethod( | ||||
|           "canCreateTurboModule", | ||||
|           MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), | ||||
|   }); | ||||
| } | ||||
|  | ||||
| std::shared_ptr<TurboModule> | ||||
| MainApplicationTurboModuleManagerDelegate::getTurboModule( | ||||
|     const std::string name, | ||||
|     const std::shared_ptr<CallInvoker> jsInvoker) { | ||||
|   // Not implemented yet: provide pure-C++ NativeModules here. | ||||
|   return nullptr; | ||||
| } | ||||
|  | ||||
| std::shared_ptr<TurboModule> | ||||
| MainApplicationTurboModuleManagerDelegate::getTurboModule( | ||||
|     const std::string name, | ||||
|     const JavaTurboModule::InitParams ¶ms) { | ||||
|   return MainApplicationModuleProvider(name, params); | ||||
| } | ||||
|  | ||||
| bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( | ||||
|     std::string name) { | ||||
|   return getTurboModule(name, nullptr) != nullptr || | ||||
|       getTurboModule(name, {.moduleName = name}) != nullptr; | ||||
| } | ||||
|  | ||||
| } // namespace react | ||||
| } // namespace facebook | ||||
| @@ -0,0 +1,38 @@ | ||||
| #include <memory> | ||||
| #include <string> | ||||
|  | ||||
| #include <ReactCommon/TurboModuleManagerDelegate.h> | ||||
| #include <fbjni/fbjni.h> | ||||
|  | ||||
| namespace facebook { | ||||
| namespace react { | ||||
|  | ||||
| class MainApplicationTurboModuleManagerDelegate | ||||
|     : public jni::HybridClass< | ||||
|           MainApplicationTurboModuleManagerDelegate, | ||||
|           TurboModuleManagerDelegate> { | ||||
|  public: | ||||
|   // Adapt it to the package you used for your Java class. | ||||
|   static constexpr auto kJavaDescriptor = | ||||
|       "Lcom/testhotupdate/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; | ||||
|  | ||||
|   static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>); | ||||
|  | ||||
|   static void registerNatives(); | ||||
|  | ||||
|   std::shared_ptr<TurboModule> getTurboModule( | ||||
|       const std::string name, | ||||
|       const std::shared_ptr<CallInvoker> jsInvoker) override; | ||||
|   std::shared_ptr<TurboModule> getTurboModule( | ||||
|       const std::string name, | ||||
|       const JavaTurboModule::InitParams ¶ms) override; | ||||
|  | ||||
|   /** | ||||
|    * Test-only method. Allows user to verify whether a TurboModule can be | ||||
|    * created by instances of this class. | ||||
|    */ | ||||
|   bool canCreateTurboModule(std::string name); | ||||
| }; | ||||
|  | ||||
| } // namespace react | ||||
| } // namespace facebook | ||||
| @@ -0,0 +1,61 @@ | ||||
| #include "MainComponentsRegistry.h" | ||||
|  | ||||
| #include <CoreComponentsRegistry.h> | ||||
| #include <fbjni/fbjni.h> | ||||
| #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h> | ||||
| #include <react/renderer/components/rncore/ComponentDescriptors.h> | ||||
|  | ||||
| namespace facebook { | ||||
| namespace react { | ||||
|  | ||||
| MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} | ||||
|  | ||||
| std::shared_ptr<ComponentDescriptorProviderRegistry const> | ||||
| MainComponentsRegistry::sharedProviderRegistry() { | ||||
|   auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); | ||||
|  | ||||
|   // Custom Fabric Components go here. You can register custom | ||||
|   // components coming from your App or from 3rd party libraries here. | ||||
|   // | ||||
|   // providerRegistry->add(concreteComponentDescriptorProvider< | ||||
|   //        AocViewerComponentDescriptor>()); | ||||
|   return providerRegistry; | ||||
| } | ||||
|  | ||||
| jni::local_ref<MainComponentsRegistry::jhybriddata> | ||||
| MainComponentsRegistry::initHybrid( | ||||
|     jni::alias_ref<jclass>, | ||||
|     ComponentFactory *delegate) { | ||||
|   auto instance = makeCxxInstance(delegate); | ||||
|  | ||||
|   auto buildRegistryFunction = | ||||
|       [](EventDispatcher::Weak const &eventDispatcher, | ||||
|          ContextContainer::Shared const &contextContainer) | ||||
|       -> ComponentDescriptorRegistry::Shared { | ||||
|     auto registry = MainComponentsRegistry::sharedProviderRegistry() | ||||
|                         ->createComponentDescriptorRegistry( | ||||
|                             {eventDispatcher, contextContainer}); | ||||
|  | ||||
|     auto mutableRegistry = | ||||
|         std::const_pointer_cast<ComponentDescriptorRegistry>(registry); | ||||
|  | ||||
|     mutableRegistry->setFallbackComponentDescriptor( | ||||
|         std::make_shared<UnimplementedNativeViewComponentDescriptor>( | ||||
|             ComponentDescriptorParameters{ | ||||
|                 eventDispatcher, contextContainer, nullptr})); | ||||
|  | ||||
|     return registry; | ||||
|   }; | ||||
|  | ||||
|   delegate->buildRegistryFunction = buildRegistryFunction; | ||||
|   return instance; | ||||
| } | ||||
|  | ||||
| void MainComponentsRegistry::registerNatives() { | ||||
|   registerHybrid({ | ||||
|       makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), | ||||
|   }); | ||||
| } | ||||
|  | ||||
| } // namespace react | ||||
| } // namespace facebook | ||||
| @@ -0,0 +1,32 @@ | ||||
| #pragma once | ||||
|  | ||||
| #include <ComponentFactory.h> | ||||
| #include <fbjni/fbjni.h> | ||||
| #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h> | ||||
| #include <react/renderer/componentregistry/ComponentDescriptorRegistry.h> | ||||
|  | ||||
| namespace facebook { | ||||
| namespace react { | ||||
|  | ||||
| class MainComponentsRegistry | ||||
|     : public facebook::jni::HybridClass<MainComponentsRegistry> { | ||||
|  public: | ||||
|   // Adapt it to the package you used for your Java class. | ||||
|   constexpr static auto kJavaDescriptor = | ||||
|       "Lcom/testhotupdate/newarchitecture/components/MainComponentsRegistry;"; | ||||
|  | ||||
|   static void registerNatives(); | ||||
|  | ||||
|   MainComponentsRegistry(ComponentFactory *delegate); | ||||
|  | ||||
|  private: | ||||
|   static std::shared_ptr<ComponentDescriptorProviderRegistry const> | ||||
|   sharedProviderRegistry(); | ||||
|  | ||||
|   static jni::local_ref<jhybriddata> initHybrid( | ||||
|       jni::alias_ref<jclass>, | ||||
|       ComponentFactory *delegate); | ||||
| }; | ||||
|  | ||||
| } // namespace react | ||||
| } // namespace facebook | ||||
							
								
								
									
										11
									
								
								Example/testHotUpdate/android/app/src/main/jni/OnLoad.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Example/testHotUpdate/android/app/src/main/jni/OnLoad.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| #include <fbjni/fbjni.h> | ||||
| #include "MainApplicationTurboModuleManagerDelegate.h" | ||||
| #include "MainComponentsRegistry.h" | ||||
|  | ||||
| JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { | ||||
|   return facebook::jni::initialize(vm, [] { | ||||
|     facebook::react::MainApplicationTurboModuleManagerDelegate:: | ||||
|         registerNatives(); | ||||
|     facebook::react::MainComponentsRegistry::registerNatives(); | ||||
|   }); | ||||
| } | ||||
| @@ -0,0 +1,36 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <!-- Copyright (C) 2014 The Android Open Source Project | ||||
|  | ||||
|      Licensed under the Apache License, Version 2.0 (the "License"); | ||||
|      you may not use this file except in compliance with the License. | ||||
|      You may obtain a copy of the License at | ||||
|  | ||||
|           http://www.apache.org/licenses/LICENSE-2.0 | ||||
|  | ||||
|      Unless required by applicable law or agreed to in writing, software | ||||
|      distributed under the License is distributed on an "AS IS" BASIS, | ||||
|      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
|      See the License for the specific language governing permissions and | ||||
|      limitations under the License. | ||||
| --> | ||||
| <inset xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|        android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material" | ||||
|        android:insetRight="@dimen/abc_edit_text_inset_horizontal_material" | ||||
|        android:insetTop="@dimen/abc_edit_text_inset_top_material" | ||||
|        android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"> | ||||
|  | ||||
|     <selector> | ||||
|         <!--  | ||||
|           This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I). | ||||
|           The item below with state_pressed="false" and state_focused="false" causes a NullPointerException. | ||||
|           NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' | ||||
|  | ||||
|           <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/> | ||||
|  | ||||
|           For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR. | ||||
|         --> | ||||
|         <item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/> | ||||
|         <item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/> | ||||
|     </selector> | ||||
|  | ||||
| </inset> | ||||
| @@ -1,3 +1,3 @@ | ||||
| <resources> | ||||
|     <string name="app_name">testHotUpdate</string> | ||||
|     <string name="app_name">testHotupdate</string> | ||||
| </resources> | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
|     <!-- Base application theme. --> | ||||
|     <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> | ||||
|         <!-- Customize your theme here. --> | ||||
|         <item name="android:editTextBackground">@drawable/rn_edit_text_material</item> | ||||
|     </style> | ||||
|  | ||||
| </resources> | ||||
|   | ||||
| @@ -1,20 +1,30 @@ | ||||
| import org.apache.tools.ant.taskdefs.condition.Os | ||||
|  | ||||
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | ||||
|  | ||||
| buildscript { | ||||
|     ext { | ||||
|         buildToolsVersion = "30.0.2" | ||||
|         buildToolsVersion = "31.0.0" | ||||
|         minSdkVersion = 21 | ||||
|         compileSdkVersion = 30 | ||||
|         targetSdkVersion = 30 | ||||
|         ndkVersion = "21.4.7075529" | ||||
|         compileSdkVersion = 31 | ||||
|         targetSdkVersion = 31 | ||||
|  | ||||
|         if (System.properties['os.arch'] == "aarch64") { | ||||
|             // For M1 Users we need to use the NDK 24 which added support for aarch64 | ||||
|             ndkVersion = "24.0.8215888" | ||||
|         } else { | ||||
|             // Otherwise we default to the side-by-side NDK version from AGP. | ||||
|             ndkVersion = "21.4.7075529" | ||||
|         } | ||||
|     } | ||||
|     repositories { | ||||
|         google() | ||||
|         mavenCentral() | ||||
|     } | ||||
|     dependencies { | ||||
|         classpath('com.android.tools.build:gradle:4.2.2') | ||||
|  | ||||
|         classpath("com.android.tools.build:gradle:7.0.4") | ||||
|         classpath("com.facebook.react:react-native-gradle-plugin") | ||||
|         classpath("de.undercouch:gradle-download-task:4.1.2") | ||||
|         // NOTE: Do not place your application dependencies here; they belong | ||||
|         // in the individual module build.gradle files | ||||
|     } | ||||
| @@ -22,8 +32,6 @@ buildscript { | ||||
|  | ||||
| allprojects { | ||||
|     repositories { | ||||
|         mavenCentral() | ||||
|         mavenLocal() | ||||
|         maven { | ||||
|             // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||||
|             url("$rootDir/../node_modules/react-native/android") | ||||
| @@ -32,7 +40,13 @@ allprojects { | ||||
|             // Android JSC is installed from npm | ||||
|             url("$rootDir/../node_modules/jsc-android/dist") | ||||
|         } | ||||
|  | ||||
|         mavenCentral { | ||||
|             // We don't want to fetch react-native from Maven Central as there are | ||||
|             // older versions over there. | ||||
|             content { | ||||
|                 excludeGroup "com.facebook.react" | ||||
|             } | ||||
|         } | ||||
|         google() | ||||
|         maven { url 'https://www.jitpack.io' } | ||||
|     } | ||||
|   | ||||
| @@ -9,8 +9,8 @@ | ||||
|  | ||||
| # Specifies the JVM arguments used for the daemon process. | ||||
| # The setting is particularly useful for tweaking memory settings. | ||||
| # Default value: -Xmx10248m -XX:MaxPermSize=256m | ||||
| # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||||
| # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m | ||||
| org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m | ||||
|  | ||||
| # When configured, Gradle will run in incubating parallel mode. | ||||
| # This option should only be used with decoupled projects. More details, visit | ||||
| @@ -25,4 +25,16 @@ android.useAndroidX=true | ||||
| android.enableJetifier=true | ||||
|  | ||||
| # Version of flipper SDK to use with React Native | ||||
| FLIPPER_VERSION=0.99.0 | ||||
| FLIPPER_VERSION=0.125.0 | ||||
|  | ||||
| # Use this property to specify which architecture you want to build. | ||||
| # You can also override it from the CLI using | ||||
| # ./gradlew <task> -PreactNativeArchitectures=x86_64 | ||||
| reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 | ||||
|  | ||||
| # Use this property to enable support to the new architecture. | ||||
| # This will allow you to use TurboModules and the Fabric render in | ||||
| # your application. You should enable this flag either if you want | ||||
| # to write custom TurboModules/Fabric components OR use libraries that | ||||
| # are providing them. | ||||
| newArchEnabled=false | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,5 +1,5 @@ | ||||
| distributionBase=GRADLE_USER_HOME | ||||
| distributionPath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip | ||||
| zipStoreBase=GRADLE_USER_HOME | ||||
| zipStorePath=wrapper/dists | ||||
|   | ||||
							
								
								
									
										271
									
								
								Example/testHotUpdate/android/gradlew
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										271
									
								
								Example/testHotUpdate/android/gradlew
									
									
									
									
										vendored
									
									
								
							| @@ -1,7 +1,7 @@ | ||||
| #!/usr/bin/env sh | ||||
| #!/bin/sh | ||||
|  | ||||
| # | ||||
| # Copyright 2015 the original author or authors. | ||||
| # Copyright © 2015-2021 the original authors. | ||||
| # | ||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| # you may not use this file except in compliance with the License. | ||||
| @@ -17,78 +17,113 @@ | ||||
| # | ||||
|  | ||||
| ############################################################################## | ||||
| ## | ||||
| ##  Gradle start up script for UN*X | ||||
| ## | ||||
| # | ||||
| #   Gradle start up script for POSIX generated by Gradle. | ||||
| # | ||||
| #   Important for running: | ||||
| # | ||||
| #   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is | ||||
| #       noncompliant, but you have some other compliant shell such as ksh or | ||||
| #       bash, then to run this script, type that shell name before the whole | ||||
| #       command line, like: | ||||
| # | ||||
| #           ksh Gradle | ||||
| # | ||||
| #       Busybox and similar reduced shells will NOT work, because this script | ||||
| #       requires all of these POSIX shell features: | ||||
| #         * functions; | ||||
| #         * expansions «$var», «${var}», «${var:-default}», «${var+SET}», | ||||
| #           «${var#prefix}», «${var%suffix}», and «$( cmd )»; | ||||
| #         * compound commands having a testable exit status, especially «case»; | ||||
| #         * various built-in commands including «command», «set», and «ulimit». | ||||
| # | ||||
| #   Important for patching: | ||||
| # | ||||
| #   (2) This script targets any POSIX shell, so it avoids extensions provided | ||||
| #       by Bash, Ksh, etc; in particular arrays are avoided. | ||||
| # | ||||
| #       The "traditional" practice of packing multiple parameters into a | ||||
| #       space-separated string is a well documented source of bugs and security | ||||
| #       problems, so this is (mostly) avoided, by progressively accumulating | ||||
| #       options in "$@", and eventually passing that to Java. | ||||
| # | ||||
| #       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, | ||||
| #       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; | ||||
| #       see the in-line comments for details. | ||||
| # | ||||
| #       There are tweaks for specific operating systems such as AIX, CygWin, | ||||
| #       Darwin, MinGW, and NonStop. | ||||
| # | ||||
| #   (3) This script is generated from the Groovy template | ||||
| #       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | ||||
| #       within the Gradle project. | ||||
| # | ||||
| #       You can find Gradle at https://github.com/gradle/gradle/. | ||||
| # | ||||
| ############################################################################## | ||||
|  | ||||
| # Attempt to set APP_HOME | ||||
|  | ||||
| # Resolve links: $0 may be a link | ||||
| PRG="$0" | ||||
| # Need this for relative symlinks. | ||||
| while [ -h "$PRG" ] ; do | ||||
|     ls=`ls -ld "$PRG"` | ||||
|     link=`expr "$ls" : '.*-> \(.*\)$'` | ||||
|     if expr "$link" : '/.*' > /dev/null; then | ||||
|         PRG="$link" | ||||
|     else | ||||
|         PRG=`dirname "$PRG"`"/$link" | ||||
|     fi | ||||
| app_path=$0 | ||||
|  | ||||
| # Need this for daisy-chained symlinks. | ||||
| while | ||||
|     APP_HOME=${app_path%"${app_path##*/}"}  # leaves a trailing /; empty if no leading path | ||||
|     [ -h "$app_path" ] | ||||
| do | ||||
|     ls=$( ls -ld "$app_path" ) | ||||
|     link=${ls#*' -> '} | ||||
|     case $link in             #( | ||||
|       /*)   app_path=$link ;; #( | ||||
|       *)    app_path=$APP_HOME$link ;; | ||||
|     esac | ||||
| done | ||||
| SAVED="`pwd`" | ||||
| cd "`dirname \"$PRG\"`/" >/dev/null | ||||
| APP_HOME="`pwd -P`" | ||||
| cd "$SAVED" >/dev/null | ||||
|  | ||||
| APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit | ||||
|  | ||||
| APP_NAME="Gradle" | ||||
| APP_BASE_NAME=`basename "$0"` | ||||
| APP_BASE_NAME=${0##*/} | ||||
|  | ||||
| # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||||
| DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | ||||
|  | ||||
| # Use the maximum available, or set MAX_FD != -1 to use that value. | ||||
| MAX_FD="maximum" | ||||
| MAX_FD=maximum | ||||
|  | ||||
| warn () { | ||||
|     echo "$*" | ||||
| } | ||||
| } >&2 | ||||
|  | ||||
| die () { | ||||
|     echo | ||||
|     echo "$*" | ||||
|     echo | ||||
|     exit 1 | ||||
| } | ||||
| } >&2 | ||||
|  | ||||
| # OS specific support (must be 'true' or 'false'). | ||||
| cygwin=false | ||||
| msys=false | ||||
| darwin=false | ||||
| nonstop=false | ||||
| case "`uname`" in | ||||
|   CYGWIN* ) | ||||
|     cygwin=true | ||||
|     ;; | ||||
|   Darwin* ) | ||||
|     darwin=true | ||||
|     ;; | ||||
|   MINGW* ) | ||||
|     msys=true | ||||
|     ;; | ||||
|   NONSTOP* ) | ||||
|     nonstop=true | ||||
|     ;; | ||||
| case "$( uname )" in                #( | ||||
|   CYGWIN* )         cygwin=true  ;; #( | ||||
|   Darwin* )         darwin=true  ;; #( | ||||
|   MSYS* | MINGW* )  msys=true    ;; #( | ||||
|   NONSTOP* )        nonstop=true ;; | ||||
| esac | ||||
|  | ||||
| CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||||
|  | ||||
|  | ||||
| # Determine the Java command to use to start the JVM. | ||||
| if [ -n "$JAVA_HOME" ] ; then | ||||
|     if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||||
|         # IBM's JDK on AIX uses strange locations for the executables | ||||
|         JAVACMD="$JAVA_HOME/jre/sh/java" | ||||
|         JAVACMD=$JAVA_HOME/jre/sh/java | ||||
|     else | ||||
|         JAVACMD="$JAVA_HOME/bin/java" | ||||
|         JAVACMD=$JAVA_HOME/bin/java | ||||
|     fi | ||||
|     if [ ! -x "$JAVACMD" ] ; then | ||||
|         die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||||
| @@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the | ||||
| location of your Java installation." | ||||
|     fi | ||||
| else | ||||
|     JAVACMD="java" | ||||
|     JAVACMD=java | ||||
|     which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||||
|  | ||||
| Please set the JAVA_HOME variable in your environment to match the | ||||
| @@ -105,79 +140,95 @@ location of your Java installation." | ||||
| fi | ||||
|  | ||||
| # Increase the maximum file descriptors if we can. | ||||
| if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | ||||
|     MAX_FD_LIMIT=`ulimit -H -n` | ||||
|     if [ $? -eq 0 ] ; then | ||||
|         if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||||
|             MAX_FD="$MAX_FD_LIMIT" | ||||
|         fi | ||||
|         ulimit -n $MAX_FD | ||||
|         if [ $? -ne 0 ] ; then | ||||
|             warn "Could not set maximum file descriptor limit: $MAX_FD" | ||||
|         fi | ||||
|     else | ||||
|         warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||||
|     fi | ||||
| fi | ||||
|  | ||||
| # For Darwin, add options to specify how the application appears in the dock | ||||
| if $darwin; then | ||||
|     GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||||
| fi | ||||
|  | ||||
| # For Cygwin or MSYS, switch paths to Windows format before running java | ||||
| if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then | ||||
|     APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||||
|     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||||
|     JAVACMD=`cygpath --unix "$JAVACMD"` | ||||
|  | ||||
|     # We build the pattern for arguments to be converted via cygpath | ||||
|     ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||||
|     SEP="" | ||||
|     for dir in $ROOTDIRSRAW ; do | ||||
|         ROOTDIRS="$ROOTDIRS$SEP$dir" | ||||
|         SEP="|" | ||||
|     done | ||||
|     OURCYGPATTERN="(^($ROOTDIRS))" | ||||
|     # Add a user-defined pattern to the cygpath arguments | ||||
|     if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||||
|         OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||||
|     fi | ||||
|     # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||||
|     i=0 | ||||
|     for arg in "$@" ; do | ||||
|         CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||||
|         CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option | ||||
|  | ||||
|         if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition | ||||
|             eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||||
|         else | ||||
|             eval `echo args$i`="\"$arg\"" | ||||
|         fi | ||||
|         i=`expr $i + 1` | ||||
|     done | ||||
|     case $i in | ||||
|         0) set -- ;; | ||||
|         1) set -- "$args0" ;; | ||||
|         2) set -- "$args0" "$args1" ;; | ||||
|         3) set -- "$args0" "$args1" "$args2" ;; | ||||
|         4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||||
|         5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||||
|         6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||||
|         7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||||
|         8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||||
|         9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||||
| if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then | ||||
|     case $MAX_FD in #( | ||||
|       max*) | ||||
|         MAX_FD=$( ulimit -H -n ) || | ||||
|             warn "Could not query maximum file descriptor limit" | ||||
|     esac | ||||
|     case $MAX_FD in  #( | ||||
|       '' | soft) :;; #( | ||||
|       *) | ||||
|         ulimit -n "$MAX_FD" || | ||||
|             warn "Could not set maximum file descriptor limit to $MAX_FD" | ||||
|     esac | ||||
| fi | ||||
|  | ||||
| # Escape application args | ||||
| save () { | ||||
|     for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | ||||
|     echo " " | ||||
| } | ||||
| APP_ARGS=`save "$@"` | ||||
| # Collect all arguments for the java command, stacking in reverse order: | ||||
| #   * args from the command line | ||||
| #   * the main class name | ||||
| #   * -classpath | ||||
| #   * -D...appname settings | ||||
| #   * --module-path (only if needed) | ||||
| #   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. | ||||
|  | ||||
| # Collect all arguments for the java command, following the shell quoting and substitution rules | ||||
| eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | ||||
| # For Cygwin or MSYS, switch paths to Windows format before running java | ||||
| if "$cygwin" || "$msys" ; then | ||||
|     APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) | ||||
|     CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) | ||||
|  | ||||
| exec "$JAVACMD" "$@" | ||||
|     JAVACMD=$( cygpath --unix "$JAVACMD" ) | ||||
|  | ||||
|     # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||||
|     for arg do | ||||
|         if | ||||
|             case $arg in                                #( | ||||
|               -*)   false ;;                            # don't mess with options #( | ||||
|               /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath | ||||
|                     [ -e "$t" ] ;;                      #( | ||||
|               *)    false ;; | ||||
|             esac | ||||
|         then | ||||
|             arg=$( cygpath --path --ignore --mixed "$arg" ) | ||||
|         fi | ||||
|         # Roll the args list around exactly as many times as the number of | ||||
|         # args, so each arg winds up back in the position where it started, but | ||||
|         # possibly modified. | ||||
|         # | ||||
|         # NB: a `for` loop captures its iteration list before it begins, so | ||||
|         # changing the positional parameters here affects neither the number of | ||||
|         # iterations, nor the values presented in `arg`. | ||||
|         shift                   # remove old arg | ||||
|         set -- "$@" "$arg"      # push replacement arg | ||||
|     done | ||||
| fi | ||||
|  | ||||
| # Collect all arguments for the java command; | ||||
| #   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of | ||||
| #     shell script including quotes and variable substitutions, so put them in | ||||
| #     double quotes to make sure that they get re-expanded; and | ||||
| #   * put everything else in single quotes, so that it's not re-expanded. | ||||
|  | ||||
| set -- \ | ||||
|         "-Dorg.gradle.appname=$APP_BASE_NAME" \ | ||||
|         -classpath "$CLASSPATH" \ | ||||
|         org.gradle.wrapper.GradleWrapperMain \ | ||||
|         "$@" | ||||
|  | ||||
| # Use "xargs" to parse quoted args. | ||||
| # | ||||
| # With -n1 it outputs one arg per line, with the quotes and backslashes removed. | ||||
| # | ||||
| # In Bash we could simply go: | ||||
| # | ||||
| #   readarray ARGS < <( xargs -n1 <<<"$var" ) && | ||||
| #   set -- "${ARGS[@]}" "$@" | ||||
| # | ||||
| # but POSIX shell has neither arrays nor command substitution, so instead we | ||||
| # post-process each arg (as a line of input to sed) to backslash-escape any | ||||
| # character that might be a shell metacharacter, then use eval to reverse | ||||
| # that process (while maintaining the separation between arguments), and wrap | ||||
| # the whole thing up as a single "set" statement. | ||||
| # | ||||
| # This will of course break if any of these variables contains a newline or | ||||
| # an unmatched quote. | ||||
| # | ||||
|  | ||||
| eval "set -- $( | ||||
|         printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | | ||||
|         xargs -n1 | | ||||
|         sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | | ||||
|         tr '\n' ' ' | ||||
|     )" '"$@"' | ||||
|  | ||||
| exec "$JAVACMD" "$@" | ||||
|   | ||||
							
								
								
									
										178
									
								
								Example/testHotUpdate/android/gradlew.bat
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										178
									
								
								Example/testHotUpdate/android/gradlew.bat
									
									
									
									
										vendored
									
									
								
							| @@ -1,89 +1,89 @@ | ||||
| @rem | ||||
| @rem Copyright 2015 the original author or authors. | ||||
| @rem | ||||
| @rem Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| @rem you may not use this file except in compliance with the License. | ||||
| @rem You may obtain a copy of the License at | ||||
| @rem | ||||
| @rem      https://www.apache.org/licenses/LICENSE-2.0 | ||||
| @rem | ||||
| @rem Unless required by applicable law or agreed to in writing, software | ||||
| @rem distributed under the License is distributed on an "AS IS" BASIS, | ||||
| @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| @rem See the License for the specific language governing permissions and | ||||
| @rem limitations under the License. | ||||
| @rem | ||||
|  | ||||
| @if "%DEBUG%" == "" @echo off | ||||
| @rem ########################################################################## | ||||
| @rem | ||||
| @rem  Gradle startup script for Windows | ||||
| @rem | ||||
| @rem ########################################################################## | ||||
|  | ||||
| @rem Set local scope for the variables with windows NT shell | ||||
| if "%OS%"=="Windows_NT" setlocal | ||||
|  | ||||
| set DIRNAME=%~dp0 | ||||
| if "%DIRNAME%" == "" set DIRNAME=. | ||||
| set APP_BASE_NAME=%~n0 | ||||
| set APP_HOME=%DIRNAME% | ||||
|  | ||||
| @rem Resolve any "." and ".." in APP_HOME to make it shorter. | ||||
| for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi | ||||
|  | ||||
| @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||||
| set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" | ||||
|  | ||||
| @rem Find java.exe | ||||
| if defined JAVA_HOME goto findJavaFromJavaHome | ||||
|  | ||||
| set JAVA_EXE=java.exe | ||||
| %JAVA_EXE% -version >NUL 2>&1 | ||||
| if "%ERRORLEVEL%" == "0" goto execute | ||||
|  | ||||
| echo. | ||||
| echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||||
| echo. | ||||
| echo Please set the JAVA_HOME variable in your environment to match the | ||||
| echo location of your Java installation. | ||||
|  | ||||
| goto fail | ||||
|  | ||||
| :findJavaFromJavaHome | ||||
| set JAVA_HOME=%JAVA_HOME:"=% | ||||
| set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||||
|  | ||||
| if exist "%JAVA_EXE%" goto execute | ||||
|  | ||||
| echo. | ||||
| echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||||
| echo. | ||||
| echo Please set the JAVA_HOME variable in your environment to match the | ||||
| echo location of your Java installation. | ||||
|  | ||||
| goto fail | ||||
|  | ||||
| :execute | ||||
| @rem Setup the command line | ||||
|  | ||||
| set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||||
|  | ||||
|  | ||||
| @rem Execute Gradle | ||||
| "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* | ||||
|  | ||||
| :end | ||||
| @rem End local scope for the variables with windows NT shell | ||||
| if "%ERRORLEVEL%"=="0" goto mainEnd | ||||
|  | ||||
| :fail | ||||
| rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||||
| rem the _cmd.exe /c_ return code! | ||||
| if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||||
| exit /b 1 | ||||
|  | ||||
| :mainEnd | ||||
| if "%OS%"=="Windows_NT" endlocal | ||||
|  | ||||
| :omega | ||||
| @rem | ||||
| @rem Copyright 2015 the original author or authors. | ||||
| @rem | ||||
| @rem Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| @rem you may not use this file except in compliance with the License. | ||||
| @rem You may obtain a copy of the License at | ||||
| @rem | ||||
| @rem      https://www.apache.org/licenses/LICENSE-2.0 | ||||
| @rem | ||||
| @rem Unless required by applicable law or agreed to in writing, software | ||||
| @rem distributed under the License is distributed on an "AS IS" BASIS, | ||||
| @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| @rem See the License for the specific language governing permissions and | ||||
| @rem limitations under the License. | ||||
| @rem | ||||
|  | ||||
| @if "%DEBUG%" == "" @echo off | ||||
| @rem ########################################################################## | ||||
| @rem | ||||
| @rem  Gradle startup script for Windows | ||||
| @rem | ||||
| @rem ########################################################################## | ||||
|  | ||||
| @rem Set local scope for the variables with windows NT shell | ||||
| if "%OS%"=="Windows_NT" setlocal | ||||
|  | ||||
| set DIRNAME=%~dp0 | ||||
| if "%DIRNAME%" == "" set DIRNAME=. | ||||
| set APP_BASE_NAME=%~n0 | ||||
| set APP_HOME=%DIRNAME% | ||||
|  | ||||
| @rem Resolve any "." and ".." in APP_HOME to make it shorter. | ||||
| for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi | ||||
|  | ||||
| @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||||
| set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" | ||||
|  | ||||
| @rem Find java.exe | ||||
| if defined JAVA_HOME goto findJavaFromJavaHome | ||||
|  | ||||
| set JAVA_EXE=java.exe | ||||
| %JAVA_EXE% -version >NUL 2>&1 | ||||
| if "%ERRORLEVEL%" == "0" goto execute | ||||
|  | ||||
| echo. | ||||
| echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||||
| echo. | ||||
| echo Please set the JAVA_HOME variable in your environment to match the | ||||
| echo location of your Java installation. | ||||
|  | ||||
| goto fail | ||||
|  | ||||
| :findJavaFromJavaHome | ||||
| set JAVA_HOME=%JAVA_HOME:"=% | ||||
| set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||||
|  | ||||
| if exist "%JAVA_EXE%" goto execute | ||||
|  | ||||
| echo. | ||||
| echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||||
| echo. | ||||
| echo Please set the JAVA_HOME variable in your environment to match the | ||||
| echo location of your Java installation. | ||||
|  | ||||
| goto fail | ||||
|  | ||||
| :execute | ||||
| @rem Setup the command line | ||||
|  | ||||
| set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||||
|  | ||||
|  | ||||
| @rem Execute Gradle | ||||
| "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* | ||||
|  | ||||
| :end | ||||
| @rem End local scope for the variables with windows NT shell | ||||
| if "%ERRORLEVEL%"=="0" goto mainEnd | ||||
|  | ||||
| :fail | ||||
| rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||||
| rem the _cmd.exe /c_ return code! | ||||
| if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||||
| exit /b 1 | ||||
|  | ||||
| :mainEnd | ||||
| if "%OS%"=="Windows_NT" endlocal | ||||
|  | ||||
| :omega | ||||
|   | ||||
| @@ -1,3 +1,9 @@ | ||||
| rootProject.name = 'testHotUpdate' | ||||
| rootProject.name = 'testHotupdate' | ||||
| apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) | ||||
| include ':app' | ||||
| includeBuild('../node_modules/react-native-gradle-plugin') | ||||
|  | ||||
| if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { | ||||
|     include(":ReactAndroid") | ||||
|     project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 sunnylqm
					sunnylqm