Alan Agius 96693b7023 build: add function to validate and update 3rd party license files
- Implemented functionality to compare and update third-party license files
- Added handling for '--accept' argument to update the golden license file
- Included tests to ensure the Critters license file matches the golden reference

This update ensures license file consistency and provides an easy way to update the reference file when necessary.
2024-08-24 07:37:36 +02:00

33 lines
1.1 KiB
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { runfiles } from '@bazel/runfiles';
import { dirname, join } from 'node:path';
/**
* Resolve paths for the Critters license file and the golden reference file.
*/
export const ANGULAR_SSR_PACKAGE_PATH = dirname(
runfiles.resolve('angular_cli/packages/angular/ssr/npm_package/package.json'),
);
/**
* Path to the actual license file for the Critters library.
* This file is located in the `third_party/critters` directory of the Angular CLI npm package.
*/
export const CRITTERS_ACTUAL_LICENSE_FILE_PATH = join(
ANGULAR_SSR_PACKAGE_PATH,
'third_party/critters/THIRD_PARTY_LICENSES.txt',
);
/**
* Path to the golden reference license file for the Critters library.
* This file is used as a reference for comparison and is located in the same directory as this script.
*/
export const CRITTERS_GOLDEN_LICENSE_FILE_PATH = join(__dirname, 'THIRD_PARTY_LICENSES.txt.golden');