webui-vue: Add a task to find node licences
Many open source licenses require the module and license to be
identified in the image. Yocto provides this capability for the
modules that it includes; however, this doesn't cover the modules
that npm includes during the build of webui-vue.
This change adds a new module named 'nlf' to find and create a summary
of the nodes and their licenses. The nlf recipe file was generated
automatically with:
devtool add 'npm://registry.npmjs.org;package=nlf;version=latest'
Then a new 'find_node_licenses' task in the webui-vue recipe uses
'nlf-native' to create a summary and save it to the webui-vue license
directory where Yocto stores its license info.
Tested:
Confirmed that the nlf recipe builds.
Confirmed that the 'find_node_licenses' task runs and that the
license summary is available under
'build/tmp/deploy/licenses/webui-vue/node-licenses'
Change-Id: Ia53f6e463db6966f450be2a37dc82a3c5e3f76c1
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/meta-phosphor/recipes-phosphor/webui/webui-vue_git.bb b/meta-phosphor/recipes-phosphor/webui/webui-vue_git.bb
index 5b8dec5..546c39a 100644
--- a/meta-phosphor/recipes-phosphor/webui/webui-vue_git.bb
+++ b/meta-phosphor/recipes-phosphor/webui/webui-vue_git.bb
@@ -9,7 +9,7 @@
SRCREV = "3f9cfa2c2491cc060ea57787660e918e4a7ee7e5"
S = "${WORKDIR}/git"
-DEPENDS_prepend = "nodejs-native "
+DEPENDS_prepend = "nodejs-native nlf-native "
# allarch is required because the files this recipe produces (html and
# javascript) are valid for any target, regardless of architecture. The allarch
@@ -45,3 +45,9 @@
find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' +
}
+do_find_node_licenses() {
+ cd ${S}
+ nlf -s detail > ${LICENSE_DIRECTORY}/${PN}/node-licenses
+}
+
+addtask find_node_licenses after do_compile before do_build