From ea3170b9d80aa0df033c5aa61668f145aebfd908 Mon Sep 17 00:00:00 2001 From: Mustafa Kara Date: Tue, 7 Jun 2022 14:03:46 +0300 Subject: [PATCH 1/4] Create configuration folder for notice.txt generation Signed-off-by: Mustafa Kara --- .gitignore | 6 +++++- build/notice-file/Readme.md | 0 build/notice-file/config.yaml | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 build/notice-file/Readme.md create mode 100644 build/notice-file/config.yaml diff --git a/.gitignore b/.gitignore index e2711cebf6..e67409b069 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ env.d.ts # Xcode # -build/ +build/* *.pbxuser !default.pbxuser *.mode1v3 @@ -105,3 +105,7 @@ detox/detox_pixel_4_xl_api_30 #editor-settings .vscode .scannerwork + +# Notice.txt generation +!build/notice-file + diff --git a/build/notice-file/Readme.md b/build/notice-file/Readme.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/build/notice-file/config.yaml b/build/notice-file/config.yaml new file mode 100644 index 0000000000..993cb19f17 --- /dev/null +++ b/build/notice-file/config.yaml @@ -0,0 +1,14 @@ +--- + +title: "Mattermost Mobile" +copyright: "© 2016-present Mattermost, Inc. All Rights Reserved. See LICENSE.txt for license information." +description: "This document includes a list of open source components used in Mattermost Mobile, including those that have been modified." +reviewers: + - "mattermost/release-managers" + - "enahum" +search: + - "package.json" +dependencies: [] +devDependencies: [] + +... From b83272b09bf001bf88a4b53ca9df9a0bac597148 Mon Sep 17 00:00:00 2001 From: Mustafa Kara Date: Tue, 7 Jun 2022 14:05:26 +0300 Subject: [PATCH 2/4] Apply changes from code review Signed-off-by: Mustafa Kara --- build/notice-file/Readme.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/build/notice-file/Readme.md b/build/notice-file/Readme.md index e69de29bb2..de2e3818fe 100644 --- a/build/notice-file/Readme.md +++ b/build/notice-file/Readme.md @@ -0,0 +1,34 @@ +# Notice.txt File Configuration + +We are automatically generating Notice.txt by using first-level dependencies of the project. The related pipeline uses `config.yaml` stored in this folder. + + +## Configuration + +Sample: + +``` +title: "Mattermost Mobile" +copyright: "© 2016-present Mattermost, Inc. All Rights Reserved. See LICENSE.txt for license information." +description: "This document includes a list of open source components used in Mattermost Mobile, including those that have been modified." +reviewers: + - mattermost/release-managers + - enahum +search: + - "package.json" +dependencies: + - "wix" +devDependencies: + - "webpack" +``` + +| Field | Type | Purpose | +| :-- | :-- | :-- | +| title | string | Field content will be used as a title of the application. See first line of `NOTICE.txt` file. | +| copyright | string | Field content will be used as a copyright message. See second line of `NOTICE.txt` file. | +| description | string | Field content will be used as notice file description. See third line of `NOTICE.txt` file. | +| reviewers | array of GitHub user/teams | Those will be automatically assigned to the PRs as reviewers. | +| dependencies | array | If any dependency name mentioned, it will be automatically added even if it is not a first-level dependency. | +| devDependencies | array | If any dependency name mentioned, it will be added when it is referenced in devDependency section. | +| search | array | Pipeline will search for package.json files mentioned here. Globstar format is supported ie. `packages/**/package.json`. | + From 5309311d5fb1e02269ef1716bb3c8157400634ef Mon Sep 17 00:00:00 2001 From: Mustafa Kara Date: Tue, 7 Jun 2022 16:48:20 +0300 Subject: [PATCH 3/4] Apply changes from code review Signed-off-by: Mustafa Kara --- build/notice-file/Readme.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/notice-file/Readme.md b/build/notice-file/Readme.md index de2e3818fe..61a6a68dcc 100644 --- a/build/notice-file/Readme.md +++ b/build/notice-file/Readme.md @@ -5,6 +5,16 @@ We are automatically generating Notice.txt by using first-level dependencies of ## Configuration +Notice.txt will be always generated from first level dependencies scanned from package.json files. For some cases it may be useful to define +dependency to add it's licence to the Notice.txt even if it is not first level dependency or development dependency. + +For instance at desktop project we need to add `wix`'s licence to the Notice.txt even if it is not a first level dependency. To do that define +all dependencies at `dependencies` array at the configuration. For any dependency at `dependencies` section, pipeline code will add their +licenses to the Notice.txt file. + +At webapp project `webpack` used in `devDependencies` and it is requested because we are using some files generated by `webpack`. If any dependency +referenced at `devDependencies` section, pipeline will add those dependency licences when they are referenced at `package.json` files. + Sample: ``` @@ -32,3 +42,4 @@ devDependencies: | devDependencies | array | If any dependency name mentioned, it will be added when it is referenced in devDependency section. | | search | array | Pipeline will search for package.json files mentioned here. Globstar format is supported ie. `packages/**/package.json`. | + From 569f66908e35dae10a447e50e973fc442e921918 Mon Sep 17 00:00:00 2001 From: Mustafa Kara Date: Tue, 7 Jun 2022 17:44:31 +0300 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Amy Blais <29708087+amyblais@users.noreply.github.com> --- build/notice-file/Readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/notice-file/Readme.md b/build/notice-file/Readme.md index 61a6a68dcc..abb4a8f866 100644 --- a/build/notice-file/Readme.md +++ b/build/notice-file/Readme.md @@ -5,14 +5,14 @@ We are automatically generating Notice.txt by using first-level dependencies of ## Configuration -Notice.txt will be always generated from first level dependencies scanned from package.json files. For some cases it may be useful to define -dependency to add it's licence to the Notice.txt even if it is not first level dependency or development dependency. +Notice.txt will be always generated from first-level dependencies scanned from package.json files. For some cases it may be useful to define the +dependency to add its licence to the Notice.txt even if it is not first-level dependency or development dependency. -For instance at desktop project we need to add `wix`'s licence to the Notice.txt even if it is not a first level dependency. To do that define +For instance at desktop project we need to add `wix`'s licence to the Notice.txt even if it is not a first-level dependency. To do that, define all dependencies at `dependencies` array at the configuration. For any dependency at `dependencies` section, pipeline code will add their licenses to the Notice.txt file. -At webapp project `webpack` used in `devDependencies` and it is requested because we are using some files generated by `webpack`. If any dependency +At webapp project `webpack` used in `devDependencies`, it is requested because we are using some files generated by `webpack`. If any dependency is referenced at `devDependencies` section, pipeline will add those dependency licences when they are referenced at `package.json` files. Sample: