Skip to content

Commit

Permalink
#6 polished
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jun 21, 2022
1 parent ca74390 commit d8626c1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/commands/assemble.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ module.exports = function assemble(opts) {
`-Deo.placed=${path.resolve(opts.target, 'eo-placed.csv')}`,
`-Deo.placedFormat=csv`,
]);
console.info('EO program assembled in %s', path.resolve(opts.target));
};
4 changes: 3 additions & 1 deletion src/commands/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ const path = require('path');
* @param {Hash} opts - All options
*/
module.exports = function compile(opts) {
const target = path.resolve(opts.target);
mvnwSync([
'compiler:compile',
opts.verbose ? '' : '--quiet',
`-Dmaven.compiler.source=1.8`,
`-Dmaven.compiler.target=1.8`,
`-Deo.targetDir=${path.resolve(opts.target)}`,
`-Deo.targetDir=${target}`,
`-Deo.generatedDir=${path.resolve(opts.target, 'generated-sources')}`,
]);
console.info('Java .class files compiled into %s', target);
};
1 change: 1 addition & 0 deletions src/commands/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ module.exports = function link(opts) {
opts.verbose ? '' : '--quiet',
`-Deo.targetDir=${path.resolve(opts.target)}`,
]);
console.info('Executable JAR created at %s', path.resolve(opts.target, 'eoc.jar'));
};
5 changes: 3 additions & 2 deletions src/commands/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ const path = require('path');
* @param {Hash} opts - All options
*/
module.exports = function register(opts) {
const foreign = path.resolve(opts.target, 'eo-foreign.csv');
mvnwSync([
'eo:register',
opts.verbose ? '' : '--quiet',
`-Deo.targetDir=${path.resolve(opts.target)}`,
`-Deo.sourcesDir=${path.resolve(opts.sources)}`,
`-Deo.foreign=${path.resolve(opts.target, 'eo-foreign.csv')}`,
`-Deo.foreign=${foreign}`,
`-Deo.foreignFormat=csv`,
]);
console.info();
console.info('EO objects registered in %s', foreign);
};
4 changes: 3 additions & 1 deletion src/commands/transpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ const path = require('path');
* @param {Hash} opts - All options
*/
module.exports = function transpile(opts) {
const sources = path.resolve(opts.target, 'generated-sources');
mvnwSync([
'eo:transpile',
opts.verbose ? '' : '--quiet',
`-Deo.targetDir=${path.resolve(opts.target)}`,
`-Deo.generatedDir=${path.resolve(opts.target, 'generated-sources')}`,
`-Deo.generatedDir=${sources}`,
`-Deo.foreign=${path.resolve(opts.target, 'eo-foreign.csv')}`,
`-Deo.foreignFormat=csv`,
]);
console.info('Java sources generated in %s', sources);
};
1 change: 1 addition & 0 deletions src/eoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const test = require('./commands/test');
if (process.argv.includes('--verbose')) {
tinted.enable('debug');
console.debug('Debug output is turned ON');
console.info('INFO');
}

program
Expand Down
4 changes: 2 additions & 2 deletions src/tinted-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ const levels = {
const colors = {
'trace': 'gray',
'debug': 'gray',
'info': 'black',
'info': 'white',
'warn': 'orange',
'error': 'red',
};

for (const level in levels) {
if (levels.hasOwnProperty(level)) {
const before = console[level];
const lvl = level;
const before = console[lvl];
console[level] = function(...args) {
if (!levels[lvl]) {
return;
Expand Down

0 comments on commit d8626c1

Please sign in to comment.