From 08708131ccf3a11763fd1234159f2afb909eb47b Mon Sep 17 00:00:00 2001 From: scottbommarito Date: Fri, 3 Jun 2016 10:49:06 -0700 Subject: [PATCH 1/3] stop the packager from running --- gulpfile.js | 4 ++-- test/template/ios/launchPackager.command | 4 ++++ test/test.ts | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 test/template/ios/launchPackager.command diff --git a/gulpfile.js b/gulpfile.js index 098a61e..c8c991b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -34,7 +34,7 @@ var tsCompileOptions = { }; function spawnCommand(command, args, callback, silent, detached) { - var options = {}; + var options = { maxBuffer: 1024 * 1024 }; if (detached) { options.detached = true; options.stdio = ["ignore"]; @@ -55,7 +55,7 @@ function spawnCommand(command, args, callback, silent, detached) { }; function execCommand(command, args, callback, silent) { - var execProcess = child_process.exec(command + " " + args.join(" ")); + var execProcess = child_process.exec(command + " " + args.join(" "), { maxBuffer: 1024 * 1024 }); if (!silent) execProcess.stdout.pipe(process.stdout); if (!silent) execProcess.stderr.pipe(process.stderr); diff --git a/test/template/ios/launchPackager.command b/test/template/ios/launchPackager.command new file mode 100755 index 0000000..da4ca62 --- /dev/null +++ b/test/template/ios/launchPackager.command @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# This file replaces the file that starts the packager during iOS builds and prevents it from starting. +# It belongs in node_modules/react-native/packager \ No newline at end of file diff --git a/test/test.ts b/test/test.ts index c230338..470ab69 100644 --- a/test/test.ts +++ b/test/test.ts @@ -193,6 +193,10 @@ class RNIOS extends Platform.IOS implements RNPlatform { // 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);")) + // Prevent the packager from starting during builds by replacing the script that starts it with a file that does nothing. + .then(TestUtil.copyFile.bind(undefined, + path.join(TestConfig.templatePath, "ios", "launchPackager.command"), + path.join(projectDirectory, TestConfig.TestAppName, "node_modules", "react-native", "packager", "launchPackager.command"), true)) // Copy the AppDelegate.m to the project .then(TestUtil.copyFile.bind(undefined, path.join(TestConfig.templatePath, "ios", TestConfig.TestAppName, "AppDelegate.m"), From eecff7c7f10056b62bf77f8c39095ded9beb3184 Mon Sep 17 00:00:00 2001 From: scottbommarito Date: Fri, 3 Jun 2016 13:35:51 -0700 Subject: [PATCH 2/3] disable packager script --- test/template/ios/launchPackager.command | 4 ---- test/test.ts | 9 +++++---- 2 files changed, 5 insertions(+), 8 deletions(-) delete mode 100755 test/template/ios/launchPackager.command diff --git a/test/template/ios/launchPackager.command b/test/template/ios/launchPackager.command deleted file mode 100755 index da4ca62..0000000 --- a/test/template/ios/launchPackager.command +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# This file replaces the file that starts the packager during iOS builds and prevents it from starting. -# It belongs in node_modules/react-native/packager \ No newline at end of file diff --git a/test/test.ts b/test/test.ts index 470ab69..a963739 100644 --- a/test/test.ts +++ b/test/test.ts @@ -193,10 +193,11 @@ class RNIOS extends Platform.IOS implements RNPlatform { // 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);")) - // Prevent the packager from starting during builds by replacing the script that starts it with a file that does nothing. - .then(TestUtil.copyFile.bind(undefined, - path.join(TestConfig.templatePath, "ios", "launchPackager.command"), - path.join(projectDirectory, TestConfig.TestAppName, "node_modules", "react-native", "packager", "launchPackager.command"), true)) + // Prevent the packager from starting during builds by replacing the script that starts it with nothing. + .then(TestUtil.replaceString.bind(undefined, + path.join(projectDirectory, TestConfig.TestAppName, "node_modules", "react-native", "React", "React.xcodeproj", "project.pbxproj"), + "shellScript = \".*\";", + "shellScript = \"\";")) // Copy the AppDelegate.m to the project .then(TestUtil.copyFile.bind(undefined, path.join(TestConfig.templatePath, "ios", TestConfig.TestAppName, "AppDelegate.m"), From 063a03cae41899838edbaed522bf47e4e3188c3f Mon Sep 17 00:00:00 2001 From: scottbommarito Date: Mon, 6 Jun 2016 10:58:25 -0700 Subject: [PATCH 3/3] whitespace fix --- test/test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test.ts b/test/test.ts index a963739..0e7acb3 100644 --- a/test/test.ts +++ b/test/test.ts @@ -302,10 +302,10 @@ class RNProjectManager extends ProjectManager { return copyDirectoryRecursively(templatePath, path.join(projectDirectory, TestConfig.TestAppName)); } - /** - * Creates a new test application at the specified path, and configures it - * with the given server URL, android and ios deployment keys. - */ + /** + * Creates a new test application at the specified path, and configures it + * with the given server URL, android and ios deployment keys. + */ public setupProject(projectDirectory: string, templatePath: string, appName: string, appNamespace: string, version?: string): Q.Promise { if (fs.existsSync(projectDirectory)) { del.sync([projectDirectory], { force: true });