diff --git a/Package/gulpfile.js b/Package/gulpfile.js index 452c48237..6eb8e2930 100644 --- a/Package/gulpfile.js +++ b/Package/gulpfile.js @@ -8,6 +8,7 @@ const shelljs = require('shelljs'); const rename = require('gulp-rename'); const glob = require('glob'); const chalk = require('chalk'); +const marked = require('marked'); let assemblediOSAndroidDir = 'Assembled-iOSAndroid'; let assembledWindowsDir = 'Assembled-Windows'; @@ -15,6 +16,17 @@ let basekitBuild = false; let cmakeBasekitBuildDefinition = ''; let basekitPackagePath = ''; +const makeHTMLNotice = async () => { + return fs.promises.readFile('../README.md', 'utf8').then(content =>{ + const html = marked.parse(content); + return fs.promises.writeFile('../NOTICE.html', html, 'utf8').then(() => { + console.log(chalk.black.bgCyan(`NOTICE Conversion complete!`)); + }) + }).catch(reason =>{ + console.error(chalk.white.bgRedBright(`Error generating notice : ${reason}`)); + }); +}; + function exec(command, workingDirectory = '.', logCommand = true) { if (logCommand) { log(command); @@ -616,6 +628,8 @@ const build = gulp.series(buildIOSAndroid, switchToBaseKit, buildIOSAndroid); const rebuild = gulp.series(clean, build); const pack = gulp.series(rebuild, createPackage); +exports.makeHTMLNotice = makeHTMLNotice; + exports.validateAssembled = validateAssembled; exports.validateAssemblediOSAndroid = validateAssemblediOSAndroid; diff --git a/Package/package-lock.json b/Package/package-lock.json index bb637408a..cfc000e8f 100644 --- a/Package/package-lock.json +++ b/Package/package-lock.json @@ -4,6 +4,9 @@ "requires": true, "packages": { "": { + "dependencies": { + "marked": "^4.3.0" + }, "devDependencies": { "chalk": "^4.1.1", "fancy-log": "^1.3.3", @@ -2361,6 +2364,17 @@ "node": ">=0.10.0" } }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/matchdep": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", @@ -6102,6 +6116,11 @@ "object-visit": "^1.0.0" } }, + "marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==" + }, "matchdep": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", diff --git a/Package/package.json b/Package/package.json index 07cf86061..2ca8177d3 100644 --- a/Package/package.json +++ b/Package/package.json @@ -7,5 +7,8 @@ "gulp": "^4.0.2", "gulp-rename": "2.0.0", "shelljs": "^0.8.4" + }, + "dependencies": { + "marked": "^4.3.0" } }