diff --git a/.github/workflows/react-native-code-push-ci.yml b/.github/workflows/react-native-code-push-ci.yml index 58cf88f61..27e2c2029 100644 --- a/.github/workflows/react-native-code-push-ci.yml +++ b/.github/workflows/react-native-code-push-ci.yml @@ -38,7 +38,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7.4' + ruby-version: '2.7.6' bundler-cache: true - name: Package Installation run: npm install @@ -58,7 +58,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7.4' + ruby-version: '2.7.6' bundler-cache: true - name: Install dependencies run: npm install diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88b57143b..cc30651c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,10 +37,10 @@ Follow these steps to test your modifications to the plugin manually: First, make sure you have installed the dependencies for the plugin by following the steps above. -Then, make sure you have installed `react-native-cli`. +Then, make sure you have installed `react-native`. ``` -npm install -g react-native-cli +npm install -g react-native ``` To run Android tests, make sure you have `sdk\tools`, `sdk\emulator` and `sdk\platform-tools` in your PATH. @@ -131,4 +131,4 @@ To run the core unit tests on Android and pull the plugin from NPM: NPM=true CORE=true npm run test:android ``` -...and so on! \ No newline at end of file +...and so on! diff --git a/Examples/CodePushDemoApp/ios/Podfile.lock b/Examples/CodePushDemoApp/ios/Podfile.lock index a7f4e7815..c100c1a3d 100644 --- a/Examples/CodePushDemoApp/ios/Podfile.lock +++ b/Examples/CodePushDemoApp/ios/Podfile.lock @@ -6,7 +6,7 @@ PODS: - Base64 (~> 1.1) - JWT (~> 3.0.0-beta.12) - React-Core - - SSZipArchive (~> 2.2.2) + - SSZipArchive (2.2.2) - DoubleConversion (1.1.6) - FBLazyVector (0.66.0) - FBReactNativeSpec (0.66.0): @@ -345,7 +345,7 @@ PODS: - React-jsi (= 0.66.0) - React-logger (= 0.66.0) - React-perflogger (= 0.66.0) - - SSZipArchive (2.2.3) + - SSZipArchive (2.2.2) - Yoga (1.14.0) - YogaKit (1.18.1): - Yoga (~> 1.14) diff --git a/Examples/CodePushDemoApp/yarn.lock b/Examples/CodePushDemoApp/yarn.lock index e62ee08fe..fd7571dca 100644 --- a/Examples/CodePushDemoApp/yarn.lock +++ b/Examples/CodePushDemoApp/yarn.lock @@ -2308,9 +2308,9 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: safe-buffer "~5.1.1" cookiejar@^2.1.2: - version "2.1.3" - resolved "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz" - integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== + version "2.1.4" + resolved "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b" + integrity "sha1-7macH+os9C3DFYVGnRk/7w1ldxs= sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==" copy-descriptor@^0.1.0: version "0.1.1" @@ -6971,9 +6971,9 @@ vlq@^1.0.0: integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w== vm2@^3.9.3: - version "3.9.13" - resolved "https://registry.npmjs.org/vm2/-/vm2-3.9.13.tgz" - integrity sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q== + version "3.9.19" + resolved "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz#be1e1d7a106122c6c492b4d51c2e8b93d3ed6a4a" + integrity "sha1-vh4dehBhIsbEkrTVHC6Lk9Ptako= sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==" dependencies: acorn "^8.7.0" acorn-walk "^8.2.0" diff --git a/Examples/CodePushDemoAppCpp/yarn.lock b/Examples/CodePushDemoAppCpp/yarn.lock index 4c5109dfa..10976c3bf 100644 --- a/Examples/CodePushDemoAppCpp/yarn.lock +++ b/Examples/CodePushDemoAppCpp/yarn.lock @@ -8241,9 +8241,9 @@ vlq@^1.0.0: integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w== vm2@^3.9.3: - version "3.9.13" - resolved "https://registry.npmjs.org/vm2/-/vm2-3.9.13.tgz" - integrity sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q== + version "3.9.16" + resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.16.tgz#0fbc2a265f7bf8b837cea6f4a908f88a3f93b8e6" + integrity sha512-3T9LscojNTxdOyG+e8gFeyBXkMlOBYDoF6dqZbj+MPVHi9x10UfiTAJIobuchRCp3QvC+inybTbMJIUrLsig0w== dependencies: acorn "^8.7.0" acorn-walk "^8.2.0" diff --git a/README.md b/README.md index 9542a7a42..2e2ede692 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,8 @@ We try our best to maintain backwards compatibility of our plugin with previous | v0.59 | v5.6+ *(RN refactored js bundle loader code)* | | v0.60-v0.61 | v6.0+ *(RN migrated to Autolinking)* | | v0.62-v0.64 | v6.2+ *(RN removed LiveReload)* | -| v0.65-v0.69 | v7.0+ *(RN updated iPhone-target-version)* | -| v0.71 | v7.1+ *(RN moved to react-native-gradle-plugin)* | +| v0.65-v0.70 | v7.0+ *(RN updated iPhone-target-version)* | +| v0.71 | v7.2+ *(RN moved to react-native-gradle-plugin)* | *NOTE: `react-native-code-push` versions lower than **[v5.7.0](https://github.com/microsoft/react-native-code-push/releases/tag/v5.7.0)** will stop working in the near future. You can find more information in our [documentation](https://github.com/microsoft/code-push/blob/master/migration-notice.md).* diff --git a/android/codepush.gradle b/android/codepush.gradle index bc44ee199..a0f9d2748 100644 --- a/android/codepush.gradle +++ b/android/codepush.gradle @@ -23,9 +23,7 @@ android.buildTypes.each { buildType -> buildType.resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis()) } - gradle.projectsEvaluated { - def debuggableVariants = config.debuggableVariants.get() ?: ['debug'] android.applicationVariants.all { variant -> diff --git a/code-push-plugin-testing-framework/script/testConfig.js b/code-push-plugin-testing-framework/script/testConfig.js index 40b7118f8..ba3651b76 100644 --- a/code-push-plugin-testing-framework/script/testConfig.js +++ b/code-push-plugin-testing-framework/script/testConfig.js @@ -2,7 +2,7 @@ // IMPORTS // var os = require("os"); var path = require("path"); -var TestUtil_1 = require("./TestUtil"); +var TestUtil_1 = require("./testUtil"); ////////////////////////////////////////////////////////////////////////////////////////// // Configuration variables. // What plugin to use, what project directories to use, etc. diff --git a/docs/setup-android.md b/docs/setup-android.md index 605dbeb1a..6201de2f1 100644 --- a/docs/setup-android.md +++ b/docs/setup-android.md @@ -27,11 +27,10 @@ In order to integrate CodePush into your Android project, please perform the fol project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app') ``` -2. In your `android/app/build.gradle` file, add the `codepush.gradle` file as an additional build task definition underneath `react.gradle`: +2. In your `android/app/build.gradle` file, add the `codepush.gradle` file as an additional build task definition to the end of the file: ```gradle ... - apply from: "../../node_modules/react-native/react.gradle" apply from: "../../node_modules/react-native-code-push/android/codepush.gradle" ... ``` diff --git a/package-lock.json b/package-lock.json index 0bf10f0f6..7054cd174 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-code-push", - "version": "7.1.0", + "version": "8.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "react-native-code-push", - "version": "7.1.0", + "version": "8.0.2", "license": "MIT", "dependencies": { "code-push": "^4.1.0", @@ -23,15 +23,15 @@ "@types/mocha": "^9.0.0", "@types/node": "^14.0.27", "@types/q": "^1.5.4", - "archiver": "latest", - "body-parser": "latest", + "archiver": "*", + "body-parser": "*", "code-push-plugin-testing-framework": "file:./code-push-plugin-testing-framework", "del": "v6.0.0", - "express": "latest", - "mkdirp": "latest", + "express": "*", + "mkdirp": "*", "mocha": "^9.2.0", "q": "^1.5.1", - "run-sequence": "latest", + "run-sequence": "*", "shx": "^0.3.4", "slash": "^3.0.0", "tslint": "^6.1.3", @@ -45,10 +45,10 @@ "dependencies": { "@types/uuid": "^8.3.1", "base-64": "^1.0.0", - "mocha": "latest", - "mocha-junit-reporter": "latest", + "mocha": "*", + "mocha-junit-reporter": "*", "q": "^1.5.1", - "replace": "latest", + "replace": "*", "superagent": "^6.1.0", "superagent-proxy": "^3.0.0", "uuid": "^8.3.2" @@ -1069,9 +1069,9 @@ } }, "node_modules/code-push": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/code-push/-/code-push-4.1.0.tgz", - "integrity": "sha512-vzaW9HpLFPREbrURdF430ImKDivBGQOGjoo7zL22hXvWM+jbApQiPCvUB8eQdvD8Wce1yPdfd7ccp6T4b2Holw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/code-push/-/code-push-4.1.1.tgz", + "integrity": "sha512-LZkn7bARuM1QTaOItI6fjL1iIVNydeZo5VEcQQuiSmRsQz+5C43ehoUQGM4lP093oDhnw8f9N3Qr8R4ns/GZOQ==", "dependencies": { "appcenter-file-upload-client": "0.1.0", "recursive-fs": "^2.1.0", @@ -3059,12 +3059,12 @@ } }, "node_modules/plist": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.5.tgz", - "integrity": "sha512-83vX4eYdQp3vP9SxuYgEM/G/pJQqLUz/V/xzPrzruLs7fz7jxGQ1msZ/mg1nwZxUSuOp4sb+/bEIbRrbzZRxDA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.6.tgz", + "integrity": "sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA==", "dependencies": { "base64-js": "^1.5.1", - "xmlbuilder": "^9.0.7" + "xmlbuilder": "^15.1.1" }, "engines": { "node": ">=6" @@ -4419,9 +4419,9 @@ } }, "node_modules/vm2": { - "version": "3.9.13", - "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.13.tgz", - "integrity": "sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q==", + "version": "3.9.19", + "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz", + "integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==", "dependencies": { "acorn": "^8.7.0", "acorn-walk": "^8.2.0" @@ -4517,11 +4517,11 @@ "dev": true }, "node_modules/xmlbuilder": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", "engines": { - "node": ">=4.0" + "node": ">=8.0" } }, "node_modules/xregexp": { @@ -5319,9 +5319,9 @@ "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=" }, "code-push": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/code-push/-/code-push-4.1.0.tgz", - "integrity": "sha512-vzaW9HpLFPREbrURdF430ImKDivBGQOGjoo7zL22hXvWM+jbApQiPCvUB8eQdvD8Wce1yPdfd7ccp6T4b2Holw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/code-push/-/code-push-4.1.1.tgz", + "integrity": "sha512-LZkn7bARuM1QTaOItI6fjL1iIVNydeZo5VEcQQuiSmRsQz+5C43ehoUQGM4lP093oDhnw8f9N3Qr8R4ns/GZOQ==", "requires": { "appcenter-file-upload-client": "0.1.0", "recursive-fs": "^2.1.0", @@ -5399,10 +5399,10 @@ "requires": { "@types/uuid": "^8.3.1", "base-64": "^1.0.0", - "mocha": "latest", - "mocha-junit-reporter": "latest", + "mocha": "*", + "mocha-junit-reporter": "*", "q": "^1.5.1", - "replace": "latest", + "replace": "*", "superagent": "^6.1.0", "superagent-proxy": "^3.0.0", "uuid": "^8.3.2" @@ -6946,12 +6946,12 @@ "dev": true }, "plist": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.5.tgz", - "integrity": "sha512-83vX4eYdQp3vP9SxuYgEM/G/pJQqLUz/V/xzPrzruLs7fz7jxGQ1msZ/mg1nwZxUSuOp4sb+/bEIbRrbzZRxDA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.6.tgz", + "integrity": "sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA==", "requires": { "base64-js": "^1.5.1", - "xmlbuilder": "^9.0.7" + "xmlbuilder": "^15.1.1" } }, "plugin-error": { @@ -7959,9 +7959,9 @@ "dev": true }, "vm2": { - "version": "3.9.13", - "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.13.tgz", - "integrity": "sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q==", + "version": "3.9.19", + "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz", + "integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==", "requires": { "acorn": "^8.7.0", "acorn-walk": "^8.2.0" @@ -8033,9 +8033,9 @@ "dev": true }, "xmlbuilder": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==" }, "xregexp": { "version": "2.0.0", diff --git a/package.json b/package.json index f78d6db8d..83b0d1a9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-code-push", - "version": "7.1.0", + "version": "8.0.2", "description": "React Native plugin for the CodePush service", "main": "CodePush.js", "typings": "typings/react-native-code-push.d.ts", diff --git a/test/template/index.android.js b/test/template/index.android.js deleted file mode 100644 index c0f5ee06a..000000000 --- a/test/template/index.android.js +++ /dev/null @@ -1 +0,0 @@ -import "./index.js"; \ No newline at end of file diff --git a/test/template/index.ios.js b/test/template/index.ios.js deleted file mode 100644 index c0f5ee06a..000000000 --- a/test/template/index.ios.js +++ /dev/null @@ -1 +0,0 @@ -import "./index.js"; \ No newline at end of file diff --git a/test/template/ios/TestCodePush/AppDelegate.m b/test/template/ios/TestCodePush/AppDelegate.m deleted file mode 100644 index 71e71ccfc..000000000 --- a/test/template/ios/TestCodePush/AppDelegate.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "AppDelegate.h" - -#import - -#import -#import -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge - moduleName:@"CODE_PUSH_TEST_APP_NAME" - initialProperties:nil]; - - rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - - - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge - { - return [CodePush bundleURL]; - } - -@end diff --git a/test/template/ios/TestCodePush/AppDelegate.mm b/test/template/ios/TestCodePush/AppDelegate.mm new file mode 100644 index 000000000..dce0b50fe --- /dev/null +++ b/test/template/ios/TestCodePush/AppDelegate.mm @@ -0,0 +1,41 @@ +#import "AppDelegate.h" + +#import + +#import +#import +#import + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; + RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge + moduleName:@"CODE_PUSH_TEST_APP_NAME" + initialProperties:nil]; + + self.moduleName = @"TestCodePush"; + // You can add your custom initial props in the dictionary below. + // They will be passed down to the ViewController used by React Native. + self.initialProps = @{}; + + return [super application:application didFinishLaunchingWithOptions:launchOptions]; +} + +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge +{ + return [CodePush bundleURL]; +} + +/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. +/// +/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html +/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). +/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`. +- (BOOL)concurrentRootEnabled +{ + return true; +} + +@end diff --git a/test/test.ts b/test/test.ts index 2b3255509..cbe72e15c 100644 --- a/test/test.ts +++ b/test/test.ts @@ -83,9 +83,10 @@ class RNAndroid extends Platform.Android implements RNPlatform { //// Set up gradle to build CodePush with the app // Add CodePush to android/app/build.gradle const buildGradle = path.join(innerprojectDirectory, "android", "app", "build.gradle"); + TestUtil.replaceString(buildGradle, - "apply from: \"../../node_modules/react-native/react.gradle\"", - "apply from: \"../../node_modules/react-native/react.gradle\"\napply from: \"" + gradleContent + "\""); + "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)\napply from: \"" + gradleContent + "\""); // Add CodePush to android/settings.gradle const settingsGradle = path.join(innerprojectDirectory, "android", "settings.gradle"); @@ -122,13 +123,10 @@ class RNAndroid extends Platform.Android implements RNPlatform { * Build function of the test application, the command depends on the OS */ buildFunction(androidDirectory: string): Q.Promise { - if (process.platform === "darwin") { - return TestUtil.getProcessOutput(`./gradlew assembleRelease --daemon`, { noLogStdOut: true, cwd: androidDirectory }) - .then(() => { return null; }); - } else { - return TestUtil.getProcessOutput(`gradlew assembleRelease --daemon`, { noLogStdOut: true, cwd: androidDirectory }) + const gradlewCommand = process.platform === "darwin" || process.platform === "linux" ? "./gradlew" : "gradlew"; + return TestUtil.getProcessOutput(`${gradlewCommand} clean`, { noLogStdOut: true, cwd: androidDirectory }) + .then(() => TestUtil.getProcessOutput(`${gradlewCommand} assembleRelease --daemon`, { noLogStdOut: true, cwd: androidDirectory })) .then(() => { return null; }); - } } /** @@ -178,7 +176,7 @@ class RNIOS extends Platform.IOS implements RNPlatform { installPlatform(projectDirectory: string): Q.Promise { const iOSProject: string = path.join(projectDirectory, TestConfig.TestAppName, "ios"); const infoPlistPath: string = path.join(iOSProject, TestConfig.TestAppName, "Info.plist"); - const appDelegatePath: string = path.join(iOSProject, TestConfig.TestAppName, "AppDelegate.m"); + const appDelegatePath: string = path.join(iOSProject, TestConfig.TestAppName, "AppDelegate.mm"); // Install the Podfile @@ -189,15 +187,17 @@ class RNIOS extends Platform.IOS implements RNPlatform { "CodePushDeploymentKey\n\t" + this.getDefaultDeploymentKey() + "\n\tCodePushServerURL\n\t" + this.getServerUrl() + "\n\t\n")) // Set the app version to 1.0.0 instead of 1.0 in the Info.plist .then(TestUtil.replaceString.bind(undefined, infoPlistPath, "1.0", "1.0.0")) + // Remove dependence of CFBundleShortVersionString from project.pbxproj + .then(TestUtil.replaceString.bind(undefined, infoPlistPath, "\\$\\(MARKETING_VERSION\\)", "1.0.0")) // Fix the linker flag list in project.pbxproj (pod install adds an extra comma) .then(TestUtil.replaceString.bind(undefined, path.join(iOSProject, TestConfig.TestAppName + ".xcodeproj", "project.pbxproj"), "\"[$][(]inherited[)]\",\\s*[)];", "\"$(inherited)\"\n\t\t\t\t);")) // Add the correct bundle identifier .then(TestUtil.replaceString.bind(undefined, path.join(iOSProject, TestConfig.TestAppName + ".xcodeproj", "project.pbxproj"), "PRODUCT_BUNDLE_IDENTIFIER = [^;]*", "PRODUCT_BUNDLE_IDENTIFIER = \"" + TestConfig.TestNamespace + "\"")) - // Copy the AppDelegate.m to the project + // Copy the AppDelegate.mm to the project .then(TestUtil.copyFile.bind(undefined, - path.join(TestConfig.templatePath, "ios", TestConfig.TestAppName, "AppDelegate.m"), + path.join(TestConfig.templatePath, "ios", TestConfig.TestAppName, "AppDelegate.mm"), appDelegatePath, true)) .then(TestUtil.replaceString.bind(undefined, appDelegatePath, TestUtil.CODE_PUSH_TEST_APP_NAME_PLACEHOLDER, TestConfig.TestAppName)); } @@ -307,7 +307,7 @@ class RNProjectManager extends ProjectManager { } mkdirp.sync(projectDirectory); - return TestUtil.getProcessOutput("npx react-native init " + appName + " --version 0.67.1", { cwd: projectDirectory, timeout: 30 * 60 * 1000 }) + return TestUtil.getProcessOutput("npx react-native init " + appName + " --version 0.71.3", { cwd: projectDirectory, timeout: 30 * 60 * 1000 }) .then((e) => { console.log(`"npx react-native init ${appName}" success. cwd=${projectDirectory}`); return e; }) .then(this.copyTemplate.bind(this, templatePath, projectDirectory)) .then(TestUtil.getProcessOutput.bind(undefined, TestConfig.thisPluginInstallString, { cwd: path.join(projectDirectory, TestConfig.TestAppName) })) @@ -377,7 +377,7 @@ class RNProjectManager extends ProjectManager { deferred.resolve(undefined); }); return deferred.promise - .then(TestUtil.getProcessOutput.bind(undefined, "npx react-native bundle --platform " + targetPlatform.getName() + " --entry-file index." + targetPlatform.getName() + ".js --bundle-output " + bundlePath + " --assets-dest " + bundleFolder + " --dev false", + .then(TestUtil.getProcessOutput.bind(undefined, "npx react-native bundle --entry-file index.js --platform " + targetPlatform.getName() + " --bundle-output " + bundlePath + " --assets-dest " + bundleFolder + " --dev false", { cwd: path.join(projectDirectory, TestConfig.TestAppName) })) .then(TestUtil.archiveFolder.bind(undefined, bundleFolder, "", path.join(projectDirectory, TestConfig.TestAppName, "update.zip"), isDiff)); } diff --git a/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj b/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj index 5c8b63d76..8408335e7 100644 --- a/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +++ b/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj @@ -71,9 +71,9 @@ MinimumRecommendedRules.ruleset - + False - ..\..\Examples\CodePushDemoApp\windows\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\Examples\CodePushDemoApp\windows\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll True diff --git a/windows-legacy/CodePush.Net46/CodePush.Net46.csproj b/windows-legacy/CodePush.Net46/CodePush.Net46.csproj index 9953b044d..30490852a 100644 --- a/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +++ b/windows-legacy/CodePush.Net46/CodePush.Net46.csproj @@ -50,8 +50,8 @@ MinimumRecommendedRules.ruleset - - $(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + $(SolutionDir)\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll True