Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CB-4653 Remove project.json
  • Loading branch information
jsoref committed Jan 13, 2014
1 parent 42e83f6 commit ead6edd7b19810bb91182ee0e22c3c96c54c8151
Showing 7 changed files with 4 additions and 32 deletions.
@@ -88,7 +88,7 @@ task('hint', ['complainwhitespace'], function () {
return wut;
};

childProcess.exec("jshint framework/lib bin/lib bin/test bin/templates/project/cordova bin/templates/project/project.json --config .jshintrc --extra-ext .json",function(err,stdout,stderr) {
childProcess.exec("jshint framework/lib bin/lib bin/test bin/templates/project/cordova --config .jshintrc --extra-ext .json",function(err,stdout,stderr) {
var exs = stdout.split('\n');
console.log(exs.filter(filterKnownWarnings).join('\n'));
if (err) {
@@ -166,18 +166,13 @@ function copyFilesToProject() {
}

function updateProject() {
var projectJson = require(path.resolve(path.join(project_path, "project.json"))),
configXMLPath = path.resolve(path.join(project_path, "www", "config.xml")),
var configXMLPath = path.resolve(path.join(project_path, "www", "config.xml")),
xmlString;

if (typeof app_id !== "undefined") {
xmlString = fs.readFileSync(configXMLPath, "utf-8");
fs.writeFileSync(configXMLPath, xmlString.replace("default.app.id", app_id).replace("default.app.name", app_name), "utf-8");
}

projectJson.globalFetchDir = path.join(__dirname, "..", "plugins");

fs.writeFileSync(path.join(project_path, "project.json"), JSON.stringify(projectJson, null, 4) + "\n", "utf-8");
}

function help() {
@@ -37,12 +37,6 @@ function updateNativeDir(projectpath) {
shell.cp('-rf', path.join(ROOT, 'bin', 'templates', 'project', 'native'), path.join(projectpath, 'native'));
}

function updateProjectJson(projectpath) {
var projectJson = require(path.resolve(path.join(projectpath, "project.json")));
projectJson.globalFetchDir = path.join(ROOT, 'plugins');
fs.writeFileSync(path.join(projectpath, "project.json"), JSON.stringify(projectJson, null, 4) + "\n", "utf-8");
}

function updateCordovaJS(projectpath, version) {
var jspath = path.join(projectpath, 'lib', 'cordova' + version, 'javascript');
shell.rm('-rf', path.join(projectpath, 'lib')); //remove old lib tree
@@ -77,7 +71,6 @@ exports.updateProject = function (projectpath) {
updateCordovaJS(projectpath, version);
updateCordovaTools(projectpath);
updateNativeDir(projectpath);
updateProjectJson(projectpath);
//console.log('BlackBerry10 project is now at version ' + version);
});
};
@@ -83,7 +83,6 @@ module.exports = {
var sourceDir,
signingPassword = module.exports.getKeyStorePass(cmdline),
outputDir = cmdline.output,
properties = require("../../project.json"),
archivePath = path.resolve(cmdline.args[0] ? cmdline.args[0] : "../../www"),
archiveName = utils.genBarName(),
appdesc,

This file was deleted.

@@ -20,7 +20,6 @@
var childProcess = require('child_process'),
tempFolder = '.tmp/',
appFolder = tempFolder + 'tempCordovaApp/',
projectFile = 'project.json',
wrench = require('wrench'),
utils = require('../../../lib/utils'),
path = require('path'),
@@ -42,20 +41,15 @@ function executeScript(shellCommand, args, shouldError) {

describe("create tests", function () {
it("creates project", function () {
var project,
appIdRegExp = /id="default\.app\.id"/g;
var appIdRegExp = /id="default\.app\.id"/g;
executeScript(CREATE_COMMAND, [appFolder]);
project = JSON.parse(fs.readFileSync(appFolder + projectFile, "utf-8"));
expect(appIdRegExp.test(fs.readFileSync(appFolder + "www/config.xml", "utf-8"))).toEqual(true);
expect(fs.existsSync(appFolder)).toEqual(true);
expect(fs.existsSync(appFolder + "/cordova")).toEqual(true);
expect(fs.existsSync(appFolder + "/cordova/node_modules")).toEqual(true);
expect(fs.existsSync(appFolder + "/cordova/lib")).toEqual(true);
expect(fs.existsSync(appFolder + "/cordova/third_party")).toEqual(true);
expect(fs.existsSync(appFolder + "/www")).toEqual(true);
expect(project.barName).toEqual("cordova-BB10-app");
expect(project.defaultTarget).toEqual("");
expect(project.targets).toEqual({});
expect(fs.existsSync("./build")).toEqual(false);
this.after(function () {
wrench.rmdirSyncRecursive(tempFolder);
@@ -74,12 +68,9 @@ describe("create tests", function () {
});

it("sets appId and barName", function () {
var project,
appIdRegExp = /id="com\.example\.bb10app"/g;
var appIdRegExp = /id="com\.example\.bb10app"/g;
executeScript(CREATE_COMMAND, [appFolder, "com.example.bb10app", "bb10appV1"]);
project = JSON.parse(fs.readFileSync(appFolder + projectFile, "utf-8"));
expect(appIdRegExp.test(fs.readFileSync(appFolder + "www/config.xml", "utf-8"))).toEqual(true);
expect(project.barName).toEqual("cordova-BB10-app");
this.after(function () {
wrench.rmdirSyncRecursive(tempFolder);
});
@@ -20,7 +20,6 @@
var childProcess = require('child_process'),
tempFolder = '.tmp/',
appFolder = tempFolder + 'tempCordovaApp/',
projectFile = 'project.json',
wrench = require('wrench'),
utils = require('../../../lib/utils'),
fs = require('fs'),

0 comments on commit ead6edd

Please sign in to comment.