Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions corimf-build-wp8.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ var WP8BuildSpecifics = function(DPO) {
//build mobilespec in visual studio
if (settings.MOBILESPEC)
{
//register www files
addWWWForMobileSpec(DPO.MOBILESPEC_DIR, DPO.PROJECT_NAME+'.csproj');

var majorBranchNum = Number(settings.BRANCH.substring(0,3));
if (majorBranchNum < 3.6) {
addWWWForMobileSpec(DPO.MOBILESPEC_DIR, DPO.PROJECT_NAME+'.csproj');
}
tests.reportStatus(shelljs.exec('msbuild' + ' ' + path.join(DPO.MOBILESPEC_DIR, DPO.PROJECT_NAME +'.sln') + ' ' +'/p:Configuration=Release', {silent:false}).code == 0);
}

Expand Down
62 changes: 60 additions & 2 deletions corimf-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ var RunPreliminaryTests = function(platformSpecificCode) {
repos = settings.PLUGINS.concat(settings.PLATFORM_REPO);
if (settings.PLUGMAN_REPO.length > 0)
repos = repos.concat(settings.PLUGMAN_REPO);
// We will also need these platform-independent repos
repos = repos.concat(['cordova-mobile-spec']);
if (Number(settings.BRANCH.substring(0,3)) >= 3.6)
repos = repos.concat(['cordova-plugin-test-framework']);

// If not building project only, git-archive the branch that is desired
if(!settings.PROJECT_ONLY) {
Expand Down Expand Up @@ -152,6 +156,7 @@ var RunPreliminaryTests = function(platformSpecificCode) {
}
}
// If not building project only, make sure that the branch matches the latest tag in Git
// If not building project only, make sure that the branch matches the latest tag in Git
else {
for (var i = 0; i < repos.length; i++) {
console.log(repos[i] + ': ');
Expand Down Expand Up @@ -207,6 +212,7 @@ var BuildProject = function(platformSpecificCode) {
var MOBILESPEC_DIR = 'mobilespec-' + platform + '-' + settings.NEW_TAG;
var PROJECT_NAME = platform === "wp8" ? 'WPCordovaClassLib' : 'example';
var pathProject = pathCorimf + path.sep + PROJECT_DIR;
var pathMobileSpec = pathCorimf + path.sep + MOBILESPEC_DIR;
var pathSnapshot = tmpDir + path.sep + SNAPSHOT_DIR;

console.log('Checking that project ' + PROJECT_DIR + ' does not exist yet...');
Expand All @@ -232,6 +238,8 @@ var BuildProject = function(platformSpecificCode) {

//build mobilespec
if(settings.MOBILESPEC) {
var majorBranchNum = Number(settings.BRANCH.substring(0,3));

var WWW_DIR;
if(platform == "android")
WWW_DIR = path.join('assets','www');
Expand All @@ -242,8 +250,58 @@ var BuildProject = function(platformSpecificCode) {
console.log('Checking that project ' + MOBILESPEC_DIR + ' does not exist yet...');
reportStatus(!shelljs.test('-d', MOBILESPEC_DIR));

shelljs.cp('-R', path.join(PROJECT_DIR,'*'), MOBILESPEC_DIR);
shelljs.cp('-Rf', path.join(process.cwd(),'cordova-mobile-spec','*'), path.join(MOBILESPEC_DIR, WWW_DIR));
console.log('Creating a new ' + platform.toUpperCase() + ' Project...');
cmd = execPath + ' ' + MOBILESPEC_DIR + ' ' + PROJECT_NAME + ' ' + PROJECT_NAME;
tests.reportStatus(shelljs.exec(cmd, {silent : false}).code == 0);

console.log('Copying mobile-spec resources into project www...');
var resourcesPath;
if (majorBranchNum >= 3.6) {
resourcesPath = path.join(tmpDir, 'cordova-mobile-spec', 'www', '*');
} else {
resourcesPath = path.join(tmpDir, 'cordova-mobile-spec', '*');
}
shelljs.cp("-rf", resourcesPath, path.join(MOBILESPEC_DIR, WWW_DIR));

// copy config.xml
shelljs.cp("-f", path.join(tmpDir, 'cordova-mobile-spec', "config.xml"), MOBILESPEC_DIR);

console.log('Installing plugins into project...');
var pathPlugman = path.join(pathCorimf, settings.PLUGMAN_REPO, 'main.js');
var baseCommand = 'node ' + pathPlugman + ' --debug install --platform ' + platform + ' --project ' + pathMobileSpec + ' --plugin ';

// console.log('Installing core plugins...');
for (var i = 0; i < settings.PLUGINS.length; i++) {
var execCommand = baseCommand + tmpDir + path.sep + settings.PLUGINS[i];
reportStatus((execOutput = shelljs.exec(execCommand, {silent:true})).code == 0, execOutput.output);
}

if (majorBranchNum >= 3.0) {
// Install echo and whitelist plugins
console.log('Installing echo and whitelist...');

var execCommand = baseCommand + path.join(tmpDir, 'cordova-mobile-spec', 'cordova-plugin-whitelist');
reportStatus((execOutput = shelljs.exec(execCommand, {silent:true})).code == 0, execOutput.output);

execCommand = baseCommand + path.join(tmpDir, 'cordova-mobile-spec', 'cordova-plugin-echo');
reportStatus((execOutput = shelljs.exec(execCommand, {silent:true})).code == 0, execOutput.output);
}

if (majorBranchNum >= 3.6) {
// Install plugin-test-framework and the test plugins
console.log('Installing new-style plugin tests...');

var execCommand = baseCommand + tmpDir + path.sep + 'cordova-plugin-test-framework';
shelljs.exec(execCommand, {silent:true});

for (var i = 0; i < settings.PLUGINS.length; i++) {
var potentialPlugin = path.join(settings.PLUGINS[i], 'tests');
if (fs.existsSync(potentialPlugin)) {
var testsCommand = baseCommand + tmpDir + path.sep + potentialPlugin;
reportStatus(shelljs.exec(testsCommand, {silent:true}).code == 0);
}
}
}
}

//Execute platform specific code to populate SNAPSHOT_DIR, moving needed files & directories into SNAPSHOT_DIR
Expand Down
4 changes: 2 additions & 2 deletions corimf-settings-js.sample
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ var PLATFORM_REPO = 'cordova-wp8',

PLUGIN_COUNT = 18,

PLUGINS = ['cordova-plugin-battery-status', 'cordova-plugin-camera', 'cordova-plugin-console', 'cordova-plugin-contacts', 'cordova-plugin-device', 'cordova-plugin-device-motion', 'cordova-plugin-device-orientation', 'cordova-plugin-dialogs', 'cordova-plugin-file', 'cordova-plugin-file-transfer', 'cordova-plugin-geolocation', 'cordova-plugin-globalization', 'cordova-plugin-inappbrowser', 'cordova-plugin-media', 'cordova-plugin-media-capture', 'cordova-plugin-network-information', 'cordova-plugin-splashscreen', 'cordova-plugin-vibration'],
PLUGINS = ['cordova-plugin-battery-status', 'cordova-plugin-camera', 'cordova-plugin-console', 'cordova-plugin-contacts', 'cordova-plugin-device', 'cordova-plugin-device-motion', 'cordova-plugin-device-orientation', 'cordova-plugin-dialogs', 'cordova-plugin-file', 'cordova-plugin-file-transfer', 'cordova-plugin-geolocation', 'cordova-plugin-globalization', 'cordova-plugin-inappbrowser', 'cordova-plugin-media', 'cordova-plugin-media-capture', 'cordova-plugin-network-information', 'cordova-plugin-statusbar', 'cordova-plugin-splashscreen', 'cordova-plugin-vibration'],
PLATFORM_REPOS = ['cordova-android', 'cordova-blackberry', 'cordova-ios', 'cordova-windows', 'cordova-wp8', 'cordova-js'],
OTHER_REPOS = ['cordova-blackberry-plugins', 'cordova-cli', 'cordova-plugman'];
OTHER_REPOS = ['cordova-blackberry-plugins', 'cordova-cli', 'cordova-plugman', 'cordova-mobile-spec', 'cordova-plugin-test-framework'];

exports.PLATFORM_REPO = PLATFORM_REPO;
exports.PROJECT_ONLY = PROJECT_ONLY;
Expand Down