Skip to content

Commit

Permalink
Add build target for bar depdendencies
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlee committed Apr 13, 2012
1 parent 6eaf7eb commit 09d6703
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Framework
Submodule Framework updated 75 files
+3 −0 .gitmodules
+1 −1 .jshintrc
+16 −0 bin/bbx-framework
+1 −1 configure
+1 −1 configure.bat
+6 −0 dependencies/test-server/.gitignore
+37 −0 dependencies/test-server/README.md
+72 −0 dependencies/test-server/app.js
+1 −0 dependencies/test-server/configure
+1 −0 dependencies/test-server/configure.bat
+261 −0 dependencies/test-server/job.js
+13 −0 dependencies/test-server/package.json
+73 −0 dependencies/test-server/public/index.html
+1 −0 dependencies/test-server/public/lib/jasmine
+35 −0 dependencies/test-server/widget/config.xml
+17 −8 ext/blackberry.app.event/client.js
+17 −1 ext/blackberry.app.event/index.js
+37 −15 ext/blackberry.app/client.js
+51 −4 ext/blackberry.app/index.js
+29 −0 ext/blackberry.event/client.js
+68 −0 ext/blackberry.event/index.js
+16 −0 ext/blackberry.example.test/client.js
+16 −0 ext/blackberry.example.test/index.js
+39 −0 ext/blackberry.identity/client.js
+41 −0 ext/blackberry.identity/index.js
+17 −1 ext/blackberry.invoke/client.js
+16 −0 ext/blackberry.invoke/index.js
+16 −0 ext/blackberry.system.event/client.js
+16 −0 ext/blackberry.system.event/device.js
+16 −0 ext/blackberry.system.event/foo.js
+16 −0 ext/blackberry.system.event/index.js
+33 −6 ext/blackberry.system/client.js
+50 −0 ext/blackberry.system/index.js
+1 −0 lib/config.js
+1 −0 lib/config/user.js
+1 −0 lib/event.js
+1 −0 lib/exception.js
+16 −0 lib/framework.js
+18 −2 lib/plugins/bridge.js
+18 −2 lib/plugins/extensions.js
+1 −0 lib/policy/whitelist.js
+27 −3 lib/pps/ppsEvents.js
+16 −0 lib/pps/ppsUtils.js
+16 −0 lib/public/builder.js
+11 −19 lib/public/event.js
+17 −1 lib/public/window-webworks.js
+17 −1 lib/public/window.js
+21 −1 lib/server.js
+4 −3 lib/utils.js
+8 −0 pom.xml
+113 −0 test/functional/blackberry.app.js
+167 −0 test/functional/blackberry.event.js
+36 −0 test/functional/blackberry.identity.js
+16 −0 test/functional/blackberry.invoke.js
+27 −0 test/functional/blackberry.js
+53 −0 test/functional/blackberry.system.js
+117 −0 test/unit/ext/blackberry.app/client.js
+112 −0 test/unit/ext/blackberry.app/index.js
+54 −0 test/unit/ext/blackberry.event/client.js
+52 −0 test/unit/ext/blackberry.event/index.js
+81 −0 test/unit/ext/blackberry.identity/client.js
+74 −0 test/unit/ext/blackberry.identity/index.js
+16 −0 test/unit/ext/blackberry.invoke/client.js
+16 −0 test/unit/ext/blackberry.invoke/index.js
+62 −0 test/unit/ext/blackberry.system/client.js
+47 −0 test/unit/ext/blackberry.system/index.js
+16 −0 test/unit/lib/config.js
+16 −0 test/unit/lib/framework.js
+27 −9 test/unit/lib/plugins/bridge.js
+16 −0 test/unit/lib/plugins/extensions.js
+1 −0 test/unit/lib/policy/whitelist.js
+162 −0 test/unit/lib/pps/ppsEvents.js
+34 −11 test/unit/lib/public/builder.js
+41 −8 test/unit/lib/public/event.js
+16 −0 test/unit/lib/server.js
1 change: 1 addition & 0 deletions lib/bar-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function buildTarget(previous, baton) {
var target = this.session.targets[targetIdx++];
wrench.mkdirSyncRecursive(this.session.outputDir + "/" + target);
fileManager.copyWWE(this.session, target);
fileManager.copyBarDependencies(this.session, target);
nativePkgr.exec(this.session, target, this.config, function (code) {
if (code !== 0) {
logger.error(localize.translate("EXCEPTION_NATIVEPACKAGER"));
Expand Down
2 changes: 1 addition & 1 deletion lib/bar-conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ self.ROOT = "";
self.CHROME = self.ROOT + "/chrome";
self.LIB = self.CHROME + "/lib";
self.EXT = self.CHROME + "/ext";
self.PLUGINS = self.CHROME + "/plugins";
self.PLUGINS = self.ROOT + "/plugins";

module.exports = self;
2 changes: 1 addition & 1 deletion lib/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ module.exports = {
DEPENDENCIES_TOOLS: path.normalize(__dirname + "/../dependencies/tools"),
DEPENDENCIES_EMU: path.normalize(__dirname + "/../Framework/dependencies/BBX-Emulator"),
DEPENDENCIES_WWE: path.normalize(__dirname + "/../dependencies/%s-wwe"),
DEPENDENCIES_BAR: path.normalize(__dirname + "/../dependencies/bar-dependencies"),
DEPENDENCIES_BAR: path.normalize(__dirname + "/../dependencies/bar-dependencies/%s"),
DEBUG_TOKEN: path.normalize(__dirname + "/../debugtoken.bar")
};
28 changes: 14 additions & 14 deletions lib/file-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ function prepare(session) {
// copy bootstrap
wrench.copyDirSyncRecursive(conf.DEPENDENCIES_BOOTSTRAP, dest.CHROME);

if (!path.existsSync(dest.PLUGINS)) {
wrench.mkdirSyncRecursive(dest.PLUGINS, "0755");
}

// copy bar dependencies
this.copyBarDependencies(session);

if (!path.existsSync(dest.LIB)) {
wrench.mkdirSyncRecursive(dest.LIB, "0755");
}
Expand All @@ -84,11 +77,6 @@ function prepare(session) {
unzip(session.archivePath, session.sourceDir);
}

function copyBarDependencies(session) {
var conf = session.conf;

wrench.copyDirSyncRecursive(conf.DEPENDENCIES_BAR, session.sourceDir);
}

function getModulesArray(dest, files, baseDir) {
var modulesList = [];
Expand Down Expand Up @@ -132,6 +120,18 @@ function copyWWE(session, target) {
fs.copySync(src, dest);
}

function copyBarDependencies(session, target) {
var conf = session.conf,
src = path.normalize(util.format(conf.DEPENDENCIES_BAR, target)),
dest = path.normalize(session.sourcePaths.PLUGINS);

if (!path.existsSync(dest.PLUGINS)) {
wrench.mkdirSyncRecursive(dest.PLUGINS, "0755");
}

wrench.copyDirSyncRecursive(src, session.sourcePaths.PLUGINS);
}

function checkMissingFileInAPIFolder(apiDir, fileToCheck) {
if (!path.existsSync(apiDir + "/" + fileToCheck)) {
throw localize.translate("EXCEPTION_MISSING_FILE_IN_API_DIR", fileToCheck, apiDir);
Expand Down Expand Up @@ -190,10 +190,10 @@ module.exports = {

copyWWE: copyWWE,

prepareOutputFiles: prepare,

copyBarDependencies: copyBarDependencies,

prepareOutputFiles: prepare,

copyExtensions: copyExtensions,

generateFrameworkModulesJS: generateFrameworkModulesJS,
Expand Down
2 changes: 2 additions & 0 deletions test/unit/lib/bar-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe("BAR builder", function () {

spyOn(wrench, "mkdirSyncRecursive");
spyOn(fileMgr, "copyWWE");
spyOn(fileMgr, "copyBarDependencies");
spyOn(nativePkgr, "exec").andCallFake(function (session, target, config, callback) {
callback(0);
});
Expand All @@ -24,6 +25,7 @@ describe("BAR builder", function () {

expect(wrench.mkdirSyncRecursive).toHaveBeenCalledWith(session.outputDir + "/" + target);
expect(fileMgr.copyWWE).toHaveBeenCalledWith(session, target);
expect(fileMgr.copyBarDependencies).toHaveBeenCalledWith(session, target);
expect(nativePkgr.exec).toHaveBeenCalledWith(session, target, config, jasmine.any(Function));
expect(callback).toHaveBeenCalledWith(0);
});
Expand Down
2 changes: 0 additions & 2 deletions test/unit/lib/file-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ var srcPath = __dirname + "/../../../lib/",

describe("File manager", function () {
it("prepareOutputFiles() should copy files and unzip archive", function () {
spyOn(fileMgr, "copyBarDependencies");

fileMgr.prepareOutputFiles(session);

expect(path.existsSync(session.sourcePaths.CHROME)).toBeTruthy();
Expand Down

0 comments on commit 09d6703

Please sign in to comment.