mirror of
https://github.com/conan-io/conan-center-index.git
synced 2025-08-06 18:56:00 +00:00
(#20763) [docs] Add license change explanation
* Add license change entry Signed-off-by: Uilian Ries <uilianries@gmail.com> * Manage license attribute Signed-off-by: Uilian Ries <uilianries@gmail.com> * Simplify Signed-off-by: Uilian Ries <uilianries@gmail.com> --------- Signed-off-by: Uilian Ries <uilianries@gmail.com>
This commit is contained in:
@@ -57,6 +57,19 @@ The license attribute is a mandatory field which provides the legal information
|
||||
* `LicenseRef-` as a prefix, followed by the name of the library. For example:`LicenseRef-libfoo-public-domain`
|
||||
* If the library makes no mention of a license and the terms of use - it **shall not be accepted in ConanCenter** , even if the code is publicly available in GitHub or any other platforms.
|
||||
|
||||
In case the license changes in a new release, the recipe should update the license attribute accordingly:
|
||||
|
||||
```python
|
||||
class LibfooConan(ConanFile):
|
||||
license = ("MIT", "BSD-3-Clause") # keep both old and new licenses, so conan inspect can find it
|
||||
|
||||
def configure (self):
|
||||
# change the license according to the version, so conan graph info can show the correct one
|
||||
|
||||
# INFO: Version < 2.0 the license was MIT, but changed to BSD-3-Clause now.
|
||||
self.license = "BSD-3-Clause" if Version(self.version) >= "2.0.0" else "MIT"
|
||||
```
|
||||
|
||||
## Order of methods and attributes
|
||||
|
||||
Prefer the following order of documented methods in python code (`conanfile.py`, `test_package/conanfile.py`):
|
||||
|
Reference in New Issue
Block a user