Skip to content

Commit

Permalink
Fixed bug in Windows android build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nat Weiss committed Jan 27, 2016
1 parent fc0fe1b commit e4829e0
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions rapidgame.js
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ var prebuildAndroid = function(platform, config, arch, callback) {
archs = (cmd.minimal ? ["armeabi"] : ["armeabi", "armeabi-v7a", "x86"]);

// Windows requires TERM environment variable (means running from cygwin)
if (process.platform === "win32" || !("TERM" in process.env)) {
if (process.platform === "win32" && !("TERM" in process.env)) {
logBuild("Can only build Android on Windows using a cygwin terminal", true);
callback();
return;
Expand Down Expand Up @@ -1131,19 +1131,19 @@ var prebuildAndroid = function(platform, config, arch, callback) {
}
builds.push([configs[i], command, dest, args, func, funcArg]);

/*if (cmd.minimal) {
if (cmd.nostrip) {
builds.push([command, "non-stripped minimal (Debug armeabi)"]);
} else {
builds.push(["minimal (Debug armeabi)"]);
}
} else {
if (cmd.nostrip) {
builds.push(["non-stripped libraries for all platforms"]);
} else {
builds.push(["libraries for all platforms"]);
}
}*/
//if (cmd.minimal) {
// if (cmd.nostrip) {
// builds.push([command, "non-stripped minimal (Debug armeabi)"]);
// } else {
// builds.push(["minimal (Debug armeabi)"]);
// }
//} else {
// if (cmd.nostrip) {
// builds.push(["non-stripped libraries for all platforms"]);
// } else {
// builds.push(["libraries for all platforms"]);
// }
//}
} else {
for (j = 0; j < archs.length; j += 1) {
// Mac and Linux use build.sh
Expand Down Expand Up @@ -1745,6 +1745,22 @@ var isWriteableDir = function(dir) {
return false;
};

//
// a function to make paths cygwin-friendly
//
var cygwinDir = function(str) {
// cygwin needs c:\something => /cygdrive/c/something
if (process.platform === "win32" && ("TERM" in process.env)) {
str = str.replace(/\\/g, "/");
str = str.replace(/c:/i, "/cygdrive/c");
str = str.replace(/d:/i, "/cygdrive/d");
str = str.replace(/e:/i, "/cygdrive/e");
str = str.replace(/f:/i, "/cygdrive/f");
str = str.replace(/g:/i, "/cygdrive/g");
}
return str;
};

//
// reporting feature no longer used
//
Expand Down

0 comments on commit e4829e0

Please sign in to comment.