Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CB-3015 Moving dependencies to .cordova folder to speed up create time
  • Loading branch information
jkeshavarzi authored and bryanhiggins committed Oct 21, 2013
1 parent f9327e0 commit 6095888ac718254c3d178c84afc28690d7cb9adf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 40 deletions.
@@ -34,6 +34,7 @@ var build,
app_id = process.argv[3],
TARGETS = ["device", "simulator"],
TEMPLATE_PROJECT_DIR = path.join(__dirname, "templates", "project"),
ROOT_PROJECT_DIR = path.join(__dirname, ".."),
MODULES_PROJECT_DIR = path.join(__dirname, "..", "node_modules"),
BOOTSTRAP_PROJECT_DIR = path.join(__dirname, "..", "framework", "bootstrap"),
FRAMEWORK_LIB_PROJECT_DIR = path.join(__dirname, "..", "framework", "lib"),
@@ -112,32 +113,6 @@ function copyFilesToProject() {
wrench.mkdirSyncRecursive(project_path, 0777);
wrench.copyDirSyncRecursive(TEMPLATE_PROJECT_DIR, project_path);

//copy dependencies folder if exists
if (fs.existsSync(path.join(BIN_DIR, "dependencies"))) {
//Copy node binaries
wrench.mkdirSyncRecursive(path.join(project_path, "cordova", "dependencies", "node"), 0755);
wrench.copyDirSyncRecursive(path.join(BIN_DIR, "dependencies", "node"), path.join(project_path, "cordova", "dependencies", "node"));

//Copy bb-tools bin files
wrench.mkdirSyncRecursive(bbtoolsBinDest, 0755);

if (utils.isWindows()) {
bbNativePackager += ".bat";
bbSigner += ".bat";
bbDeploy += ".bat";
bbDebugTokenRequest += ".bat";
}

utils.copyFile(path.join(BIN_DIR, "dependencies", "bb-tools", "bin", bbNativePackager), bbtoolsBinDest);
utils.copyFile(path.join(BIN_DIR, "dependencies", "bb-tools", "bin", bbSigner), bbtoolsBinDest);
utils.copyFile(path.join(BIN_DIR, "dependencies", "bb-tools", "bin", bbDeploy), bbtoolsBinDest);
utils.copyFile(path.join(BIN_DIR, "dependencies", "bb-tools", "bin", bbDebugTokenRequest), bbtoolsBinDest);

//copy bb-tools lib folder
wrench.mkdirSyncRecursive(bbtoolsLibDest, 0755);
wrench.copyDirSyncRecursive(path.join(BIN_DIR, "dependencies", "bb-tools", "lib"), bbtoolsLibDest);
}

// copy repo level target tool to project
utils.copyFile(path.join(BIN_DIR, "target"), path.join(project_path, "cordova"));
utils.copyFile(path.join(BIN_DIR, "target.bat"), path.join(project_path, "cordova"));
@@ -151,6 +126,9 @@ function copyFilesToProject() {
utils.copyFile(path.join(BIN_DIR, "init"), path.join(project_path, "cordova"));
}

//copy VERSION file [used to identify corresponding ~/.cordova/lib directory for dependencies]
utils.copyFile(path.join(ROOT_PROJECT_DIR, "VERSION"), path.join(project_path));

// change file permission for cordova scripts because ant copy doesn't preserve file permissions
wrench.chmodSyncRecursive(path.join(project_path,"cordova"), 0700);

@@ -18,8 +18,9 @@
#
#!/bin/sh
CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
LOCAL_NODE_BIN=$CURRENT_DIR/dependencies/node/bin
LOCAL_BBTOOLS=$CURRENT_DIR/dependencies/bb-tools/bin
CORDOVA_HOME_DIR=$HOME/.cordova/lib/blackberry10/cordova/$(cat "$CURRENT_DIR/../VERSION")
LOCAL_NODE_BIN=$CORDOVA_HOME_DIR/bin/dependencies/node/bin
LOCAL_BBTOOLS=$CORDOVA_HOME_DIR/bin/dependencies/bb-tools/bin

if [ -z "$CORDOVA_NODE" ]; then
if [ -x "$LOCAL_NODE_BIN" ]; then
@@ -18,27 +18,25 @@ goto comment
under the License.
:comment

set LOCAL_NODE_BINARY=%~dps0dependencies\node\bin
set LOCAL_BBTOOLS_BINARY=%~dps0dependencies\bb-tools\bin


set /P CORDOVA_VERSION=<%~dps0..\VERSION
set CORDOVA_HOME_DIR=%HOME%\.cordova\lib\blackberry10\cordova\%CORDOVA_VERSION%
set LOCAL_NODE_BINARY=%CORDOVA_HOME_DIR%\bin\dependencies\node\bin
set LOCAL_BBTOOLS_BINARY=%CORDOVA_HOME_DIR%\bin\dependencies\bb-tools\bin

if defined CORDOVA_NODE ( goto bbtools )

if exist "%LOCAL_NODE_BINARY%" (
set CORDOVA_NODE=%LOCAL_NODE_BINARY%
) else (
set FOUNDNODE=
for %%e in (%PATHEXT%) do (
for %%X in (node%%e) do (
if not defined FOUNDNODE (
set FOUNDNODE=%%~$PATH:X
for %%F in ("%%~$PATH:X") do set CORDOVA_NODE=%%~dpF
)
)
)

if defined FOUNDNODE (
for %%F in ("%FOUNDNODE%") do set CORDOVA_NODE=%%~dpF
)
)

:bbtools
@@ -48,15 +46,13 @@ if defined CORDOVA_BBTOOLS ( exit /B )
if exist "%LOCAL_BBTOOLS_BINARY%" (
set CORDOVA_BBTOOLS=%LOCAL_BBTOOLS_BINARY%
) else (
set FOUNDBBTOOLS=
for %%e in (%PATHEXT%) do (
for %%X in (blackberry-nativepackager%%e) do (
if not defined FOUNDBBTOOLS (
set FOUNDBBTOOLS=%%~$PATH:X
for %%F in ("%%~$PATH:X") do set CORDOVA_BBTOOLS=%%~dpF
)
)
)

if defined FOUNDBBTOOLS (
for %%F in ("%FOUNDBBTOOLS%") do set CORDOVA_BBTOOLS=%%~dpF
)
)

1 comment on commit 6095888

@Jordan2R
Copy link

@Jordan2R Jordan2R commented on 6095888 Nov 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! I'm new at GitHub, and I'm wondering...what those + in green lines and what those - in pink lines mean? Do they mean that we need to add the green code and remove the pink code from the file? Thanks!

Please sign in to comment.