-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle edge cases and version constraints when processing conan.lock …
…files. Add docs and verification test sample files.
- Loading branch information
1 parent
fe11926
commit bb789ba
Showing
7 changed files
with
175 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Conan Detection | ||
## Requirements | ||
Conan detection relies on a conan.lock file being present. | ||
|
||
## Detection strategy | ||
Conan detection is performed by parsing every <em>conan.lock</em> found under the scan directory. | ||
|
||
## Known limitations | ||
Conan detection will not work if lock files are not being used or not yet generated. So ensure to run the conan build to generate the lock file(s) before running the scan. | ||
|
||
Full dependency graph generation is not supported. However, dependency relationships identified/present in the <em>conan.lock</em> file is captured. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
...Microsoft.ComponentDetection.VerificationTests/resources/conan/conanPythonFile/conan.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"graph_lock": { | ||
"nodes": { | ||
"0": { | ||
"ref": "MyAwesomeConanProject/1.2.5", | ||
"options": "", | ||
"requires": [ | ||
"1" | ||
], | ||
"build_requires": [ | ||
"6" | ||
], | ||
"path": "conanfile.py", | ||
"context": "host" | ||
}, | ||
"1": { | ||
"ref": "boost/1.82.0", | ||
"options": "", | ||
"package_id": "dd7f5f958c7381cfd81e611a16062de0c827160a", | ||
"prev": "0", | ||
"modified": true, | ||
"requires": [ | ||
"2", | ||
"3", | ||
"4" | ||
], | ||
"build_requires": [ | ||
"5" | ||
], | ||
"context": "host" | ||
}, | ||
"2": { | ||
"ref": "zlib/1.2.13", | ||
"options": "", | ||
"package_id": "240c2182163325b213ca6886a7614c8ed2bf1738", | ||
"prev": "0", | ||
"modified": true, | ||
"context": "host" | ||
}, | ||
"3": { | ||
"ref": "bzip2/1.0.8", | ||
"options": "", | ||
"package_id": "238a93dc813ca1550968399f1f8925565feeff8e", | ||
"prev": "0", | ||
"modified": true, | ||
"context": "host" | ||
}, | ||
"4": { | ||
"ref": "libbacktrace/cci.20210118", | ||
"options": "", | ||
"package_id": "240c2182163325b213ca6886a7614c8ed2bf1738", | ||
"prev": "0", | ||
"modified": true, | ||
"context": "host" | ||
}, | ||
"5": { | ||
"ref": "b2/4.9.6", | ||
"options": "", | ||
"package_id": "a5ad5696abf650a25eea8f377806b3d5fe234e6e", | ||
"prev": "0", | ||
"modified": true, | ||
"context": "host" | ||
}, | ||
"6": { | ||
"ref": "gtest/1.8.1", | ||
"options": "", | ||
"package_id": "fb16a498e820fb09d04ff9374a782b5b21da0601", | ||
"prev": "0", | ||
"modified": true, | ||
"context": "host" | ||
} | ||
}, | ||
"revisions_enabled": false | ||
}, | ||
"version": "0.4", | ||
"profile_host": "\n" | ||
} |
11 changes: 11 additions & 0 deletions
11
...crosoft.ComponentDetection.VerificationTests/resources/conan/conanPythonFile/conanfile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from conans import ConanFile | ||
|
||
class MyAwesome(ConanFile): | ||
name = "MyAwesomeConanProject" | ||
version = "1.2.5" | ||
|
||
def requirements(self): | ||
self.requires("boost/1.82.0") | ||
|
||
def build_requirements(self): | ||
self.tool_requires("gtest/1.8.1") |
60 changes: 60 additions & 0 deletions
60
test/Microsoft.ComponentDetection.VerificationTests/resources/conan/conanTextFile/conan.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"graph_lock": { | ||
"nodes": { | ||
"0": { | ||
"options": "", | ||
"requires": [ | ||
"1" | ||
], | ||
"build_requires": [ | ||
"5" | ||
], | ||
"path": "conanfile.txt", | ||
"context": "host" | ||
}, | ||
"1": { | ||
"ref": "boost/1.82.0", | ||
"options": "", | ||
"package_id": "dd7f5f958c7381cfd81e611a16062de0c827160a", | ||
"prev": "0", | ||
"requires": [ | ||
"2", | ||
"3", | ||
"4" | ||
], | ||
"context": "host" | ||
}, | ||
"2": { | ||
"ref": "zlib/1.2.13", | ||
"options": "", | ||
"package_id": "240c2182163325b213ca6886a7614c8ed2bf1738", | ||
"prev": "0", | ||
"context": "host" | ||
}, | ||
"3": { | ||
"ref": "bzip2/1.0.8", | ||
"options": "", | ||
"package_id": "238a93dc813ca1550968399f1f8925565feeff8e", | ||
"prev": "0", | ||
"context": "host" | ||
}, | ||
"4": { | ||
"ref": "libbacktrace/cci.20210118", | ||
"options": "", | ||
"package_id": "240c2182163325b213ca6886a7614c8ed2bf1738", | ||
"prev": "0", | ||
"context": "host" | ||
}, | ||
"5": { | ||
"ref": "gtest/1.8.1", | ||
"options": "", | ||
"package_id": "fb16a498e820fb09d04ff9374a782b5b21da0601", | ||
"prev": "0", | ||
"context": "host" | ||
} | ||
}, | ||
"revisions_enabled": false | ||
}, | ||
"version": "0.4", | ||
"profile_host": "\n" | ||
} |
5 changes: 5 additions & 0 deletions
5
...icrosoft.ComponentDetection.VerificationTests/resources/conan/conanTextFile/conanfile.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[requires] | ||
boost/1.82.0 | ||
|
||
[tool_requires] | ||
gtest/1.8.1 |