Skip to content

Commit

Permalink
(#20763) [docs] Add license change explanation
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
uilianries committed Oct 26, 2023
1 parent dff4c4f commit c39277f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/adding_packages/conanfile_attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`):
Expand Down

0 comments on commit c39277f

Please sign in to comment.