mirror of
https://github.com/elastic/kibana.git
synced 2025-04-21 16:29:04 -04:00
* [grunt/build] refactor _build:notice task to not depend on npm The _build:notice task used to rely on the output of `npm ls` to determine where modules were defined, but the task now just asks `license-checker` to include the `realPath` of the modules it describes in it's output, which is ultimately the same thing but works with `yarn` too. * [grunt/licenses] convert to use lib/packages/getInstalledPackages() * [grunt/notice/generate] test generateNoticeText() * [grunt/licenses] tested assertLicensesValid() * [npm] remove npm dev dep * [tasks/lib/packages] do not include kibana in "installed packages" * [tasks/lib/notice] join all notices with the same separator
35 lines
883 B
JavaScript
35 lines
883 B
JavaScript
import { resolve } from 'path';
|
|
|
|
import {
|
|
getInstalledPackages,
|
|
generateNoticeText,
|
|
} from '../lib';
|
|
|
|
async function generate(grunt, directory) {
|
|
return await generateNoticeText({
|
|
packages: await getInstalledPackages({
|
|
directory,
|
|
licenseOverrides: grunt.config.get('licenses.options.overrides')
|
|
}),
|
|
nodeDir: grunt.config.get('platforms')[0].nodeDir
|
|
});
|
|
}
|
|
|
|
export default function (grunt) {
|
|
grunt.registerTask('_build:notice', 'Adds a notice', function () {
|
|
const done = this.async();
|
|
const kibanaDir = resolve(grunt.config.get('buildDir'), 'kibana');
|
|
const noticePath = resolve(kibanaDir, 'NOTICE.txt');
|
|
|
|
generate(grunt, kibanaDir).then(
|
|
(noticeText) => {
|
|
grunt.file.write(noticePath, noticeText);
|
|
done();
|
|
},
|
|
(error) => {
|
|
grunt.fail.fatal(error);
|
|
done(error);
|
|
}
|
|
);
|
|
});
|
|
}
|