| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0a5632c commit 9432ae0
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ before_install: | |||
| 14 | 14 | export CXX='g++-4.8'; | |
| 15 | 15 | fi | |
| 16 | 16 | - "export JOBS=4" | |
| 17 | - - npm install | ||
| 17 | + - BUILD_ONLY=true npm install | ||
| 18 | 18 | # This is a random private key used purely for testing. | |
| 19 | 19 | before_script: | |
| 20 | 20 | - echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,7 @@ install: | |||
| 27 | 27 | - cmd: SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH% | |
| 28 | 28 | - cmd: SET PATH=c:\python27;%PATH% | |
| 29 | 29 | - cmd: SET JOBS=4 | |
| 30 | + - cmd: SET BUILD_ONLY=true | ||
| 30 | 31 | - cmd: SET GIT_SSH=c:\projects\nodegit\vendor\plink.exe | |
| 31 | 32 | - ps: Start-Process c:\projects\nodegit\vendor\pageant.exe c:\projects\nodegit\vendor\private.ppk | |
| 32 | 33 | - cmd: npm install -g node-gyp | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -100,7 +100,9 @@ fse.remove(path.resolve(__dirname, "../src")).then(function() { | |||
| 100 | 100 | } | |
| 101 | 101 | } | |
| 102 | 102 | catch (e) { | |
| 103 | - console.log(e); | ||
| 103 | + if (process.env.BUILD_ONLY) { | ||
| 104 | + console.log(e); | ||
| 105 | + } | ||
| 104 | 106 | } | |
| 105 | 107 | }); | |
| 106 | 108 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,12 +58,16 @@ libgit2.types.forEach(function(current) { | |||
| 58 | 58 | var previous = ""; | |
| 59 | 59 | enums = _(enums).sortBy("name").reduce(function(enumMemo, enumerable) { | |
| 60 | 60 | if (previous == enumerable.typeName) { | |
| 61 | - console.log('WARNING: duplicate definition for enum ' + enumerable.typeName + | ||
| 62 | - ". skipped."); | ||
| 61 | + if (process.env.BUILD_ONLY) { | ||
| 62 | + console.warn('Duplicate definition for enum ' + enumerable.typeName + | ||
| 63 | + ". skipped."); | ||
| 64 | + } | ||
| 63 | 65 | } | |
| 64 | 66 | else if (!enumerable.fields) { | |
| 65 | - console.log('WARNING: incomplete definition for enum ' + enumerable.typeName + | ||
| 66 | - ". skipped."); | ||
| 67 | + if (process.env.BUILD_ONLY) { | ||
| 68 | + console.warn('Incomplete definition for enum ' + enumerable.typeName + | ||
| 69 | + ". skipped."); | ||
| 70 | + } | ||
| 67 | 71 | } | |
| 68 | 72 | else { | |
| 69 | 73 | enumMemo[enumerable.typeName] = { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -136,7 +136,9 @@ var Utils = { | |||
| 136 | 136 | _.merge(field, callbackDefs[field.type]); | |
| 137 | 137 | } | |
| 138 | 138 | else { | |
| 139 | - console.log("WARNING: Couldn't find callback definition for " + field.type); | ||
| 139 | + if (process.env.BUILD_ONLY) { | ||
| 140 | + console.warn("Couldn't find callback definition for " + field.type); | ||
| 141 | + } | ||
| 140 | 142 | } | |
| 141 | 143 | }, | |
| 142 | 144 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,13 +10,8 @@ var which = require("which"); | |||
| 10 | 10 | var rimraf = require("rimraf"); | |
| 11 | 11 | var NODE_VERSION = Number(process.version.match(/^v(\d+\.\d+)/)[1]); | |
| 12 | 12 | ||
| 13 | - // If the build only flag is set | ||
| 14 | - var buildOnly = process.argv.indexOf("--build-only") > -1; | ||
| 15 | - | ||
| 16 | - if (buildOnly) { | ||
| 17 | - console.log("buildOnly"); | ||
| 18 | - return; | ||
| 19 | - } | ||
| 13 | + // If the build only flag is set. | ||
| 14 | + var buildOnly = process.env.BUILD_ONLY; | ||
| 20 | 15 | ||
| 21 | 16 | // This will take in an object and find any matching keys in the environment | |
| 22 | 17 | // to use as overrides. | |
@@ -71,13 +66,34 @@ if (NODE_VERSION === 0.1) { | |||
| 71 | 66 | pkg.http_parser = pkg.http_parser["0.10"]; | |
| 72 | 67 | } | |
| 73 | 68 | ||
| 74 | - // Ensure all dependencies are available. | ||
| 75 | - var dependencies = Q.allSettled([ | ||
| 76 | - // This will prioritize `python2` over `python`, because we always want to | ||
| 77 | - // work with Python 2.* if it"s available. | ||
| 78 | - Q.nfcall(which, "python2"), | ||
| 79 | - Q.nfcall(which, "python") | ||
| 80 | - ]) | ||
| 69 | + // Attempt to fallback on a prebuilt binary. | ||
| 70 | + function fetchPrebuilt() { | ||
| 71 | + if (!buildOnly) { | ||
| 72 | + console.info("[nodegit] Fetching binary from S3."); | ||
| 73 | + | ||
| 74 | + // Using the node-pre-gyp module, attempt to fetch a compatible build. | ||
| 75 | + return Q.nfcall(exec, "node-pre-gyp install"); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + throw new Error("Build only"); | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + // Attempt to fetch prebuilt binary. | ||
| 82 | + Q.ninvoke(fs, "mkdir", paths.release).then(fetchPrebuilt, fetchPrebuilt) | ||
| 83 | + | ||
| 84 | + .fail(function() { | ||
| 85 | + if (!buildOnly) { | ||
| 86 | + console.info("[nodegit] Failed to install prebuilt, attempting compile."); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + // Ensure all dependencies are available. | ||
| 90 | + return Q.allSettled([ | ||
| 91 | + // This will prioritize `python2` over `python`, because we always want to | ||
| 92 | + // work with Python 2.* if it"s available. | ||
| 93 | + Q.nfcall(which, "python2"), | ||
| 94 | + Q.nfcall(which, "python") | ||
| 95 | + ]) | ||
| 96 | + }) | ||
| 81 | 97 | ||
| 82 | 98 | // Determine if all the dependency requirements are met. | |
| 83 | 99 | .then(function(results) { | |
@@ -226,25 +242,6 @@ var dependencies = Q.allSettled([ | |||
| 226 | 242 | }); | |
| 227 | 243 | }) | |
| 228 | 244 | ||
| 229 | - // Attempt to fallback on a prebuilt binary. | ||
| 230 | - .fail(function(message) { | ||
| 231 | - console.info("[nodegit] Failed to build nodegit."); | ||
| 232 | - console.info("[nodegit] Attempting to fallback on a prebuilt binary."); | ||
| 233 | - | ||
| 234 | - console.log(message.stack); | ||
| 235 | - | ||
| 236 | - function fetchPrebuilt() { | ||
| 237 | - console.info("[nodegit] Fetching binary from S3."); | ||
| 238 | - | ||
| 239 | - // Using the node-pre-gyp module, attempt to fetch a compatible build. | ||
| 240 | - return Q.nfcall(exec, "node-pre-gyp install"); | ||
| 241 | - } | ||
| 242 | - | ||
| 243 | - // Attempt to fetch prebuilt binary. | ||
| 244 | - return Q.ninvoke(fs, "mkdir", paths.release) | ||
| 245 | - .then(fetchPrebuilt, fetchPrebuilt); | ||
| 246 | - }) | ||
| 247 | - | ||
| 248 | 245 | // Display a warning message about failing to build native node module. | |
| 249 | 246 | .fail(function(message) { | |
| 250 | 247 | console.info("[nodegit] Failed to build and install nodegit."); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,6 +96,6 @@ | |||
| 96 | 96 | "publish": "node-pre-gyp package && node-pre-gyp publish", | |
| 97 | 97 | "generate": "node generate/setup && node generate", | |
| 98 | 98 | "install": "npm run generate && node install", | |
| 99 | - "rebuild": "npm run generate && node-gyp configure build" | ||
| 99 | + "rebuild": "BUILD_ONLY=true npm run generate && node-gyp configure build" | ||
| 100 | 100 | } | |
| 101 | 101 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments