diff --git a/src/packagedcode/cargo.py b/src/packagedcode/cargo.py index ffe8dea515..18e19e5521 100644 --- a/src/packagedcode/cargo.py +++ b/src/packagedcode/cargo.py @@ -7,6 +7,7 @@ # See https://aboutcode.org for more information about nexB OSS projects. # +import os import re import saneyaml @@ -20,7 +21,81 @@ """ -class CargoTomlHandler(models.DatafileHandler): +class CargoBaseHandler(models.DatafileHandler): + @classmethod + def assemble(cls, package_data, resource, codebase, package_adder): + """ + Assemble Cargo.toml and possible Cargo.lock datafiles. Also + support cargo workspaces where we have multiple packages from + a repository and some shared information present at top-level. + """ + workspace = package_data.extra_data.get("workspace", {}) + workspace_members = workspace.get("members", []) + workspace_package_data = workspace.get("package", {}) + attributes_to_copy = [ + "license_detections", + "declared_license_expression", + "declared_license_expression_spdx" + ] + if "license" in workspace_package_data: + for attribute in attributes_to_copy: + workspace_package_data[attribute] = getattr(package_data, attribute) + + workspace_root_path = resource.parent(codebase).path + if workspace_package_data and workspace_members: + for workspace_member_path in workspace_members: + workspace_directory_path = os.path.join(workspace_root_path, workspace_member_path) + workspace_directory = codebase.get_resource(path=workspace_directory_path) + if not workspace_directory: + continue + + # Update the package data for all members with the + # workspace package data + for resource in workspace_directory.children(codebase): + if cls.is_datafile(location=resource.location): + if not resource.package_data: + continue + + updated_package_data = cls.update_resource_package_data( + package_data=workspace_package_data, + old_package_data=resource.package_data.pop(), + mapping=CARGO_ATTRIBUTE_MAPPING, + ) + resource.package_data.append(updated_package_data) + resource.save(codebase) + + yield from cls.assemble_from_many_datafiles( + datafile_name_patterns=('Cargo.toml', 'cargo.toml', 'Cargo.lock', 'cargo.lock'), + directory=workspace_directory, + codebase=codebase, + package_adder=package_adder, + ) + else: + yield from cls.assemble_from_many_datafiles( + datafile_name_patterns=('Cargo.toml', 'cargo.toml', 'Cargo.lock', 'cargo.lock'), + directory=resource.parent(codebase), + codebase=codebase, + package_adder=package_adder, + ) + + @classmethod + def update_resource_package_data(cls, package_data, old_package_data, mapping=None): + + for attribute in old_package_data.keys(): + if attribute in mapping: + replace_by_attribute = mapping.get(attribute) + old_package_data[attribute] = package_data.get(replace_by_attribute) + elif attribute == "parties": + old_package_data[attribute] = list(get_parties( + person_names=package_data.get("authors"), + party_role='author', + )) + + return old_package_data + + + +class CargoTomlHandler(CargoBaseHandler): datasource_id = 'cargo_toml' path_patterns = ('*/Cargo.toml', '*/cargo.toml',) default_package_type = 'cargo' @@ -31,11 +106,16 @@ class CargoTomlHandler(models.DatafileHandler): @classmethod def parse(cls, location): package_data = toml.load(location, _dict=dict) - core_package_data = package_data.get('package', {}) + workspace = package_data.get('workspace', {}) + extra_data = {} name = core_package_data.get('name') version = core_package_data.get('version') + if isinstance(version, dict) and "workspace" in version: + version = None + extra_data["version"] = "workspace" + description = core_package_data.get('description') or '' description = description.strip() @@ -66,6 +146,8 @@ def parse(cls, location): repository_homepage_url = name and f'https://crates.io/crates/{name}' repository_download_url = name and version and f'https://crates.io/api/v1/crates/{name}/{version}/download' api_data_url = name and f'https://crates.io/api/v1/crates/{name}' + if workspace: + extra_data["workspace"] = workspace yield models.PackageData( datasource_id=cls.datasource_id, @@ -82,22 +164,24 @@ def parse(cls, location): repository_download_url=repository_download_url, api_data_url=api_data_url, dependencies=dependencies, + extra_data=extra_data, ) - @classmethod - def assemble(cls, package_data, resource, codebase, package_adder): - """ - Assemble Cargo.toml and possible Cargo.lock datafiles - """ - yield from cls.assemble_from_many_datafiles( - datafile_name_patterns=('Cargo.toml', 'cargo.toml', 'Cargo.lock', 'cargo.lock'), - directory=resource.parent(codebase), - codebase=codebase, - package_adder=package_adder, - ) + +CARGO_ATTRIBUTE_MAPPING = { + # Fields in PackageData model: Fields in cargo + "homepage_url": "homepage", + "vcs_url": "repository", + "keywords": "categories", + "extracted_license_statement": "license", + # These are fields carried over to avoid re-detection of licenses + "license_detections": "license_detections", + "declared_license_expression": "declared_license_expression", + "declared_license_expression_spdx": "declared_license_expression_spdx", +} -class CargoLockHandler(models.DatafileHandler): +class CargoLockHandler(CargoBaseHandler): datasource_id = 'cargo_lock' path_patterns = ('*/Cargo.lock', '*/cargo.lock',) default_package_type = 'cargo' @@ -144,18 +228,6 @@ def parse(cls, location): dependencies=dependencies, ) - @classmethod - def assemble(cls, package_data, resource, codebase, package_adder): - """ - Assemble Cargo.toml and possible Cargo.lock datafiles - """ - yield from cls.assemble_from_many_datafiles( - datafile_name_patterns=('Cargo.toml', 'Cargo.lock',), - directory=resource.parent(codebase), - codebase=codebase, - package_adder=package_adder, - ) - def dependency_mapper(dependencies, scope='dependencies'): """ @@ -197,7 +269,7 @@ def get_parties(person_names, party_role): name=name, role=party_role, email=email, - ) + ).to_dict() person_parser = re.compile( diff --git a/src/packagedcode/licensing.py b/src/packagedcode/licensing.py index 2c576a73a9..ffd683a83f 100644 --- a/src/packagedcode/licensing.py +++ b/src/packagedcode/licensing.py @@ -709,6 +709,12 @@ def get_normalized_license_detections( if detections: license_detections.extend(detections) + if not license_detections: + unknown_dict_object = repr(dict(extracted_license.items())) + unknown_detection = get_unknown_license_detection(query_string=unknown_dict_object) + license_detections.append(unknown_detection) + if TRACE: + logger_debug(f'get_normalized_license_detections: dict: unknown_dict_object: {unknown_dict_object}, unknown_detection: {saneyaml.dump(unknown_detection.to_dict())}') else: extracted_license_statement = saneyaml.dump(extracted_license) license_detections = get_license_detections_for_extracted_license_statement( @@ -753,7 +759,6 @@ def get_normalized_license_detections( else: extracted_license_statement = saneyaml.dump(extracted_license_item) - detections = get_license_detections_for_extracted_license_statement( extracted_license_statement=extracted_license_statement, try_as_expression=try_as_expression, @@ -819,6 +824,7 @@ def get_license_detections_and_expression( if not license_detections: if not isinstance(extracted_license_statement, str): extracted_license_statement = saneyaml.dump(extracted_license_statement) + license_detection = get_unknown_license_detection(query_string=extracted_license_statement) license_detections = [license_detection] diff --git a/src/packagedcode/models.py b/src/packagedcode/models.py index 8311e570e4..2915fa4c8b 100644 --- a/src/packagedcode/models.py +++ b/src/packagedcode/models.py @@ -782,7 +782,10 @@ def populate_license_fields(self): ) if self.extracted_license_statement and not isinstance(self.extracted_license_statement, str): - self.extracted_license_statement = saneyaml.dump(self.extracted_license_statement) + if isinstance(self.extracted_license_statement, dict): + self.extracted_license_statement = saneyaml.dump(dict(self.extracted_license_statement.items())) + else: + self.extracted_license_statement = saneyaml.dump(self.extracted_license_statement) def update_purl_fields(self, package_data, replace=False): diff --git a/src/packagedcode/plugin_package.py b/src/packagedcode/plugin_package.py index 78c5464c48..b8b1b84be2 100644 --- a/src/packagedcode/plugin_package.py +++ b/src/packagedcode/plugin_package.py @@ -403,6 +403,8 @@ def get_package_and_deps(codebase, package_adder=add_to_package, strip_root=Fals for dfp in item.datafile_paths ] packages.append(item) + if TRACE: + logger_debug(' get_package_and_deps: Package:', item.purl) elif isinstance(item, Dependency): if strip_root and not has_single_resource: diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace.expected.json b/tests/packagedcode/data/cargo/cargo-with-workspace.expected.json new file mode 100644 index 0000000000..cdf4644256 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace.expected.json @@ -0,0 +1,1969 @@ +{ + "packages": [ + { + "type": "cargo", + "namespace": null, + "name": "tauri", + "version": "2.0.0-alpha.17", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "Make tiny, secure apps for all desktop platforms with Tauri", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [ + "gui", + "web-programming" + ], + "homepage_url": "https://tauri.app/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/tauri-apps/tauri", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/core/tauri/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "extra_data": {}, + "repository_homepage_url": "https://crates.io/crates/tauri", + "repository_download_url": "https://crates.io/api/v1/crates/tauri/2.0.0-alpha.17/download", + "api_data_url": "https://crates.io/api/v1/crates/tauri", + "package_uid": "pkg:cargo/tauri@2.0.0-alpha.17?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "cargo-with-workspace/core/tauri/Cargo.toml" + ], + "datasource_ids": [ + "cargo_toml" + ], + "purl": "pkg:cargo/tauri@2.0.0-alpha.17" + }, + { + "type": "cargo", + "namespace": null, + "name": "tauri-runtime", + "version": "1.0.0-alpha.4", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "Runtime for Tauri applications", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [ + "gui", + "web-programming" + ], + "homepage_url": "https://tauri.app/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/tauri-apps/tauri", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/core/tauri-runtime/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "extra_data": {}, + "repository_homepage_url": "https://crates.io/crates/tauri-runtime", + "repository_download_url": "https://crates.io/api/v1/crates/tauri-runtime/1.0.0-alpha.4/download", + "api_data_url": "https://crates.io/api/v1/crates/tauri-runtime", + "package_uid": "pkg:cargo/tauri-runtime@1.0.0-alpha.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "cargo-with-workspace/core/tauri-runtime/Cargo.toml" + ], + "datasource_ids": [ + "cargo_toml" + ], + "purl": "pkg:cargo/tauri-runtime@1.0.0-alpha.4" + }, + { + "type": "cargo", + "namespace": null, + "name": "tauri-build", + "version": "2.0.0-alpha.11", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "build time code to pair with https://crates.io/crates/tauri", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [ + "gui", + "web-programming" + ], + "homepage_url": "https://tauri.app/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/tauri-apps/tauri", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/core/tauri-build/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "extra_data": {}, + "repository_homepage_url": "https://crates.io/crates/tauri-build", + "repository_download_url": "https://crates.io/api/v1/crates/tauri-build/2.0.0-alpha.11/download", + "api_data_url": "https://crates.io/api/v1/crates/tauri-build", + "package_uid": "pkg:cargo/tauri-build@2.0.0-alpha.11?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "cargo-with-workspace/core/tauri-build/Cargo.toml" + ], + "datasource_ids": [ + "cargo_toml" + ], + "purl": "pkg:cargo/tauri-build@2.0.0-alpha.11" + }, + { + "type": "cargo", + "namespace": null, + "name": "restart", + "version": "0.1.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": null, + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [ + "gui", + "web-programming" + ], + "homepage_url": "https://tauri.app/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/tauri-apps/tauri", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/core/tests/restart/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "extra_data": {}, + "repository_homepage_url": "https://crates.io/crates/restart", + "repository_download_url": "https://crates.io/api/v1/crates/restart/0.1.0/download", + "api_data_url": "https://crates.io/api/v1/crates/restart", + "package_uid": "pkg:cargo/restart@0.1.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "cargo-with-workspace/core/tests/restart/Cargo.toml" + ], + "datasource_ids": [ + "cargo_toml" + ], + "purl": "pkg:cargo/restart@0.1.0" + }, + { + "type": "npm", + "namespace": null, + "name": "tauri-workspace", + "version": "0.0.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [ + { + "type": "person", + "role": "contributor", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/tauri-workspace/-/tauri-workspace-0.0.0.tgz", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "git+https://github.com/tauri-apps/tauri.git", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/package.json", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_36.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_36.RULE", + "matched_text": "Apache-2.0 OR MIT" + } + ], + "identifier": "apache_2_0_or_mit-70d858d7-8968-9e7f-b90f-18b72fb96bef" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "- Apache-2.0 OR MIT\n", + "notice_text": null, + "source_packages": [], + "extra_data": {}, + "repository_homepage_url": "https://www.npmjs.com/package/tauri-workspace", + "repository_download_url": "https://registry.npmjs.org/tauri-workspace/-/tauri-workspace-0.0.0.tgz", + "api_data_url": "https://registry.npmjs.org/tauri-workspace/0.0.0", + "package_uid": "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "cargo-with-workspace/package.json" + ], + "datasource_ids": [ + "npm_package_json" + ], + "purl": "pkg:npm/tauri-workspace@0.0.0" + } + ], + "dependencies": [ + { + "purl": "pkg:npm/typescript", + "extracted_requirement": "^4.5.4", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:npm/typescript?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "cargo-with-workspace/package.json", + "datasource_id": "npm_package_json" + }, + { + "purl": "pkg:npm/covector", + "extracted_requirement": "^0.9.0", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:npm/covector?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "cargo-with-workspace/package.json", + "datasource_id": "npm_package_json" + }, + { + "purl": "pkg:npm/husky", + "extracted_requirement": "^6.0.0", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:npm/husky?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "cargo-with-workspace/package.json", + "datasource_id": "npm_package_json" + }, + { + "purl": "pkg:npm/prettier", + "extracted_requirement": "^2.5.1", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:npm/prettier?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "cargo-with-workspace/package.json", + "datasource_id": "npm_package_json" + } + ], + "license_detections": [ + { + "identifier": "mit_or__mit_or_apache_2_0___and_cc_by_nc_nd_4_0-59169298-1b74-1a33-b363-79a8d5b62d2d", + "license_expression": "(mit OR (mit OR apache-2.0)) AND cc-by-nc-nd-4.0", + "license_expression_spdx": "(MIT OR (MIT OR Apache-2.0)) AND CC-BY-NC-ND-4.0", + "detection_count": 1, + "reference_matches": [ + { + "license_expression": "mit OR (mit OR apache-2.0)", + "license_expression_spdx": "MIT OR (MIT OR Apache-2.0)", + "from_file": "cargo-with-workspace/README.md", + "start_line": 19, + "end_line": 19, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 8, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "mit_or_mit_or_apache-2.0_1.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mit_or_mit_or_apache-2.0_1.RULE" + }, + { + "license_expression": "cc-by-nc-nd-4.0", + "license_expression_spdx": "CC-BY-NC-ND-4.0", + "from_file": "cargo-with-workspace/README.md", + "start_line": 21, + "end_line": 21, + "matcher": "2-aho", + "score": 95.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 95, + "rule_identifier": "cc-by-nc-nd-4.0_64.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/cc-by-nc-nd-4.0_64.RULE" + } + ] + }, + { + "identifier": "apache_2_0-62ae3761-33a2-9012-c9ab-0dd8e74dae85", + "license_expression": "apache-2.0", + "license_expression_spdx": "Apache-2.0", + "detection_count": 1, + "reference_matches": [ + { + "license_expression": "apache-2.0", + "license_expression_spdx": "Apache-2.0", + "from_file": "cargo-with-workspace/LICENSE_APACHE-2.0", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 75.0, + "matched_length": 4, + "match_coverage": 100.0, + "rule_relevance": 75, + "rule_identifier": "apache-2.0_3.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_3.RULE" + } + ] + }, + { + "identifier": "apache_2_0-d66ab77d-a5cc-7104-e702-dc7df61fe9e8", + "license_expression": "apache-2.0", + "license_expression_spdx": "Apache-2.0", + "detection_count": 1, + "reference_matches": [ + { + "license_expression": "apache-2.0", + "license_expression_spdx": "Apache-2.0", + "from_file": "cargo-with-workspace/LICENSE.spdx", + "start_line": 7, + "end_line": 7, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 3, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "spdx_license_id_apache-2.0_for_apache-2.0.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/spdx_license_id_apache-2.0_for_apache-2.0.RULE" + } + ] + }, + { + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9", + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "detection_count": 9, + "reference_matches": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ] + }, + { + "identifier": "apache_2_0_or_mit-70d858d7-8968-9e7f-b90f-18b72fb96bef", + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "detection_count": 2, + "reference_matches": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/package.json", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_36.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_36.RULE" + } + ] + }, + { + "identifier": "cc0_1_0-54f26353-a976-a403-90e0-c468b1a57236", + "license_expression": "cc0-1.0", + "license_expression_spdx": "CC0-1.0", + "detection_count": 1, + "reference_matches": [ + { + "license_expression": "cc0-1.0", + "license_expression_spdx": "CC0-1.0", + "from_file": "cargo-with-workspace/LICENSE.spdx", + "start_line": 2, + "end_line": 2, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 4, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "cc0-1.0_208.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/cc0-1.0_208.RULE" + } + ] + }, + { + "identifier": "mit-9967e727-165e-9bb5-f090-7de5e47a3929", + "license_expression": "mit", + "license_expression_spdx": "MIT", + "detection_count": 1, + "reference_matches": [ + { + "license_expression": "mit", + "license_expression_spdx": "MIT", + "from_file": "cargo-with-workspace/LICENSE_MIT", + "start_line": 1, + "end_line": 1, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 2, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "mit_14.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mit_14.RULE" + } + ] + } + ], + "files": [ + { + "path": "cargo-with-workspace", + "type": "directory", + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/Cargo.toml", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": null, + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": { + "workspace": { + "resolver": "2", + "members": [ + "core/tauri", + "core/tauri-runtime", + "core/tauri-build", + "core/tests/restart" + ], + "package": { + "authors": [ + "Tauri Programme within The Commons Conservancy" + ], + "homepage": "https://tauri.app/", + "repository": "https://github.com/tauri-apps/tauri", + "categories": [ + "gui", + "web-programming" + ], + "license": "Apache-2.0 OR MIT", + "edition": "2021", + "rust-version": "1.70", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT" + } + } + }, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "cargo_toml", + "purl": null + } + ], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": "apache-2.0 OR mit", + "detected_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "license_clues": [], + "percentage_of_license_text": 8.0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/LICENSE.spdx", + "type": "file", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": "cc0-1.0 AND apache-2.0", + "detected_license_expression_spdx": "CC0-1.0 AND Apache-2.0", + "license_detections": [ + { + "license_expression": "cc0-1.0", + "license_expression_spdx": "CC0-1.0", + "matches": [ + { + "license_expression": "cc0-1.0", + "spdx_license_expression": "CC0-1.0", + "from_file": "cargo-with-workspace/LICENSE.spdx", + "start_line": 2, + "end_line": 2, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 4, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "cc0-1.0_208.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/cc0-1.0_208.RULE" + } + ], + "identifier": "cc0_1_0-54f26353-a976-a403-90e0-c468b1a57236" + }, + { + "license_expression": "apache-2.0", + "license_expression_spdx": "Apache-2.0", + "matches": [ + { + "license_expression": "apache-2.0", + "spdx_license_expression": "Apache-2.0", + "from_file": "cargo-with-workspace/LICENSE.spdx", + "start_line": 7, + "end_line": 7, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 3, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "spdx_license_id_apache-2.0_for_apache-2.0.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/spdx_license_id_apache-2.0_for_apache-2.0.RULE" + } + ], + "identifier": "apache_2_0-d66ab77d-a5cc-7104-e702-dc7df61fe9e8" + } + ], + "license_clues": [], + "percentage_of_license_text": 6.48, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/LICENSE_APACHE-2.0", + "type": "file", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": "apache-2.0", + "detected_license_expression_spdx": "Apache-2.0", + "license_detections": [ + { + "license_expression": "apache-2.0", + "license_expression_spdx": "Apache-2.0", + "matches": [ + { + "license_expression": "apache-2.0", + "spdx_license_expression": "Apache-2.0", + "from_file": "cargo-with-workspace/LICENSE_APACHE-2.0", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 75.0, + "matched_length": 4, + "match_coverage": 100.0, + "rule_relevance": 75, + "rule_identifier": "apache-2.0_3.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_3.RULE" + } + ], + "identifier": "apache_2_0-62ae3761-33a2-9012-c9ab-0dd8e74dae85" + } + ], + "license_clues": [], + "percentage_of_license_text": 100.0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/LICENSE_MIT", + "type": "file", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": "mit", + "detected_license_expression_spdx": "MIT", + "license_detections": [ + { + "license_expression": "mit", + "license_expression_spdx": "MIT", + "matches": [ + { + "license_expression": "mit", + "spdx_license_expression": "MIT", + "from_file": "cargo-with-workspace/LICENSE_MIT", + "start_line": 1, + "end_line": 1, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 2, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "mit_14.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mit_14.RULE" + } + ], + "identifier": "mit-9967e727-165e-9bb5-f090-7de5e47a3929" + } + ], + "license_clues": [], + "percentage_of_license_text": 22.22, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/README.md", + "type": "file", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": "(mit OR (mit OR apache-2.0)) AND cc-by-nc-nd-4.0", + "detected_license_expression_spdx": "(MIT OR (MIT OR Apache-2.0)) AND CC-BY-NC-ND-4.0", + "license_detections": [ + { + "license_expression": "(mit OR (mit OR apache-2.0)) AND cc-by-nc-nd-4.0", + "license_expression_spdx": "(MIT OR (MIT OR Apache-2.0)) AND CC-BY-NC-ND-4.0", + "matches": [ + { + "license_expression": "mit OR (mit OR apache-2.0)", + "spdx_license_expression": "MIT OR (MIT OR Apache-2.0)", + "from_file": "cargo-with-workspace/README.md", + "start_line": 19, + "end_line": 19, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 8, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "mit_or_mit_or_apache-2.0_1.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mit_or_mit_or_apache-2.0_1.RULE" + }, + { + "license_expression": "cc-by-nc-nd-4.0", + "spdx_license_expression": "CC-BY-NC-ND-4.0", + "from_file": "cargo-with-workspace/README.md", + "start_line": 21, + "end_line": 21, + "matcher": "2-aho", + "score": 95.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 95, + "rule_identifier": "cc-by-nc-nd-4.0_64.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/cc-by-nc-nd-4.0_64.RULE" + } + ], + "identifier": "mit_or__mit_or_apache_2_0___and_cc_by_nc_nd_4_0-59169298-1b74-1a33-b363-79a8d5b62d2d" + } + ], + "license_clues": [], + "percentage_of_license_text": 7.34, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tauri", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tauri-build", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tauri-build/Cargo.toml", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": "tauri-build", + "version": "2.0.0-alpha.11", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "build time code to pair with https://crates.io/crates/tauri", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [ + "gui", + "web-programming" + ], + "homepage_url": "https://tauri.app/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/tauri-apps/tauri", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/tauri-build", + "repository_download_url": "https://crates.io/api/v1/crates/tauri-build/2.0.0-alpha.11/download", + "api_data_url": "https://crates.io/api/v1/crates/tauri-build", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/tauri-build@2.0.0-alpha.11" + } + ], + "for_packages": [ + "pkg:cargo/tauri-build@2.0.0-alpha.11?uuid=fixed-uid-done-for-testing-5642512d1758", + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tauri-runtime", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tauri-runtime/Cargo.toml", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": "tauri-runtime", + "version": "1.0.0-alpha.4", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "Runtime for Tauri applications", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [ + "gui", + "web-programming" + ], + "homepage_url": "https://tauri.app/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/tauri-apps/tauri", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/tauri-runtime", + "repository_download_url": "https://crates.io/api/v1/crates/tauri-runtime/1.0.0-alpha.4/download", + "api_data_url": "https://crates.io/api/v1/crates/tauri-runtime", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/tauri-runtime@1.0.0-alpha.4" + } + ], + "for_packages": [ + "pkg:cargo/tauri-runtime@1.0.0-alpha.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tauri/Cargo.toml", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": "tauri", + "version": "2.0.0-alpha.17", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "Make tiny, secure apps for all desktop platforms with Tauri", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [ + "gui", + "web-programming" + ], + "homepage_url": "https://tauri.app/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/tauri-apps/tauri", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/tauri", + "repository_download_url": "https://crates.io/api/v1/crates/tauri/2.0.0-alpha.17/download", + "api_data_url": "https://crates.io/api/v1/crates/tauri", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/tauri@2.0.0-alpha.17" + } + ], + "for_packages": [ + "pkg:cargo/tauri@2.0.0-alpha.17?uuid=fixed-uid-done-for-testing-5642512d1758", + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tests", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tests/restart", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/core/tests/restart/Cargo.toml", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": "restart", + "version": "0.1.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [ + "gui", + "web-programming" + ], + "homepage_url": "https://tauri.app/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/tauri-apps/tauri", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/Cargo.toml", + "start_line": 17, + "end_line": 17, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/restart", + "repository_download_url": "https://crates.io/api/v1/crates/restart/0.1.0/download", + "api_data_url": "https://crates.io/api/v1/crates/restart", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/restart@0.1.0" + } + ], + "for_packages": [ + "pkg:cargo/restart@0.1.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": "apache-2.0 OR mit", + "detected_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/core/tests/restart/Cargo.toml", + "start_line": 5, + "end_line": 5, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "license_clues": [], + "percentage_of_license_text": 20.0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/examples", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/examples/api", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/examples/api/package.json", + "type": "file", + "package_data": [ + { + "type": "npm", + "namespace": null, + "name": "api", + "version": "1.0.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/api/-/api-1.0.0.tgz", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:npm/%40tauri-apps/api", + "extracted_requirement": "../../tooling/api/dist", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/%40zerodevx/svelte-json-view", + "extracted_requirement": "0.2.1", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/%40iconify-json/codicon", + "extracted_requirement": "^1.1.10", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/%40iconify-json/ph", + "extracted_requirement": "^1.1.1", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/internal-ip", + "extracted_requirement": "^7.0.0", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/unocss", + "extracted_requirement": "^0.39.3", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/%40sveltejs/vite-plugin-svelte", + "extracted_requirement": "^2.4.6", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/svelte", + "extracted_requirement": "^4.2.1", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/vite", + "extracted_requirement": "^4.4.9", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://www.npmjs.com/package/api", + "repository_download_url": "https://registry.npmjs.org/api/-/api-1.0.0.tgz", + "api_data_url": "https://registry.npmjs.org/api/1.0.0", + "datasource_id": "npm_package_json", + "purl": "pkg:npm/api@1.0.0" + } + ], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/examples/api/src-tauri", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/examples/api/src-tauri/Cargo.lock", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": null, + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:cargo/addr2line@0.21.0", + "extracted_requirement": "0.21.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/adler@1.0.2", + "extracted_requirement": "1.0.2", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/aead@0.5.2", + "extracted_requirement": "0.5.2", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "cargo_lock", + "purl": null + } + ], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/examples/api/src-tauri/Cargo.toml", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": "api", + "version": "0.1.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "An example Tauri Application showcasing the api", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/examples/api/src-tauri/Cargo.toml", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_36.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_36.RULE", + "matched_text": "Apache-2.0 OR MIT" + } + ], + "identifier": "apache_2_0_or_mit-70d858d7-8968-9e7f-b90f-18b72fb96bef" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "Apache-2.0 OR MIT", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/api", + "repository_download_url": "https://crates.io/api/v1/crates/api/0.1.0/download", + "api_data_url": "https://crates.io/api/v1/crates/api", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/api@0.1.0" + } + ], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": "apache-2.0 OR mit", + "detected_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/examples/api/src-tauri/Cargo.toml", + "start_line": 7, + "end_line": 7, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "license_clues": [], + "percentage_of_license_text": 3.28, + "scan_errors": [] + }, + { + "path": "cargo-with-workspace/package.json", + "type": "file", + "package_data": [ + { + "type": "npm", + "namespace": null, + "name": "tauri-workspace", + "version": "0.0.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [ + { + "type": "person", + "role": "contributor", + "name": "Tauri Programme within The Commons Conservancy", + "email": null, + "url": null + } + ], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/tauri-workspace/-/tauri-workspace-0.0.0.tgz", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "git+https://github.com/tauri-apps/tauri.git", + "copyright": null, + "holder": null, + "declared_license_expression": "apache-2.0 OR mit", + "declared_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/package.json", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_36.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_36.RULE", + "matched_text": "Apache-2.0 OR MIT" + } + ], + "identifier": "apache_2_0_or_mit-70d858d7-8968-9e7f-b90f-18b72fb96bef" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "- Apache-2.0 OR MIT\n", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:npm/typescript", + "extracted_requirement": "^4.5.4", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/covector", + "extracted_requirement": "^0.9.0", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/husky", + "extracted_requirement": "^6.0.0", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/prettier", + "extracted_requirement": "^2.5.1", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://www.npmjs.com/package/tauri-workspace", + "repository_download_url": "https://registry.npmjs.org/tauri-workspace/-/tauri-workspace-0.0.0.tgz", + "api_data_url": "https://registry.npmjs.org/tauri-workspace/0.0.0", + "datasource_id": "npm_package_json", + "purl": "pkg:npm/tauri-workspace@0.0.0" + } + ], + "for_packages": [ + "pkg:npm/tauri-workspace@0.0.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "detected_license_expression": "apache-2.0 OR mit", + "detected_license_expression_spdx": "Apache-2.0 OR MIT", + "license_detections": [ + { + "license_expression": "apache-2.0 OR mit", + "license_expression_spdx": "Apache-2.0 OR MIT", + "matches": [ + { + "license_expression": "apache-2.0 OR mit", + "spdx_license_expression": "Apache-2.0 OR MIT", + "from_file": "cargo-with-workspace/package.json", + "start_line": 4, + "end_line": 4, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 6, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0_or_mit_37.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_37.RULE" + } + ], + "identifier": "apache_2_0_or_mit-8028b724-ab19-ab66-3288-312e7edc4fd9" + } + ], + "license_clues": [], + "percentage_of_license_text": 8.33, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/Cargo.toml b/tests/packagedcode/data/cargo/cargo-with-workspace/Cargo.toml new file mode 100644 index 0000000000..e95103f7eb --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/Cargo.toml @@ -0,0 +1,27 @@ +[workspace] +resolver = "2" +members = [ + # core + "core/tauri", + "core/tauri-runtime", + "core/tauri-build", + # integration tests + "core/tests/restart", +] + +[workspace.package] +authors = ["Tauri Programme within The Commons Conservancy"] +homepage = "https://tauri.app/" +repository = "https://github.com/tauri-apps/tauri" +categories = ["gui", "web-programming"] +license = "Apache-2.0 OR MIT" +edition = "2021" +rust-version = "1.70" + +# default to small, optimized workspace release binaries +[profile.release] +panic = "abort" +codegen-units = 1 +lto = true +incremental = false +opt-level = "s" diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE.spdx b/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE.spdx new file mode 100644 index 0000000000..7e8f2bfad2 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE.spdx @@ -0,0 +1,20 @@ +SPDXVersion: SPDX-2.1 +DataLicense: CC0-1.0 +PackageName: tauri +DataFormat: SPDXRef-1 +PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy +PackageHomePage: https://tauri.app +PackageLicenseDeclared: Apache-2.0 +PackageLicenseDeclared: MIT +PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy +PackageSummary: Tauri is a rust project that enables developers to make secure +and small desktop applications using a web frontend. + +PackageComment: The package includes the following libraries; see +Relationship information. + +Created: 2019-05-20T09:00:00Z +PackageDownloadLocation: git://github.com/tauri-apps/tauri +PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git +PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git +Creator: Person: Daniel Thompson-Yvetot diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE_APACHE-2.0 b/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE_APACHE-2.0 new file mode 100644 index 0000000000..5410b6a11a --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE_APACHE-2.0 @@ -0,0 +1 @@ +Apache License 2.0 \ No newline at end of file diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE_MIT b/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE_MIT new file mode 100644 index 0000000000..0559474d69 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/LICENSE_MIT @@ -0,0 +1,3 @@ +MIT License + +Copyright (c) 2017 - Present Tauri Apps Contributors diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/README.md b/tests/packagedcode/data/cargo/cargo-with-workspace/README.md new file mode 100644 index 0000000000..3dceea4f3f --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/README.md @@ -0,0 +1,21 @@ +## Current Releases + +### Core + +| Component | Description | Version | Lin | Win | Mac | +| -------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------- | --- | --- | --- | +| [**tauri**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri) | runtime core | [![](https://img.shields.io/crates/v/tauri.svg)](https://crates.io/crates/tauri) | ✅ | ✅ | ✅ | +| [**tauri-build**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build) | applies macros at build-time | [![](https://img.shields.io/crates/v/tauri-build.svg)](https://crates.io/crates/tauri-build) | ✅ | ✅ | ✅ | +| [**tauri-runtime**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime) | layer between Tauri and webview libraries | [![](https://img.shields.io/crates/v/tauri-runtime.svg)](https://crates.io/crates/tauri-runtime) | ✅ | ✅ | ✅ | + +## Introduction + +Tauri is a framework for building tiny, blazingly fast binaries for all major desktop platforms. Developers can integrate any front-end framework that compiles to HTML, JS and CSS for building their user interface. The backend of the application is a rust-sourced binary with an API that the front-end can interact with. + +## Licenses + +Code: (c) 2015 - 2021 - The Tauri Programme within The Commons Conservancy. + +MIT or MIT/Apache 2.0 where applicable. + +Logo: CC-BY-NC-ND diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri-build/Cargo.toml b/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri-build/Cargo.toml new file mode 100644 index 0000000000..a3725585b6 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri-build/Cargo.toml @@ -0,0 +1,51 @@ +[package] +name = "tauri-build" +version = "2.0.0-alpha.11" +description = "build time code to pair with https://crates.io/crates/tauri" +exclude = [ "CHANGELOG.md", "/target" ] +readme = "README.md" +authors = { workspace = true } +homepage = { workspace = true } +repository = { workspace = true } +categories = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } + +[package.metadata.docs.rs] +all-features = true +default-target = "x86_64-unknown-linux-gnu" +targets = [ + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-linux-android", + "x86_64-apple-ios" +] +rustc-args = [ "--cfg", "docsrs" ] +rustdoc-args = [ "--cfg", "docsrs" ] + +[dependencies] +anyhow = "1" +quote = { version = "1", optional = true } +tauri-codegen = { version = "2.0.0-alpha.10", path = "../tauri-codegen", optional = true } +tauri-utils = { version = "2.0.0-alpha.10", path = "../tauri-utils", features = [ "build", "resources" ] } +cargo_toml = "0.17" +serde = "1" +serde_json = "1" +heck = "0.4" +json-patch = "1.2" +walkdir = "2" +tauri-winres = "0.1" +semver = "1" +dirs-next = "2" + +[target."cfg(target_os = \"macos\")".dependencies] +swift-rs = { version = "1.0.6", features = [ "build" ] } +plist = "1" + +[features] +codegen = [ "tauri-codegen", "quote" ] +isolation = [ "tauri-codegen/isolation", "tauri-utils/isolation" ] +config-json5 = [ "tauri-utils/config-json5" ] +config-toml = [ "tauri-utils/config-toml" ] diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri-runtime/Cargo.toml b/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri-runtime/Cargo.toml new file mode 100644 index 0000000000..8c30ab13d5 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri-runtime/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "tauri-runtime" +version = "1.0.0-alpha.4" +description = "Runtime for Tauri applications" +exclude = [ "CHANGELOG.md", "/target" ] +readme = "README.md" +authors = { workspace = true } +homepage = { workspace = true } +repository = { workspace = true } +categories = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } + +[package.metadata.docs.rs] +all-features = true +rustc-args = [ "--cfg", "docsrs" ] +rustdoc-args = [ "--cfg", "docsrs" ] +default-target = "x86_64-unknown-linux-gnu" +targets = [ + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-linux-android", + "x86_64-apple-ios" +] + +[dependencies] +serde = { version = "1.0", features = [ "derive" ] } +serde_json = "1.0" +thiserror = "1.0" +tauri-utils = { version = "2.0.0-alpha.10", path = "../tauri-utils" } +http = "0.2.4" +raw-window-handle = "0.5" +url = { version = "2" } + +[target."cfg(windows)".dependencies.windows] +version = "0.51" +features = [ "Win32_Foundation" ] + +[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] +gtk = { version = "0.18", features = [ "v3_24" ] } + +[target."cfg(target_os = \"android\")".dependencies] +jni = "0.21" + +[target."cfg(target_os = \"macos\")".dependencies] +url = "2" + +[features] +devtools = [ ] +macos-private-api = [ ] diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri/Cargo.toml b/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri/Cargo.toml new file mode 100644 index 0000000000..97ea27d464 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/core/tauri/Cargo.toml @@ -0,0 +1,194 @@ +[package] +name = "tauri" +version = "2.0.0-alpha.17" +description = "Make tiny, secure apps for all desktop platforms with Tauri" +exclude = [ "/test", "/.scripts", "CHANGELOG.md", "/target" ] +readme = "README.md" +links = "Tauri" +authors = { workspace = true } +homepage = { workspace = true } +repository = { workspace = true } +categories = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } + +[package.metadata.docs.rs] +no-default-features = true +features = [ + "wry", + "custom-protocol", + "tray-icon", + "devtools", + "icon-png", + "protocol-asset", + "test" +] +rustc-args = [ "--cfg", "docsrs" ] +rustdoc-args = [ "--cfg", "docsrs" ] +default-target = "x86_64-unknown-linux-gnu" +targets = [ + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-linux-android", + "x86_64-apple-ios" +] + +[package.metadata.cargo-udeps.ignore] +normal = [ "reqwest" ] +build = [ "tauri-build" ] +development = [ "quickcheck_macros" ] + +[dependencies] +serde_json = { version = "1.0", features = [ "raw_value" ] } +serde = { version = "1.0", features = [ "derive", "rc" ] } +tokio = { version = "1", features = [ "rt", "rt-multi-thread", "sync", "fs", "io-util" ] } +futures-util = "0.3" +uuid = { version = "1", features = [ "v4" ], optional = true } +url = { version = "2.4" } +anyhow = "1.0" +thiserror = "1.0" +once_cell = "1" +tauri-runtime = { version = "1.0.0-alpha.4", path = "../tauri-runtime" } +tauri-macros = { version = "2.0.0-alpha.10", path = "../tauri-macros" } +tauri-utils = { version = "2.0.0-alpha.10", features = [ "resources" ], path = "../tauri-utils" } +tauri-runtime-wry = { version = "1.0.0-alpha.5", path = "../tauri-runtime-wry", optional = true } +getrandom = "0.2" +serde_repr = "0.1" +state = "0.6" +http = "0.2" +dirs-next = "2.0" +percent-encoding = "2.3" +reqwest = { version = "0.11", default-features = false, features = [ "json", "stream" ] } +bytes = { version = "1", features = [ "serde" ] } +raw-window-handle = "0.5" +glob = "0.3" +mime = "0.3" +data-url = { version = "0.3", optional = true } +serialize-to-javascript = "=0.1.1" +infer = { version = "0.15", optional = true } +png = { version = "0.17", optional = true } +ico = { version = "0.3.0", optional = true } +http-range = { version = "0.1.5", optional = true } + +[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\", target_os = \"windows\", target_os = \"macos\"))".dependencies] +muda = { version = "0.11", default-features = false, features = [ "serde" ] } +tray-icon = { version = "0.11", default-features = false, features = [ "serde" ], optional = true } + +[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] +gtk = { version = "0.18", features = [ "v3_24" ] } +webkit2gtk = { version = "=2.0.1", features = [ "v2_38" ] } + +[target."cfg(target_os = \"macos\")".dependencies] +embed_plist = "1.2" +cocoa = "0.25" +objc = "0.2" +window-vibrancy = "0.4" + +[target."cfg(windows)".dependencies] +webview2-com = "0.27" +window-vibrancy = "0.4" + + [target."cfg(windows)".dependencies.windows] + version = "0.51" + features = [ "Win32_Foundation" ] + +[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] +log = "0.4" +heck = "0.4" + +[target."cfg(target_os = \"android\")".dependencies] +jni = "0.21" + +[target."cfg(target_os = \"ios\")".dependencies] +libc = "0.2" +objc = "0.2" +cocoa = "0.25" +swift-rs = "1.0.6" + +[build-dependencies] +heck = "0.4" +once_cell = "1" +tauri-build = { path = "../tauri-build/", version = "2.0.0-alpha.11" } + +[dev-dependencies] +proptest = "1.4.0" +quickcheck = "1.0.3" +quickcheck_macros = "1.0.0" +serde = { version = "1.0", features = [ "derive" ] } +serde_json = "1.0" +tauri = { path = ".", default-features = false, features = [ "wry" ] } +tokio = { version = "1", features = [ "full" ] } +cargo_toml = "0.17" +http-range = "0.1.5" + +[features] +default = [ + "wry", + "compression", + "objc-exception", + "tray-icon?/common-controls-v6", + "muda/common-controls-v6" +] +tray-icon = [ "dep:tray-icon" ] +test = [ ] +compression = [ "tauri-macros/compression", "tauri-utils/compression" ] +wry = [ "tauri-runtime-wry" ] +objc-exception = [ "tauri-runtime-wry/objc-exception" ] +linux-ipc-protocol = [ "tauri-runtime-wry/linux-protocol-body", "webkit2gtk/v2_40" ] +linux-libxdo = [ "tray-icon/libxdo", "muda/libxdo" ] +isolation = [ "tauri-utils/isolation", "tauri-macros/isolation", "uuid" ] +custom-protocol = [ "tauri-macros/custom-protocol" ] +native-tls = [ "reqwest/native-tls" ] +native-tls-vendored = [ "reqwest/native-tls-vendored" ] +rustls-tls = [ "reqwest/rustls-tls" ] +devtools = [ "tauri-runtime/devtools", "tauri-runtime-wry/devtools" ] +process-relaunch-dangerous-allow-symlink-macos = [ "tauri-utils/process-relaunch-dangerous-allow-symlink-macos" ] +macos-private-api = [ + "tauri-runtime/macos-private-api", + "tauri-runtime-wry/macos-private-api" +] +window-data-url = [ "data-url" ] +protocol-asset = [ "http-range" ] +config-json5 = [ "tauri-macros/config-json5" ] +config-toml = [ "tauri-macros/config-toml" ] +icon-ico = [ "infer", "ico" ] +icon-png = [ "infer", "png" ] + +[[example]] +name = "commands" +path = "../../examples/commands/main.rs" + +[[example]] +name = "helloworld" +path = "../../examples/helloworld/main.rs" + +[[example]] +name = "multiwindow" +path = "../../examples/multiwindow/main.rs" + +[[example]] +name = "parent-window" +path = "../../examples/parent-window/main.rs" + +[[example]] +name = "navigation" +path = "../../examples/navigation/main.rs" + +[[example]] +name = "splashscreen" +path = "../../examples/splashscreen/main.rs" + +[[example]] +name = "state" +path = "../../examples/state/main.rs" + +[[example]] +name = "streaming" +path = "../../examples/streaming/main.rs" + +[[example]] +name = "isolation" +path = "../../examples/isolation/main.rs" +required-features = [ "isolation" ] diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/core/tests/restart/Cargo.toml b/tests/packagedcode/data/cargo/cargo-with-workspace/core/tests/restart/Cargo.toml new file mode 100644 index 0000000000..1d7036e986 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/core/tests/restart/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "restart" +version = "0.1.0" +authors = [ "Tauri Programme within The Commons Conservancy" ] +license = "Apache-2.0 OR MIT" +edition = "2021" + +[dependencies.tauri] +path = "../../tauri" + +[dev-dependencies] +tempfile = "3" diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/package.json b/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/package.json new file mode 100644 index 0000000000..b1ab687345 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/package.json @@ -0,0 +1,25 @@ +{ + "name": "api", + "private": true, + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "tauri": "node ../../tooling/cli/node/tauri.js" + }, + "dependencies": { + "@tauri-apps/api": "../../tooling/api/dist", + "@zerodevx/svelte-json-view": "0.2.1" + }, + "devDependencies": { + "@iconify-json/codicon": "^1.1.10", + "@iconify-json/ph": "^1.1.1", + "internal-ip": "^7.0.0", + "unocss": "^0.39.3", + "@sveltejs/vite-plugin-svelte": "^2.4.6", + "svelte": "^4.2.1", + "vite": "^4.4.9" + } +} diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/src-tauri/Cargo.lock b/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/src-tauri/Cargo.lock new file mode 100644 index 0000000000..5e47801481 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/src-tauri/Cargo.lock @@ -0,0 +1,28 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/src-tauri/Cargo.toml b/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/src-tauri/Cargo.toml new file mode 100644 index 0000000000..c83ce5c1ce --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/examples/api/src-tauri/Cargo.toml @@ -0,0 +1,57 @@ +[package] +name = "api" +version = "0.1.0" +description = "An example Tauri Application showcasing the api" +edition = "2021" +rust-version = "1.70" +license = "Apache-2.0 OR MIT" + +[lib] +name = "api_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[build-dependencies] +tauri-build = { path = "../../../core/tauri-build", features = ["codegen", "isolation"] } + +[dependencies] +serde_json = "1.0" +serde = { version = "1.0", features = [ "derive" ] } +tiny_http = "0.11" +log = "0.4" +tauri-plugin-sample = { path = "./tauri-plugin-sample/" } + +[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] +tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } + +[patch.crates-io] +tauri = { path = "../../../core/tauri" } +tauri-build = { path = "../../../core/tauri-build" } + +[dependencies.tauri] +path = "../../../core/tauri" +features = [ + "protocol-asset", + "icon-ico", + "icon-png", + "isolation", + "macos-private-api", + "tray-icon" +] + +[dev-dependencies.tauri] +path = "../../../core/tauri" +features = ["test"] + +[target."cfg(target_os = \"windows\")".dependencies] +window-shadows= "0.2" + +[features] +custom-protocol = [ "tauri/custom-protocol" ] + +# default to small, optimized release binaries +[profile.release] +panic = "abort" +codegen-units = 1 +lto = true +incremental = false +opt-level = "s" diff --git a/tests/packagedcode/data/cargo/cargo-with-workspace/package.json b/tests/packagedcode/data/cargo/cargo-with-workspace/package.json new file mode 100644 index 0000000000..3c8d8351ca --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo-with-workspace/package.json @@ -0,0 +1,26 @@ +{ + "name": "tauri-workspace", + "version": "0.0.0", + "license": "Apache-2.0 OR MIT", + "private": true, + "contributors": [ + "Tauri Programme within The Commons Conservancy" + ], + "repository": { + "type": "git", + "url": "https://github.com/tauri-apps/tauri.git" + }, + "scripts": { + "format": "prettier --write . --config .prettierrc --ignore-path .prettierignore", + "format:check": "prettier --check . --config .prettierrc --ignore-path .prettierignore", + "postinstall": "husky install" + }, + "devDependencies": { + "covector": "^0.9.0", + "husky": "^6.0.0", + "prettier": "^2.5.1" + }, + "dependencies": { + "typescript": "^4.5.4" + } +} diff --git a/tests/packagedcode/data/cargo/cargo_toml/rustup/Cargo.toml.expected b/tests/packagedcode/data/cargo/cargo_toml/rustup/Cargo.toml.expected index 52724647f0..457a1549d3 100644 --- a/tests/packagedcode/data/cargo/cargo_toml/rustup/Cargo.toml.expected +++ b/tests/packagedcode/data/cargo/cargo_toml/rustup/Cargo.toml.expected @@ -64,7 +64,13 @@ "notice_text": null, "source_packages": [], "file_references": [], - "extra_data": {}, + "extra_data": { + "workspace": { + "members": [ + "src/download" + ] + } + }, "dependencies": [], "repository_homepage_url": "https://crates.io/crates/rustup", "repository_download_url": "https://crates.io/api/v1/crates/rustup/1.17.0/download", diff --git a/tests/packagedcode/data/cargo/cargo_toml/tauri-examples/Cargo.toml b/tests/packagedcode/data/cargo/cargo_toml/tauri-examples/Cargo.toml new file mode 100644 index 0000000000..ee27b9b393 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo_toml/tauri-examples/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "core-api" +version = { workspace = true } +edition = "2021" + +[dependencies] diff --git a/tests/packagedcode/data/cargo/cargo_toml/tauri-examples/Cargo.toml.expected b/tests/packagedcode/data/cargo/cargo_toml/tauri-examples/Cargo.toml.expected new file mode 100644 index 0000000000..32ee8a491c --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo_toml/tauri-examples/Cargo.toml.expected @@ -0,0 +1,46 @@ +[ + { + "type": "cargo", + "namespace": null, + "name": "core-api", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": { + "version": "workspace" + }, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/core-api", + "repository_download_url": null, + "api_data_url": "https://crates.io/api/v1/crates/core-api", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/core-api" + } +] \ No newline at end of file diff --git a/tests/packagedcode/data/cargo/cargo_toml/tauri/Cargo.toml b/tests/packagedcode/data/cargo/cargo_toml/tauri/Cargo.toml new file mode 100644 index 0000000000..8c30ab13d5 --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo_toml/tauri/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "tauri-runtime" +version = "1.0.0-alpha.4" +description = "Runtime for Tauri applications" +exclude = [ "CHANGELOG.md", "/target" ] +readme = "README.md" +authors = { workspace = true } +homepage = { workspace = true } +repository = { workspace = true } +categories = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } + +[package.metadata.docs.rs] +all-features = true +rustc-args = [ "--cfg", "docsrs" ] +rustdoc-args = [ "--cfg", "docsrs" ] +default-target = "x86_64-unknown-linux-gnu" +targets = [ + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-linux-android", + "x86_64-apple-ios" +] + +[dependencies] +serde = { version = "1.0", features = [ "derive" ] } +serde_json = "1.0" +thiserror = "1.0" +tauri-utils = { version = "2.0.0-alpha.10", path = "../tauri-utils" } +http = "0.2.4" +raw-window-handle = "0.5" +url = { version = "2" } + +[target."cfg(windows)".dependencies.windows] +version = "0.51" +features = [ "Win32_Foundation" ] + +[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] +gtk = { version = "0.18", features = [ "v3_24" ] } + +[target."cfg(target_os = \"android\")".dependencies] +jni = "0.21" + +[target."cfg(target_os = \"macos\")".dependencies] +url = "2" + +[features] +devtools = [ ] +macos-private-api = [ ] diff --git a/tests/packagedcode/data/cargo/cargo_toml/tauri/Cargo.toml.expected b/tests/packagedcode/data/cargo/cargo_toml/tauri/Cargo.toml.expected new file mode 100644 index 0000000000..2d142d914a --- /dev/null +++ b/tests/packagedcode/data/cargo/cargo_toml/tauri/Cargo.toml.expected @@ -0,0 +1,79 @@ +[ + { + "type": "cargo", + "namespace": null, + "name": "tauri-runtime", + "version": "1.0.0-alpha.4", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "Runtime for Tauri applications", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "workspace", + "email": null, + "url": null + } + ], + "keywords": [], + "homepage_url": { + "workspace": true + }, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": { + "workspace": true + }, + "copyright": null, + "holder": null, + "declared_license_expression": "unknown", + "declared_license_expression_spdx": "LicenseRef-scancode-unknown", + "license_detections": [ + { + "license_expression": "unknown", + "license_expression_spdx": "LicenseRef-scancode-unknown", + "matches": [ + { + "license_expression": "unknown", + "spdx_license_expression": "LicenseRef-scancode-unknown", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 100.0, + "matched_length": 3, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "package-manifest-unknown-06e9bf2862e301d2e03347936ee156170df84855", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-06e9bf2862e301d2e03347936ee156170df84855", + "matched_text": "license {'workspace': True}" + } + ], + "identifier": "unknown-91d148c3-19ed-e6b1-0d37-5f588dcd6a94" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "workspace: yes\n", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/tauri-runtime", + "repository_download_url": "https://crates.io/api/v1/crates/tauri-runtime/1.0.0-alpha.4/download", + "api_data_url": "https://crates.io/api/v1/crates/tauri-runtime", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/tauri-runtime@1.0.0-alpha.4" + } +] \ No newline at end of file diff --git a/tests/packagedcode/data/cargo/scan.expected.json b/tests/packagedcode/data/cargo/scan.expected.json index b0207904e3..8af8ca3ac2 100644 --- a/tests/packagedcode/data/cargo/scan.expected.json +++ b/tests/packagedcode/data/cargo/scan.expected.json @@ -148,7 +148,14 @@ "extracted_license_statement": "MIT OR Apache-2.0", "notice_text": null, "source_packages": [], - "extra_data": {}, + "extra_data": { + "workspace": { + "members": [ + "bench", + "daacfind" + ] + } + }, "repository_homepage_url": "https://crates.io/crates/daachorse", "repository_download_url": "https://crates.io/api/v1/crates/daachorse/0.4.1/download", "api_data_url": "https://crates.io/api/v1/crates/daachorse", @@ -895,7 +902,14 @@ "notice_text": null, "source_packages": [], "file_references": [], - "extra_data": {}, + "extra_data": { + "workspace": { + "members": [ + "bench", + "daacfind" + ] + } + }, "dependencies": [], "repository_homepage_url": "https://crates.io/crates/daachorse", "repository_download_url": "https://crates.io/api/v1/crates/daachorse/0.4.1/download", diff --git a/tests/packagedcode/data/plugin/com-package-expected.json b/tests/packagedcode/data/plugin/com-package-expected.json index af222b3492..a839bb3166 100644 --- a/tests/packagedcode/data/plugin/com-package-expected.json +++ b/tests/packagedcode/data/plugin/com-package-expected.json @@ -50,18 +50,18 @@ "spdx_license_expression": "LicenseRef-scancode-unknown", "from_file": "chcp.com", "start_line": 1, - "end_line": 3, + "end_line": 1, "matcher": "5-undetected", - "score": 88.89, - "matched_length": 8, + "score": 90.0, + "matched_length": 9, "match_coverage": 100.0, "rule_relevance": 100, - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/plugin/mui-package-expected.json b/tests/packagedcode/data/plugin/mui-package-expected.json index 90a0506b13..b81b349559 100644 --- a/tests/packagedcode/data/plugin/mui-package-expected.json +++ b/tests/packagedcode/data/plugin/mui-package-expected.json @@ -50,18 +50,18 @@ "spdx_license_expression": "LicenseRef-scancode-unknown", "from_file": "clfs.sys.mui", "start_line": 1, - "end_line": 3, + "end_line": 1, "matcher": "5-undetected", - "score": 88.89, - "matched_length": 8, + "score": 90.0, + "matched_length": 9, "match_coverage": 100.0, "rule_relevance": 100, - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/plugin/mun-package-expected.json b/tests/packagedcode/data/plugin/mun-package-expected.json index dfc7072e1c..6e5ed17049 100644 --- a/tests/packagedcode/data/plugin/mun-package-expected.json +++ b/tests/packagedcode/data/plugin/mun-package-expected.json @@ -50,18 +50,18 @@ "spdx_license_expression": "LicenseRef-scancode-unknown", "from_file": "crypt32.dll.mun", "start_line": 1, - "end_line": 3, + "end_line": 1, "matcher": "5-undetected", - "score": 88.89, - "matched_length": 8, + "score": 90.0, + "matched_length": 9, "match_coverage": 100.0, "rule_relevance": 100, - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/plugin/sys-package-expected.json b/tests/packagedcode/data/plugin/sys-package-expected.json index 24053b6b66..67448346dd 100644 --- a/tests/packagedcode/data/plugin/sys-package-expected.json +++ b/tests/packagedcode/data/plugin/sys-package-expected.json @@ -50,18 +50,18 @@ "spdx_license_expression": "LicenseRef-scancode-unknown", "from_file": "tbs.sys", "start_line": 1, - "end_line": 3, + "end_line": 1, "matcher": "5-undetected", - "score": 88.89, - "matched_length": 8, + "score": 90.0, + "matched_length": 9, "match_coverage": 100.0, "rule_relevance": 100, - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/plugin/tlb-package-expected.json b/tests/packagedcode/data/plugin/tlb-package-expected.json index 3d018a9af0..cc3511f4ba 100644 --- a/tests/packagedcode/data/plugin/tlb-package-expected.json +++ b/tests/packagedcode/data/plugin/tlb-package-expected.json @@ -50,18 +50,18 @@ "spdx_license_expression": "LicenseRef-scancode-unknown", "from_file": "stdole2.tlb", "start_line": 1, - "end_line": 3, + "end_line": 1, "matcher": "5-undetected", - "score": 88.89, - "matched_length": 8, + "score": 90.0, + "matched_length": 9, "match_coverage": 100.0, "rule_relevance": 100, - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/plugin/winmd-package-expected.json b/tests/packagedcode/data/plugin/winmd-package-expected.json index 614c5566bf..4d30689589 100644 --- a/tests/packagedcode/data/plugin/winmd-package-expected.json +++ b/tests/packagedcode/data/plugin/winmd-package-expected.json @@ -50,18 +50,18 @@ "spdx_license_expression": "LicenseRef-scancode-unknown", "from_file": "Windows.AI.winmd", "start_line": 1, - "end_line": 3, + "end_line": 1, "matcher": "5-undetected", - "score": 88.89, - "matched_length": 8, + "score": 90.0, + "matched_length": 9, "match_coverage": 100.0, "rule_relevance": 100, - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/pypi/metadata/v10/PKG-INFO-expected.json b/tests/packagedcode/data/pypi/metadata/v10/PKG-INFO-expected.json index a47e1e1729..b7e86d05b0 100644 --- a/tests/packagedcode/data/pypi/metadata/v10/PKG-INFO-expected.json +++ b/tests/packagedcode/data/pypi/metadata/v10/PKG-INFO-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 100.0, + "license_expression": "unknown", + "spdx_license_expression": "LicenseRef-scancode-unknown", + "from_file": null, "start_line": 1, "end_line": 1, - "from_file": null, + "matcher": "5-undetected", + "score": 100.0, "matched_length": 4, "match_coverage": 100.0, - "matcher": "5-undetected", - "license_expression": "unknown", - "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-623aa537047267a404620d70ae00f1448b424248", "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-623aa537047267a404620d70ae00f1448b424248", - "matched_text": "license license: LICENSE.txt" + "rule_identifier": "package-manifest-unknown-54cabbf9e6e2ad452085853f06d62077e9d72ddb", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-54cabbf9e6e2ad452085853f06d62077e9d72ddb", + "matched_text": "license {'license': 'LICENSE.txt'}" } ], - "identifier": "unknown-083832d0-fb1a-f0bc-de38-c8d1cc1a3a8a" + "identifier": "unknown-d5d1ef26-6d73-51c2-0bd1-6551bb2e6e9c" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/Microsoft.Practices.EnterpriseLibrary.Caching.dll.package-expected.json b/tests/packagedcode/data/win_pe/Microsoft.Practices.EnterpriseLibrary.Caching.dll.package-expected.json index c9f46cad95..834a9e1936 100644 --- a/tests/packagedcode/data/win_pe/Microsoft.Practices.EnterpriseLibrary.Caching.dll.package-expected.json +++ b/tests/packagedcode/data/win_pe/Microsoft.Practices.EnterpriseLibrary.Caching.dll.package-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 75.0, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 3, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ad65678ddd5bed50985f1d896d812061269049b0", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 83.33, + "matched_length": 5, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ad65678ddd5bed50985f1d896d812061269049b0", - "matched_text": "license LegalCopyright:\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-679f097d28658555700ef170738adb0fd7151fce", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-679f097d28658555700ef170738adb0fd7151fce", + "matched_text": "license {'LegalCopyright': None, 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-d5e156bc-5560-c52a-28b9-d79ccb4407b2" + "identifier": "unknown-3a74427e-26a2-7b3f-eb84-9b610c013417" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/Moq.Silverlight.dll.package-expected.json b/tests/packagedcode/data/win_pe/Moq.Silverlight.dll.package-expected.json index 5e4548e14f..d8a120c290 100644 --- a/tests/packagedcode/data/win_pe/Moq.Silverlight.dll.package-expected.json +++ b/tests/packagedcode/data/win_pe/Moq.Silverlight.dll.package-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 75.0, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 3, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ad65678ddd5bed50985f1d896d812061269049b0", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 83.33, + "matched_length": 5, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ad65678ddd5bed50985f1d896d812061269049b0", - "matched_text": "license LegalCopyright:\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-679f097d28658555700ef170738adb0fd7151fce", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-679f097d28658555700ef170738adb0fd7151fce", + "matched_text": "license {'LegalCopyright': None, 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-d5e156bc-5560-c52a-28b9-d79ccb4407b2" + "identifier": "unknown-3a74427e-26a2-7b3f-eb84-9b610c013417" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/Windows.AI.winmd.package-expected.json b/tests/packagedcode/data/win_pe/Windows.AI.winmd.package-expected.json index 34090a5517..eb5f45a502 100644 --- a/tests/packagedcode/data/win_pe/Windows.AI.winmd.package-expected.json +++ b/tests/packagedcode/data/win_pe/Windows.AI.winmd.package-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 88.89, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 8, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 90.0, + "matched_length": 9, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/_ctypes_test.pyd.package-expected.json b/tests/packagedcode/data/win_pe/_ctypes_test.pyd.package-expected.json index ae66ab3e67..2550c96904 100644 --- a/tests/packagedcode/data/win_pe/_ctypes_test.pyd.package-expected.json +++ b/tests/packagedcode/data/win_pe/_ctypes_test.pyd.package-expected.json @@ -31,22 +31,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 75.0, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 3, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ad65678ddd5bed50985f1d896d812061269049b0", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 83.33, + "matched_length": 5, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ad65678ddd5bed50985f1d896d812061269049b0", - "matched_text": "license LegalCopyright:\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-679f097d28658555700ef170738adb0fd7151fce", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-679f097d28658555700ef170738adb0fd7151fce", + "matched_text": "license {'LegalCopyright': None, 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-d5e156bc-5560-c52a-28b9-d79ccb4407b2" + "identifier": "unknown-3a74427e-26a2-7b3f-eb84-9b610c013417" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/chcp.com.package-expected.json b/tests/packagedcode/data/win_pe/chcp.com.package-expected.json index 99d253eae6..5bc78b2d77 100644 --- a/tests/packagedcode/data/win_pe/chcp.com.package-expected.json +++ b/tests/packagedcode/data/win_pe/chcp.com.package-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 88.89, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 8, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 90.0, + "matched_length": 9, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/clfs.sys.mui.package-expected.json b/tests/packagedcode/data/win_pe/clfs.sys.mui.package-expected.json index 7dcc66f099..d52d991e01 100644 --- a/tests/packagedcode/data/win_pe/clfs.sys.mui.package-expected.json +++ b/tests/packagedcode/data/win_pe/clfs.sys.mui.package-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 88.89, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 8, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 90.0, + "matched_length": 9, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/crypt32.dll.mun.package-expected.json b/tests/packagedcode/data/win_pe/crypt32.dll.mun.package-expected.json index e1e169d2a6..d8913cfd43 100644 --- a/tests/packagedcode/data/win_pe/crypt32.dll.mun.package-expected.json +++ b/tests/packagedcode/data/win_pe/crypt32.dll.mun.package-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 88.89, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 8, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 90.0, + "matched_length": 9, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/euc-jp.so.package-expected.json b/tests/packagedcode/data/win_pe/euc-jp.so.package-expected.json index ae66ab3e67..2550c96904 100644 --- a/tests/packagedcode/data/win_pe/euc-jp.so.package-expected.json +++ b/tests/packagedcode/data/win_pe/euc-jp.so.package-expected.json @@ -31,22 +31,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 75.0, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 3, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ad65678ddd5bed50985f1d896d812061269049b0", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 83.33, + "matched_length": 5, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ad65678ddd5bed50985f1d896d812061269049b0", - "matched_text": "license LegalCopyright:\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-679f097d28658555700ef170738adb0fd7151fce", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-679f097d28658555700ef170738adb0fd7151fce", + "matched_text": "license {'LegalCopyright': None, 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-d5e156bc-5560-c52a-28b9-d79ccb4407b2" + "identifier": "unknown-3a74427e-26a2-7b3f-eb84-9b610c013417" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/stdole2.tlb.package-expected.json b/tests/packagedcode/data/win_pe/stdole2.tlb.package-expected.json index 45b9362271..086cad02bc 100644 --- a/tests/packagedcode/data/win_pe/stdole2.tlb.package-expected.json +++ b/tests/packagedcode/data/win_pe/stdole2.tlb.package-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 88.89, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 8, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 90.0, + "matched_length": 9, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/data/win_pe/tbs.sys.package-expected.json b/tests/packagedcode/data/win_pe/tbs.sys.package-expected.json index bc5f21b152..101dca6341 100644 --- a/tests/packagedcode/data/win_pe/tbs.sys.package-expected.json +++ b/tests/packagedcode/data/win_pe/tbs.sys.package-expected.json @@ -39,22 +39,22 @@ "license_expression_spdx": "LicenseRef-scancode-unknown", "matches": [ { - "score": 88.89, - "start_line": 1, - "end_line": 3, - "from_file": null, - "matched_length": 8, - "match_coverage": 100.0, - "matcher": "5-undetected", "license_expression": "unknown", "spdx_license_expression": "LicenseRef-scancode-unknown", - "rule_identifier": "package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", + "from_file": null, + "start_line": 1, + "end_line": 1, + "matcher": "5-undetected", + "score": 90.0, + "matched_length": 9, + "match_coverage": 100.0, "rule_relevance": 100, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-ac5b72bda2754025edd093f0f8161168689d3065", - "matched_text": "license LegalCopyright: \u00a9 Microsoft Corporation. All rights reserved.\nLegalTrademarks:\nLicense:" + "rule_identifier": "package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-33f1f14c9c3aed427a1ebff42fd03640ebc75225", + "matched_text": "license {'LegalCopyright': '\u00a9 Microsoft Corporation. All rights reserved.', 'LegalTrademarks': '', 'License': None}" } ], - "identifier": "unknown-11be580c-3254-29b5-4813-8b152eefbe71" + "identifier": "unknown-7a4e31a4-3c62-cfda-29ff-b00424060fd7" } ], "other_license_expression": null, diff --git a/tests/packagedcode/test_cargo.py b/tests/packagedcode/test_cargo.py index 1184421262..5c25f13502 100644 --- a/tests/packagedcode/test_cargo.py +++ b/tests/packagedcode/test_cargo.py @@ -65,6 +65,18 @@ def test_parse_cargo_toml_rustup(self): packages_data = cargo.CargoTomlHandler.parse(test_file) self.check_packages_data(packages_data, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_parse_cargo_toml_tauri_workspace(self): + test_file = self.get_test_loc('cargo/cargo_toml/tauri/Cargo.toml') + expected_loc = self.get_test_loc('cargo/cargo_toml/tauri/Cargo.toml.expected') + packages_data = cargo.CargoTomlHandler.parse(test_file) + self.check_packages_data(packages_data, expected_loc, regen=REGEN_TEST_FIXTURES) + + def test_parse_cargo_toml_tauri_workspace_in_version(self): + test_file = self.get_test_loc('cargo/cargo_toml/tauri-examples/Cargo.toml') + expected_loc = self.get_test_loc('cargo/cargo_toml/tauri-examples/Cargo.toml.expected') + packages_data = cargo.CargoTomlHandler.parse(test_file) + self.check_packages_data(packages_data, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_parse_cargo_lock_sample1(self): test_file = self.get_test_loc('cargo/cargo_lock/sample1/Cargo.lock') expected_loc = self.get_test_loc('cargo/cargo_lock/sample1/output.expected.json') @@ -104,6 +116,15 @@ def test_scan_cli_works(self): expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES ) + def test_scan_works_on_cargo_workspace(self): + test_file = self.get_test_loc('cargo/cargo-with-workspace') + expected_file = self.get_test_loc('cargo/cargo-with-workspace.expected.json', must_exist=False) + result_file = self.get_temp_file('results.json') + run_scan_click(['--package', '--license', test_file, '--json', result_file]) + check_json_scan( + expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES + ) + PERSON_PARSER_TEST_TABLE = [ ('Barney Rubble ', ('Barney Rubble ', '')), diff --git a/tests/summarycode/data/score/no_license_ambiguity-expected.json b/tests/summarycode/data/score/no_license_ambiguity-expected.json index 478adb3be9..7ed3276d13 100644 --- a/tests/summarycode/data/score/no_license_ambiguity-expected.json +++ b/tests/summarycode/data/score/no_license_ambiguity-expected.json @@ -83,7 +83,16 @@ "extracted_license_statement": "MIT OR Apache-2.0", "notice_text": null, "source_packages": [], - "extra_data": {}, + "extra_data": { + "workspace": { + "members": [ + "rand_core", + "rand_distr", + "rand_chacha", + "rand_pcg" + ] + } + }, "repository_homepage_url": "https://crates.io/crates/rand", "repository_download_url": "https://crates.io/api/v1/crates/rand/0.8.5/download", "api_data_url": "https://crates.io/api/v1/crates/rand", @@ -520,7 +529,16 @@ "notice_text": null, "source_packages": [], "file_references": [], - "extra_data": {}, + "extra_data": { + "workspace": { + "members": [ + "rand_core", + "rand_distr", + "rand_chacha", + "rand_pcg" + ] + } + }, "dependencies": [], "repository_homepage_url": "https://crates.io/crates/rand", "repository_download_url": "https://crates.io/api/v1/crates/rand/0.8.5/download",