Bug 976773 - Fix simulator path on Windows and fix the simulator addon versioning. r=jryans, a=bajaj
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 04 Apr 2014 08:19:09 -0400
changeset 192985 d2ff4210037b9eecaf988b439aa9a9deba66ed7f
parent 192984 000d5762273c47d7039cb0886dbe2186205185a7
child 192986 22f43bc9498047eed3aaa7b62cb4f9e39b563848
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans, bajaj
bugs976773
milestone30.0a2
Bug 976773 - Fix simulator path on Windows and fix the simulator addon versioning. r=jryans, a=bajaj
b2g/simulator/build_xpi.py
b2g/simulator/lib/simulator-process.js
--- a/b2g/simulator/build_xpi.py
+++ b/b2g/simulator/build_xpi.py
@@ -43,20 +43,22 @@ class GaiaBuilder(object):
         with open(os.path.join(self.gaia_path, "profile", "user.js"), "a") as userJs:
             userJs.write(open(srcfile).read())
 
 def process_package_overload(src, dst, version, app_buildid):
     ensureParentDir(dst)
     # First replace numeric version like '1.3'
     # Then replace with 'slashed' version like '1_4'
     # Finally set the full length addon version like 1.3.20131230
+    # (reduce the app build id to only the build date
+    # as addon manager doesn't handle big ints in addon versions)
     defines = {
         "NUM_VERSION": version,
         "SLASH_VERSION": version.replace(".", "_"),
-        "FULL_VERSION": ("%s.%s" % (version, app_buildid))
+        "FULL_VERSION": ("%s.%s" % (version, app_buildid[:8]))
     }
     pp = Preprocessor(defines=defines)
     pp.do_filter("substitution")
     with open(dst, "w") as output:
         with open(src, "r") as input:
             pp.processFile(input=input, output=output)
 
 def add_dir_to_zip(zip, top, pathInZip, blacklist=()):
--- a/b2g/simulator/lib/simulator-process.js
+++ b/b2g/simulator/lib/simulator-process.js
@@ -140,18 +140,20 @@ exports.SimulatorProcess = Class({
 
     let bin = URL.toFilename(BIN_URL);
     let executables = {
       WINNT: "b2g-bin.exe",
       Darwin: "B2G.app/Contents/MacOS/b2g-bin",
       Linux: "b2g-bin",
     };
 
-    console.log("bin url: "+bin+"/"+executables[Runtime.OS]);
-    let path = bin + "/" + executables[Runtime.OS];
+    let path = bin;
+    path += Runtime.OS == "WINNT" ? "\\" : "/";
+    path += executables[Runtime.OS];
+    console.log("simulator path: " + path);
 
     let executable = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
     executable.initWithPath(path);
 
     if (!executable.exists()) {
       // B2G binaries not found
       throw Error("b2g-desktop Executable not found.");
     }