Skip to content

Commit

Permalink
Use app/package.json for grunt tasks. Add extras attribute to apio co…
Browse files Browse the repository at this point in the history
…nfiguration
  • Loading branch information
Jesus89 committed Jan 11, 2018
1 parent 4f138af commit 15e66e2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
6 changes: 5 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
"height": 620,
"min_width": 800,
"min_height": 200,
"toolbar": true,
"toolbar": false,
"resizable": true,
"position": "center",
"icon": "resources/images/icestudio-logo.png"
},
"apio": {
"min": "0.3.0b4",
"max": "0.4.0",
"extras": [
"tinyfpgab"
],
"external": ""
},
"collection": "0.3.0",
"engines": {
"node": ">= 0.10.0"
},
Expand Down
3 changes: 2 additions & 1 deletion app/scripts/services/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,8 @@ angular.module('icestudio')
// Remote installation

function installOnlineApio(callback) {
updateProgress('pip install -U apio[tinyfpgab]', 30);
var extraPackages = _package.apio.extras || [];
updateProgress('pip install -U apio[' + extraPackages.toString() + ']', 30);
utils.installOnlineApio(callback);
}

Expand Down
4 changes: 1 addition & 3 deletions app/scripts/services/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,8 @@ angular.module('icestudio')
};

this.installOnlineApio = function(callback) {
var extraPackages = [
'tinyfpgab', // Used for the TinyFPGA B2 board
];
var versionRange = '">=' + _package.apio.min + ',<' + _package.apio.max + '"';
var extraPackages = _package.apio.extras || [];
this.executeCommand([coverPath(common.ENV_PIP), 'install', '-U', 'apio[' + extraPackages.toString() + ']' + versionRange], callback);
};

Expand Down
3 changes: 2 additions & 1 deletion gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = function(grunt) {
// Project configuration
grunt.initConfig({

pkg: grunt.file.readJSON('package.json'),
pkg: grunt.file.readJSON('app/package.json'),

// Automatically inject Bower components into the app
wiredep: {
Expand Down Expand Up @@ -139,6 +139,7 @@ module.exports = function(grunt) {
apioMin: '<%=pkg.apio.min%>',
apioMax: '<%=pkg.apio.max%>',
buildDir: 'dist/',
extraPackages: '<%=pkg.apio.extras%>',
platforms: platforms
}
},
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
"gettext": "grunt gettext",
"postinstall": "npmpd && cd app && npm install && bower install && cd ../tasks && npm install && cd .. && grunt getcollection"
},
"apio": {
"min": "0.3.0b4",
"max": "0.4.0"
},
"collection": "0.3.0",
"devDependencies": {
"bower": "^1.8.0",
"grunt": "^1.0.1",
Expand Down
6 changes: 2 additions & 4 deletions tasks/toolchain_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function ToolchainBuilder(options) {
apioMax: '',
buildDir: './build',
cacheDir: './cache',
extraPackages: [],
platforms: ['linux32', 'linux64', 'win32', 'win64', 'osx32', 'osx64'],
};

Expand Down Expand Up @@ -132,13 +133,10 @@ ToolchainBuilder.prototype.downloadApio = function () {
var self = this;
self.emit('log', '> Download apio');
return new Promise(function(resolve, reject) {
var extraPackages = [
'tinyfpgab', // Used for the TinyFPGA B2 board
];
var versionRange = '">=' + self.options.apioMin + ',<' + self.options.apioMax + '"';
var command = [
self.options.venvPip, 'download', '--dest', self.options.apioDir,
'apio[' + extraPackages.toString() + ']' + versionRange
'apio[' + self.options.extraPackages.toString() + ']' + versionRange
];
childProcess.exec(command.join(' '),
function(error/*, stdout, stderr*/) {
Expand Down

0 comments on commit 15e66e2

Please sign in to comment.