diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 601733e..13fdc45 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -1,5 +1,6 @@ # Test the toolbox across all supported releases of MATLAB, package toolbox, create release # Adapted from: https://github.com/mathworks/climatedatastore/blob/main/.github/workflows/release.yml +# See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. name: Create new release diff --git a/LICENSE b/LICENSE index bf5b98c..915e239 100644 --- a/LICENSE +++ b/LICENSE @@ -19,3 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Portions of this software are adapted from third-party code and are subject +to the original license terms; see THIRD_PARTY_NOTICES.md. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..6965191 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,52 @@ +# Third-Party Notices + +MatBox is licensed under the MIT License (see [LICENSE](LICENSE)), with the +exception of the portions listed below, which are adapted from third-party +code and remain subject to the original license terms reproduced here. + +## mathworks/climatedatastore + +The following files are adapted from build utilities and workflows in +[mathworks/climatedatastore](https://github.com/mathworks/climatedatastore), +Copyright (c) 2021-2022, The MathWorks, Inc.: + +| MatBox file | Adapted from | +|---|---| +| `code/+matbox/+tasks/testToolbox.m` | `buildUtilities/testToolbox.m` | +| `code/+matbox/+tasks/codecheckToolbox.m` | `buildUtilities/codecheckToolbox.m` | +| `code/+matbox/+tasks/packageToolbox.m` | `buildUtilities/packageToolbox.m` | +| `code/+matbox/+tasks/createTestedWithBadgeforToolbox.m` | `buildUtilities/badgesforToolbox.m` | +| `code/+matbox/+utility/updateVersionNumber.m` | `buildUtilities/packageToolbox.m` | +| `code/+matbox/+utility/writeBadgeJSONFile.m` | `buildUtilities/writeBadgeJSONFile.m` | +| `.github/workflows/create_release.yml` | `.github/workflows/release.yml` | + +These portions are distributed under the following license. Note that, per +condition 3, modifications and derivatives of this code are licensed solely +for use in conjunction with MathWorks products and service offerings; MatBox +is a MATLAB toolbox and is used exclusively with MATLAB. + +```text +Copyright (c) 2021-2022, The MathWorks, Inc. +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. In all cases, the software is, and all modifications and derivatives of + the software shall be, licensed to you solely for use in conjunction with + MathWorks products and service offerings. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +``` diff --git a/code/+matbox/+tasks/codecheckToolbox.m b/code/+matbox/+tasks/codecheckToolbox.m index 4432490..45d6f64 100644 --- a/code/+matbox/+tasks/codecheckToolbox.m +++ b/code/+matbox/+tasks/codecheckToolbox.m @@ -1,4 +1,9 @@ function issues = codecheckToolbox(projectRootDir, options) +% codecheckToolbox - Run MATLAB code analysis on project source files +% +% Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/codecheckToolbox.m +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. + arguments projectRootDir (1,1) string {mustBeFolder} options.CreateBadge (1,1) logical = true diff --git a/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m b/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m index d812a9c..7cc46d4 100644 --- a/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m +++ b/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m @@ -2,7 +2,8 @@ function createTestedWithBadgeforToolbox(versionNumber, projectRootDirectory) %createTestedWithBadgesforToolbox - Take the test reports from the runs against % multiple MATLAB releases, and generate the "Tested with" badge % -% Adapted from: https://github.com/mathworks/climatedatastore/tree/main/buildUtilities +% Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/badgesforToolbox.m +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments versionNumber (1,1) string diff --git a/code/+matbox/+tasks/packageToolbox.m b/code/+matbox/+tasks/packageToolbox.m index 90660ba..04d1242 100644 --- a/code/+matbox/+tasks/packageToolbox.m +++ b/code/+matbox/+tasks/packageToolbox.m @@ -18,6 +18,7 @@ % e.g. "RootFilesToPackage": ["LICENSE", "THIRD_PARTY_NOTICES.md"]. % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/packageToolbox.m +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. % Todo: % [ ] Create a matlab script that fills in toolbox options for path diff --git a/code/+matbox/+tasks/testToolbox.m b/code/+matbox/+tasks/testToolbox.m index 9862e08..de11b1c 100644 --- a/code/+matbox/+tasks/testToolbox.m +++ b/code/+matbox/+tasks/testToolbox.m @@ -1,6 +1,8 @@ function testToolbox(projectRootDirectory, options) - %RUNTESTWITHCODECOVERAGE Summary of this function goes here - % Detailed explanation goes here + % testToolbox - Run project test suites with coverage and test reports + % + % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/testToolbox.m + % See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments projectRootDirectory (1,1) string {mustBeFolder} diff --git a/code/+matbox/+utility/updateVersionNumber.m b/code/+matbox/+utility/updateVersionNumber.m index 3c5dc34..f939241 100644 --- a/code/+matbox/+utility/updateVersionNumber.m +++ b/code/+matbox/+utility/updateVersionNumber.m @@ -2,6 +2,7 @@ % updateVersionNumber - Utility function to update a version number % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/packageToolbox.m +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments previousVersion string {mustBeTextScalar} = ""; diff --git a/code/+matbox/+utility/writeBadgeJSONFile.m b/code/+matbox/+utility/writeBadgeJSONFile.m index 772106c..b5189b0 100644 --- a/code/+matbox/+utility/writeBadgeJSONFile.m +++ b/code/+matbox/+utility/writeBadgeJSONFile.m @@ -34,7 +34,8 @@ function writeBadgeJSONFile(label, message, color, projectRootDirectory, options % necessary. The badge information is encoded as a JSON string and written % to a file in the specified directory. % -% CREDIT: https://github.com/mathworks/climatedatastore/tree/main/buildUtilities +% Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/writeBadgeJSONFile.m +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments label (1,1) string diff --git a/tools/MLToolboxInfo.json b/tools/MLToolboxInfo.json index 14a035b..9a36782 100644 --- a/tools/MLToolboxInfo.json +++ b/tools/MLToolboxInfo.json @@ -1,5 +1,6 @@ { "Namespace" : "matbox", + "RootFilesToPackage": ["LICENSE", "THIRD_PARTY_NOTICES.md"], "ToolboxOptions": { "Identifier": "dedfd78a-8fd1-4fca-9db3-f5eff64c7a88", "ToolboxName": "MatBox",