1441 |
ariadna |
1 |
// This file is part of Moodle - http://moodle.org/
|
|
|
2 |
//
|
|
|
3 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
4 |
// it under the terms of the GNU General Public License as published by
|
|
|
5 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
6 |
// (at your option) any later version.
|
|
|
7 |
//
|
|
|
8 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
9 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
10 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
11 |
// GNU General Public License for more details.
|
|
|
12 |
//
|
|
|
13 |
// You should have received a copy of the GNU General Public License
|
|
|
14 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
15 |
/* jshint node: true, browser: false */
|
|
|
16 |
/* eslint-env node */
|
|
|
17 |
|
|
|
18 |
/**
|
|
|
19 |
* @copyright 2023 Sara Arjona <sara@moodle.com>
|
|
|
20 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
21 |
*/
|
|
|
22 |
|
|
|
23 |
module.exports = grunt => {
|
|
|
24 |
/**
|
|
|
25 |
* Generate upgradable third-party libraries (utilising thirdpartylibs.xml data)
|
|
|
26 |
*/
|
|
|
27 |
grunt.registerTask('upgradablelibs', 'Generate upgradable third-party libraries', async function() {
|
|
|
28 |
const done = this.async();
|
|
|
29 |
|
|
|
30 |
const path = require('path');
|
|
|
31 |
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
|
|
|
32 |
|
|
|
33 |
// An array of third party libraries that have a newer version in their repositories.
|
|
|
34 |
const thirdPartyLibs = await ComponentList.getThirdPartyLibsUpgradable({progress: true});
|
|
|
35 |
for (let library of thirdPartyLibs) {
|
|
|
36 |
grunt.log.ok(JSON.stringify(Object.assign({}, library), null, 4));
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
done();
|
|
|
40 |
});
|
|
|
41 |
|
|
|
42 |
};
|