Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

openui5_theme: adapt to new API of less-openui5 v0.3.0 #55

Merged
merged 2 commits into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"connect-inject": "^0.4.0",
"connect-openui5": "^0.6.0",
"cors": "^2.7.1",
"less-openui5": "^0.2.0",
"less-openui5": "^0.3.0",
"maxmin": "^2.1.0",
"multiline": "^1.0.2",
"pretty-data": "^0.40.0",
Expand Down
32 changes: 20 additions & 12 deletions tasks/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

var path = require('path');
var async = require('async');
var lessOpenUI5 = require('less-openui5');
var less = require('less-openui5');

module.exports = function(grunt) {

Expand All @@ -30,6 +30,8 @@ module.exports = function(grunt) {
compiler: {}
});

var builder = new less.Builder();

// TODO check no file

// Iterate over all specified file groups.
Expand All @@ -47,17 +49,20 @@ module.exports = function(grunt) {
// TODO check no file

async.concatSeries(files, function(file, next) {
// make sure parser.filename is set
var parserOptions = grunt.util._.extend({}, options.parser, {
filename: file
});
lessOpenUI5.build(grunt.file.read(file), grunt.util._.extend({}, options, {
parser: parserOptions
}), function(err, result) {
if (err) {
nextFileObj(err);
return;
}

if (options.rootPaths) {

// Map rootpaths and get lessInputPath
options.rootPaths.forEach(function(path) {
if (file.indexOf(path) !== -1) {
file = file.substring(path.length);
}
});
}

builder.build(grunt.util._.extend({}, options, {
lessInputPath: file
})).then(function(result) {

var destDir = path.dirname(fileObj.dest);

Expand All @@ -75,6 +80,9 @@ module.exports = function(grunt) {
grunt.log.writeln('File ' + parametersDestFile + ' created.');

process.nextTick(next);

}, function(err) {
nextFileObj(err);
});
}, function() {
nextFileObj();
Expand Down