Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Commit

Permalink
Made CLI build packaged apps. Fixes Bug#962879
Browse files Browse the repository at this point in the history
* Added support for raw packaged app directory
* Seperating apk-cli out into a new repo mozilla/apk-cli
  • Loading branch information
ozten committed Apr 25, 2014
1 parent 249a739 commit e8759f7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 157 deletions.
132 changes: 0 additions & 132 deletions bin/cli.js

This file was deleted.

1 change: 0 additions & 1 deletion config/cli.js

This file was deleted.

Empty file removed config/dev.js-dist
Empty file.
28 changes: 14 additions & 14 deletions lib/cli_dev_build.js
Expand Up @@ -37,17 +37,17 @@ module.exports = function(appData, config, cb) {
};
// TODO we need to control where apks are built on the filesystem
generator(config, manifestParams, appData.packageZip, loaderDirname, log,
function genCb(err, locationType, s3PublicUrlOrBlob) {
if (err) {
cb(err);
} else if (locationType === BLOB_TYPE) {
cb(null, s3PublicUrlOrBlob, true);
} else {
var s3key = androidifier.packageName(manifestUrl) + '.apk';
if(undefined === s3) {
s3 = require('./s3');
}
s3.getApk(s3key, cb);
}
});
};
function genCb(err, locationType, s3PublicUrlOrBlob) {
if (err) {
cb(err);
} else if (locationType === BLOB_TYPE) {
cb(null, s3PublicUrlOrBlob, true);
} else {
var s3key = androidifier.packageName(manifestUrl) + '.apk';
if (undefined === s3) {
s3 = require('./s3');
}
s3.getApk(s3key, cb);
}
});
};
9 changes: 4 additions & 5 deletions lib/owa_downloader.js
Expand Up @@ -17,23 +17,22 @@ withConfig(function(config) {
log = require('../lib/logging')(config);

module.exports = function(manifestUrl, manifestOverride, loader,
appBuildDir, cb) {
appBuildDir, cb) {
var manifestFilename;
if (/^\w+:\/\//.test(manifestUrl)) {
manifestFilename = '';
} else {
manifestFilename = path.basename(manifestUrl);
}

loader.load(manifestFilename, function(err, string) {
if (err) {
logError(log, "OWA Cannot load manifest: " + manifestFilename, err);
return cb(err);
}
try {
var manifest = JSON.parse(fileLoader.stripBom(string)),
appType,
zipFileLocation;
appType,
zipFileLocation;

if (false === owaValidator(manifest)) {
return cb(new Error('invalid manifest'));
Expand Down Expand Up @@ -72,4 +71,4 @@ withConfig(function(config) {
}
});
};
});
});
7 changes: 2 additions & 5 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "mozilla-apk-cli",
"name": "apk-factory-service",
"version": "0.0.1",
"description": "A Command Line Inteface for generating Android native apps from open webapps",
"description": "Web service which creates Android APK installers",
"developer": [
{
"name": "James Hugman",
Expand All @@ -12,9 +12,6 @@
"email": "shout@ozten.com"
}
],
"bin": {
"mozilla-apk-cli": "node bin/cli.js"
},
"scripts": {
"test": "tap test/*.js",
"start": "node scripts/development-server.js"
Expand Down

0 comments on commit e8759f7

Please sign in to comment.