diff --git a/src/packagedcode/swift.py b/src/packagedcode/swift.py index 2cf04915eb5..10b2493adef 100644 --- a/src/packagedcode/swift.py +++ b/src/packagedcode/swift.py @@ -19,8 +19,9 @@ Handle the resolved file and JSON dump of the manifest for Swift packages. https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html -Run the command below before running the scan: +Run the commands below before running the scan: ``swift package dump-package > Package.swift.json`` +``swift package resolve`` """ diff --git a/tests/packagedcode/data/swift/packages/mapboxmaps_manifest/Package.swift.json b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest/Package.swift.json new file mode 100644 index 00000000000..b52452c1fbf --- /dev/null +++ b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest/Package.swift.json @@ -0,0 +1,323 @@ +{ + "cLanguageStandard" : null, + "cxxLanguageStandard" : null, + "dependencies" : [ + { + "sourceControl" : [ + { + "identity" : "turf-swift", + "location" : { + "remote" : [ + { + "urlString" : "https://github.com/mapbox/turf-swift.git" + } + ] + }, + "productFilter" : null, + "requirement" : { + "range" : [ + { + "lowerBound" : "2.8.0", + "upperBound" : "3.0.0" + } + ] + } + } + ] + }, + { + "sourceControl" : [ + { + "identity" : "mapbox-core-maps-ios", + "location" : { + "remote" : [ + { + "urlString" : "https://github.com/mapbox/mapbox-core-maps-ios.git" + } + ] + }, + "productFilter" : null, + "requirement" : { + "exact" : [ + "11.4.0-rc.2" + ] + } + } + ] + }, + { + "sourceControl" : [ + { + "identity" : "mapbox-common-ios", + "location" : { + "remote" : [ + { + "urlString" : "https://github.com/mapbox/mapbox-common-ios.git" + } + ] + }, + "productFilter" : null, + "requirement" : { + "exact" : [ + "24.4.0-rc.2" + ] + } + } + ] + } + ], + "name" : "MapboxMaps", + "packageKind" : { + "root" : [ + "/workspace" + ] + }, + "pkgConfig" : null, + "platforms" : [ + { + "options" : [ + + ], + "platformName" : "ios", + "version" : "12.0" + }, + { + "options" : [ + + ], + "platformName" : "macos", + "version" : "10.15" + }, + { + "options" : [ + + ], + "platformName" : "visionos", + "version" : "1.0" + } + ], + "products" : [ + { + "name" : "MapboxMaps", + "targets" : [ + "MapboxMaps" + ], + "type" : { + "library" : [ + "automatic" + ] + } + } + ], + "providers" : null, + "swiftLanguageVersions" : null, + "targets" : [ + { + "dependencies" : [ + { + "product" : [ + "MapboxCoreMaps", + "mapbox-core-maps-ios", + null, + null + ] + }, + { + "product" : [ + "MapboxCommon", + "mapbox-common-ios", + null, + null + ] + }, + { + "product" : [ + "Turf", + "turf-swift", + null, + null + ] + } + ], + "exclude" : [ + "Info.plist" + ], + "name" : "MapboxMaps", + "packageAccess" : true, + "resources" : [ + { + "path" : "MapboxMaps.json", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "PrivacyInfo.xcprivacy", + "rule" : { + "copy" : { + + } + } + } + ], + "settings" : [ + + ], + "type" : "regular" + }, + { + "dependencies" : [ + { + "byName" : [ + "MapboxMaps", + null + ] + } + ], + "exclude" : [ + + ], + "name" : "MapboxMapsTests", + "packageAccess" : true, + "resources" : [ + { + "path" : "MigrationGuide/Fixtures/polygon.geojson", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Helpers/MapboxAccessToken", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Resources/empty-style-chicago.json", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testDoesNotShowAttribution().png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testDoesNotShowLogo().png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testDoesNotShowLogoAndAttribution().png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testShowsLogoAndAttribution().png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-100.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-150.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-200.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-250.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-300.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-50.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotLogoVisibility.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotOverlay.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Resources/MapInitOptionsTests.xib", + "rule" : { + "process" : { + + } + } + } + ], + "settings" : [ + + ], + "type" : "test" + } + ], + "toolsVersion" : { + "_version" : "5.9.0" + } +} diff --git a/tests/packagedcode/data/swift/packages/mapboxmaps_manifest/src/mapbox.swift b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest/src/mapbox.swift new file mode 100644 index 00000000000..9cfc54157c9 --- /dev/null +++ b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest/src/mapbox.swift @@ -0,0 +1 @@ +// Test file for swift package. \ No newline at end of file diff --git a/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/Package.resolved b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/Package.resolved new file mode 100644 index 00000000000..91a82660725 --- /dev/null +++ b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/Package.resolved @@ -0,0 +1,32 @@ +{ + "pins" : [ + { + "identity" : "mapbox-common-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-common-ios.git", + "state" : { + "revision" : "9c04997ed32c5b2506eb704f9f7a16367b5dcc64", + "version" : "24.4.0" + } + }, + { + "identity" : "mapbox-core-maps-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-core-maps-ios.git", + "state" : { + "revision" : "c7897628028afb2c008d50c5d5d4054768c99340", + "version" : "11.4.0" + } + }, + { + "identity" : "turf-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/turf-swift.git", + "state" : { + "revision" : "213050191cfcb3d5aa76e1fa90c6ff1e182a42ca", + "version" : "2.8.0" + } + } + ], + "version" : 2 +} diff --git a/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/Package.swift.json b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/Package.swift.json new file mode 100644 index 00000000000..b52452c1fbf --- /dev/null +++ b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/Package.swift.json @@ -0,0 +1,323 @@ +{ + "cLanguageStandard" : null, + "cxxLanguageStandard" : null, + "dependencies" : [ + { + "sourceControl" : [ + { + "identity" : "turf-swift", + "location" : { + "remote" : [ + { + "urlString" : "https://github.com/mapbox/turf-swift.git" + } + ] + }, + "productFilter" : null, + "requirement" : { + "range" : [ + { + "lowerBound" : "2.8.0", + "upperBound" : "3.0.0" + } + ] + } + } + ] + }, + { + "sourceControl" : [ + { + "identity" : "mapbox-core-maps-ios", + "location" : { + "remote" : [ + { + "urlString" : "https://github.com/mapbox/mapbox-core-maps-ios.git" + } + ] + }, + "productFilter" : null, + "requirement" : { + "exact" : [ + "11.4.0-rc.2" + ] + } + } + ] + }, + { + "sourceControl" : [ + { + "identity" : "mapbox-common-ios", + "location" : { + "remote" : [ + { + "urlString" : "https://github.com/mapbox/mapbox-common-ios.git" + } + ] + }, + "productFilter" : null, + "requirement" : { + "exact" : [ + "24.4.0-rc.2" + ] + } + } + ] + } + ], + "name" : "MapboxMaps", + "packageKind" : { + "root" : [ + "/workspace" + ] + }, + "pkgConfig" : null, + "platforms" : [ + { + "options" : [ + + ], + "platformName" : "ios", + "version" : "12.0" + }, + { + "options" : [ + + ], + "platformName" : "macos", + "version" : "10.15" + }, + { + "options" : [ + + ], + "platformName" : "visionos", + "version" : "1.0" + } + ], + "products" : [ + { + "name" : "MapboxMaps", + "targets" : [ + "MapboxMaps" + ], + "type" : { + "library" : [ + "automatic" + ] + } + } + ], + "providers" : null, + "swiftLanguageVersions" : null, + "targets" : [ + { + "dependencies" : [ + { + "product" : [ + "MapboxCoreMaps", + "mapbox-core-maps-ios", + null, + null + ] + }, + { + "product" : [ + "MapboxCommon", + "mapbox-common-ios", + null, + null + ] + }, + { + "product" : [ + "Turf", + "turf-swift", + null, + null + ] + } + ], + "exclude" : [ + "Info.plist" + ], + "name" : "MapboxMaps", + "packageAccess" : true, + "resources" : [ + { + "path" : "MapboxMaps.json", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "PrivacyInfo.xcprivacy", + "rule" : { + "copy" : { + + } + } + } + ], + "settings" : [ + + ], + "type" : "regular" + }, + { + "dependencies" : [ + { + "byName" : [ + "MapboxMaps", + null + ] + } + ], + "exclude" : [ + + ], + "name" : "MapboxMapsTests", + "packageAccess" : true, + "resources" : [ + { + "path" : "MigrationGuide/Fixtures/polygon.geojson", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Helpers/MapboxAccessToken", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Resources/empty-style-chicago.json", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testDoesNotShowAttribution().png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testDoesNotShowLogo().png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testDoesNotShowLogoAndAttribution().png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testShowsLogoAndAttribution().png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-100.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-150.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-200.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-250.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-300.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotAttribution-50.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotLogoVisibility.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Snapshot/testSnapshotOverlay.png", + "rule" : { + "copy" : { + + } + } + }, + { + "path" : "Resources/MapInitOptionsTests.xib", + "rule" : { + "process" : { + + } + } + } + ], + "settings" : [ + + ], + "type" : "test" + } + ], + "toolsVersion" : { + "_version" : "5.9.0" + } +} diff --git a/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/src/mapbox.swift b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/src/mapbox.swift new file mode 100644 index 00000000000..9cfc54157c9 --- /dev/null +++ b/tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/src/mapbox.swift @@ -0,0 +1 @@ +// Test file for swift package. \ No newline at end of file diff --git a/tests/packagedcode/data/swift/packages/mapboxmaps_resolved/Package.resolved b/tests/packagedcode/data/swift/packages/mapboxmaps_resolved/Package.resolved new file mode 100644 index 00000000000..91a82660725 --- /dev/null +++ b/tests/packagedcode/data/swift/packages/mapboxmaps_resolved/Package.resolved @@ -0,0 +1,32 @@ +{ + "pins" : [ + { + "identity" : "mapbox-common-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-common-ios.git", + "state" : { + "revision" : "9c04997ed32c5b2506eb704f9f7a16367b5dcc64", + "version" : "24.4.0" + } + }, + { + "identity" : "mapbox-core-maps-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-core-maps-ios.git", + "state" : { + "revision" : "c7897628028afb2c008d50c5d5d4054768c99340", + "version" : "11.4.0" + } + }, + { + "identity" : "turf-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/turf-swift.git", + "state" : { + "revision" : "213050191cfcb3d5aa76e1fa90c6ff1e182a42ca", + "version" : "2.8.0" + } + } + ], + "version" : 2 +} diff --git a/tests/packagedcode/data/swift/packages/mapboxmaps_resolved/src/mapbox.swift b/tests/packagedcode/data/swift/packages/mapboxmaps_resolved/src/mapbox.swift new file mode 100644 index 00000000000..9cfc54157c9 --- /dev/null +++ b/tests/packagedcode/data/swift/packages/mapboxmaps_resolved/src/mapbox.swift @@ -0,0 +1 @@ +// Test file for swift package. \ No newline at end of file diff --git a/tests/packagedcode/data/swift/swift-maboxmaps-manifest-parse-expected.json b/tests/packagedcode/data/swift/swift-maboxmaps-manifest-parse-expected.json new file mode 100644 index 00000000000..2ebf4cd1243 --- /dev/null +++ b/tests/packagedcode/data/swift/swift-maboxmaps-manifest-parse-expected.json @@ -0,0 +1,75 @@ +[ + { + "type": "swift", + "namespace": null, + "name": "MapboxMaps", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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:swift/github.com%252Fmapbox%252Fturf-swift", + "extracted_requirement": "vers:swift/>=2.8.0|<3.0.0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0-rc.2", + "extracted_requirement": "11.4.0-rc.2", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0-rc.2", + "extracted_requirement": "24.4.0-rc.2", + "scope": "install", + "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": "swift_package_manifest_json", + "purl": "pkg:swift/MapboxMaps" + } +] \ No newline at end of file diff --git a/tests/packagedcode/data/swift/swift-maboxmaps-resolved-parse-expected.json b/tests/packagedcode/data/swift/swift-maboxmaps-resolved-parse-expected.json new file mode 100644 index 00000000000..e6837705999 --- /dev/null +++ b/tests/packagedcode/data/swift/swift-maboxmaps-resolved-parse-expected.json @@ -0,0 +1,128 @@ +[ + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fmapbox-common-ios", + "version": "24.4.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0" + }, + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fmapbox-core-maps-ios", + "version": "11.4.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0" + }, + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fturf-swift", + "version": "2.8.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fturf-swift@2.8.0" + } +] \ No newline at end of file diff --git a/tests/packagedcode/data/swift/swift-mapboxmaps-manifest-and-resolved-package-expected.json b/tests/packagedcode/data/swift/swift-mapboxmaps-manifest-and-resolved-package-expected.json new file mode 100644 index 00000000000..3f9b5d67d33 --- /dev/null +++ b/tests/packagedcode/data/swift/swift-mapboxmaps-manifest-and-resolved-package-expected.json @@ -0,0 +1,335 @@ +{ + "packages": [ + { + "type": "swift", + "namespace": null, + "name": "MapboxMaps", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "extra_data": {}, + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "package_uid": "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "Package.swift.json", + "Package.resolved" + ], + "datasource_ids": [ + "swift_package_manifest_json", + "swift_package_resolved" + ], + "purl": "pkg:swift/MapboxMaps" + } + ], + "dependencies": [ + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0", + "extracted_requirement": "24.4.0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "Package.swift.json", + "datasource_id": "swift_package_manifest_json" + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0", + "extracted_requirement": "11.4.0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "Package.swift.json", + "datasource_id": "swift_package_manifest_json" + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fturf-swift@2.8.0", + "extracted_requirement": "2.8.0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:swift/github.com%252Fmapbox%252Fturf-swift@2.8.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "Package.swift.json", + "datasource_id": "swift_package_manifest_json" + } + ], + "files": [ + { + "path": "Package.resolved", + "type": "file", + "package_data": [ + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fmapbox-common-ios", + "version": "24.4.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0" + }, + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fmapbox-core-maps-ios", + "version": "11.4.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0" + }, + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fturf-swift", + "version": "2.8.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fturf-swift@2.8.0" + } + ], + "for_packages": [ + "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "scan_errors": [] + }, + { + "path": "Package.swift.json", + "type": "file", + "package_data": [ + { + "type": "swift", + "namespace": null, + "name": "MapboxMaps", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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:swift/github.com%252Fmapbox%252Fturf-swift", + "extracted_requirement": "vers:swift/>=2.8.0|<3.0.0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0-rc.2", + "extracted_requirement": "11.4.0-rc.2", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0-rc.2", + "extracted_requirement": "24.4.0-rc.2", + "scope": "install", + "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": "swift_package_manifest_json", + "purl": "pkg:swift/MapboxMaps" + } + ], + "for_packages": [ + "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "scan_errors": [] + }, + { + "path": "src", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "scan_errors": [] + }, + { + "path": "src/mapbox.swift", + "type": "file", + "package_data": [], + "for_packages": [ + "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/swift/swift-mapboxmaps-manifest-package-expected.json b/tests/packagedcode/data/swift/swift-mapboxmaps-manifest-package-expected.json new file mode 100644 index 00000000000..a222719a3c7 --- /dev/null +++ b/tests/packagedcode/data/swift/swift-mapboxmaps-manifest-package-expected.json @@ -0,0 +1,197 @@ +{ + "packages": [ + { + "type": "swift", + "namespace": null, + "name": "MapboxMaps", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "extra_data": {}, + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "package_uid": "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "Package.swift.json" + ], + "datasource_ids": [ + "swift_package_manifest_json" + ], + "purl": "pkg:swift/MapboxMaps" + } + ], + "dependencies": [ + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fturf-swift", + "extracted_requirement": "vers:swift/>=2.8.0|<3.0.0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:swift/github.com%252Fmapbox%252Fturf-swift?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "Package.swift.json", + "datasource_id": "swift_package_manifest_json" + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0-rc.2", + "extracted_requirement": "11.4.0-rc.2", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0-rc.2?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "Package.swift.json", + "datasource_id": "swift_package_manifest_json" + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0-rc.2", + "extracted_requirement": "24.4.0-rc.2", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0-rc.2?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "Package.swift.json", + "datasource_id": "swift_package_manifest_json" + } + ], + "files": [ + { + "path": "Package.swift.json", + "type": "file", + "package_data": [ + { + "type": "swift", + "namespace": null, + "name": "MapboxMaps", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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:swift/github.com%252Fmapbox%252Fturf-swift", + "extracted_requirement": "vers:swift/>=2.8.0|<3.0.0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0-rc.2", + "extracted_requirement": "11.4.0-rc.2", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0-rc.2", + "extracted_requirement": "24.4.0-rc.2", + "scope": "install", + "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": "swift_package_manifest_json", + "purl": "pkg:swift/MapboxMaps" + } + ], + "for_packages": [ + "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "scan_errors": [] + }, + { + "path": "src", + "type": "directory", + "package_data": [], + "for_packages": [ + "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "scan_errors": [] + }, + { + "path": "src/mapbox.swift", + "type": "file", + "package_data": [], + "for_packages": [ + "pkg:swift/MapboxMaps?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/swift/swift-mapboxmaps-resolved-package-expected.json b/tests/packagedcode/data/swift/swift-mapboxmaps-resolved-package-expected.json new file mode 100644 index 00000000000..bf851a0a30d --- /dev/null +++ b/tests/packagedcode/data/swift/swift-mapboxmaps-resolved-package-expected.json @@ -0,0 +1,297 @@ +{ + "packages": [ + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fmapbox-common-ios", + "version": "24.4.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "extra_data": {}, + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "package_uid": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "Package.resolved" + ], + "datasource_ids": [ + "swift_package_resolved" + ], + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0" + }, + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fmapbox-core-maps-ios", + "version": "11.4.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "extra_data": {}, + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "package_uid": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "Package.resolved" + ], + "datasource_ids": [ + "swift_package_resolved" + ], + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0" + }, + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fturf-swift", + "version": "2.8.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "extra_data": {}, + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "package_uid": "pkg:swift/github.com%252Fmapbox%252Fturf-swift@2.8.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "Package.resolved" + ], + "datasource_ids": [ + "swift_package_resolved" + ], + "purl": "pkg:swift/github.com%252Fmapbox%252Fturf-swift@2.8.0" + } + ], + "dependencies": [], + "files": [ + { + "path": "Package.resolved", + "type": "file", + "package_data": [ + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fmapbox-common-ios", + "version": "24.4.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0" + }, + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fmapbox-core-maps-ios", + "version": "11.4.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0" + }, + { + "type": "swift", + "namespace": null, + "name": "github.com%2Fmapbox%2Fturf-swift", + "version": "2.8.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "swift", + "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": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "swift_package_resolved", + "purl": "pkg:swift/github.com%252Fmapbox%252Fturf-swift@2.8.0" + } + ], + "for_packages": [ + "pkg:swift/github.com%252Fmapbox%252Fmapbox-common-ios@24.4.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "pkg:swift/github.com%252Fmapbox%252Fmapbox-core-maps-ios@11.4.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "pkg:swift/github.com%252Fmapbox%252Fturf-swift@2.8.0?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "scan_errors": [] + }, + { + "path": "src", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/mapbox.swift", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/test_swift.py b/tests/packagedcode/test_swift.py new file mode 100644 index 00000000000..1089fc23eff --- /dev/null +++ b/tests/packagedcode/test_swift.py @@ -0,0 +1,103 @@ +# +# Copyright (c) nexB Inc. and others. All rights reserved. +# ScanCode is a trademark of nexB Inc. +# SPDX-License-Identifier: Apache-2.0 +# See http://www.apache.org/licenses/LICENSE-2.0 for the license text. +# See https://github.com/nexB/scancode-toolkit for support or download. +# See https://aboutcode.org for more information about nexB OSS projects. +# + +import os.path + +from packagedcode import swift +from packages_test_utils import PackageTester +from scancode.cli_test_utils import check_json_scan +from scancode.cli_test_utils import run_scan_click +from scancode_config import REGEN_TEST_FIXTURES + + +class TestSwiftHandler(PackageTester): + test_data_dir = os.path.join(os.path.dirname(__file__), "data/swift") + + def test_parse_for_mapboxmaps_manifest(self): + test_file = self.get_test_loc( + "packages/mapboxmaps_manifest_and_resolved/Package.swift.json" + ) + expected_loc = self.get_test_loc("swift-maboxmaps-manifest-parse-expected.json") + packages = swift.SwiftManifestJsonHandler.parse(test_file) + self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES) + + def test_parse_for_mapboxmaps_resolved(self): + test_file = self.get_test_loc( + "packages/mapboxmaps_manifest_and_resolved/Package.resolved" + ) + expected_loc = self.get_test_loc("swift-maboxmaps-resolved-parse-expected.json") + packages = swift.SwiftPackageResolvedHandler.parse(test_file) + self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES) + + +class TestSwiftEndtoEnd(PackageTester): + test_data_dir = os.path.join(os.path.dirname(__file__), "data/swift") + + def test_package_scan_conan_end_to_end_full_mapboxmaps_manifest_only(self): + test_dir = self.get_test_loc("packages/mapboxmaps_manifest") + result_file = self.get_temp_file("json") + expected_file = self.get_test_loc( + "swift-mapboxmaps-manifest-package-expected.json" + ) + run_scan_click( + [ + "--package", + "--strip-root", + "--processes", + "-1", + test_dir, + "--json", + result_file, + ] + ) + check_json_scan( + expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES + ) + + def test_package_scan_conan_end_to_end_full_mapboxmaps_manifest_and_resolved(self): + test_dir = self.get_test_loc("packages/mapboxmaps_manifest_and_resolved") + result_file = self.get_temp_file("json") + expected_file = self.get_test_loc( + "swift-mapboxmaps-manifest-and-resolved-package-expected.json" + ) + run_scan_click( + [ + "--package", + "--strip-root", + "--processes", + "-1", + test_dir, + "--json", + result_file, + ] + ) + check_json_scan( + expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES + ) + + def test_package_scan_conan_end_to_end_full_mapboxmaps_resolved_only(self): + test_dir = self.get_test_loc("packages/mapboxmaps_resolved") + result_file = self.get_temp_file("json") + expected_file = self.get_test_loc( + "swift-mapboxmaps-resolved-package-expected.json" + ) + run_scan_click( + [ + "--package", + "--strip-root", + "--processes", + "-1", + test_dir, + "--json", + result_file, + ] + ) + check_json_scan( + expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES + )