-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Conan deployer to collect licenses
- Loading branch information
Showing
4 changed files
with
32 additions
and
7 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
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
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,24 @@ | ||
# Conan deployer that gathers licenses into the output_folder. | ||
# Execute "conan install . --output-folder=.conan-install --deployer=licenses --build=missing" | ||
# or use "./build.py conan-install" | ||
|
||
from conan.tools.files import load, copy | ||
from pathlib import Path | ||
import logging | ||
|
||
|
||
def deploy(graph, output_folder, **kwargs): | ||
licenses_dir = Path(output_folder) / "licenses" | ||
for _, dep in graph.root.conanfile.dependencies.items(): | ||
src = Path(dep.package_folder) / "licenses" | ||
dst = licenses_dir / str(dep) | ||
dst.mkdir(exist_ok=True, parents=True) | ||
logging.info(f"Copy '{src}/*' to '{dst}'") | ||
copy(graph.root.conanfile, "*", src, dst) | ||
|
||
root_dir = Path(graph.root.path).parent | ||
version = load(graph.root.conanfile, root_dir / "version").strip() | ||
ocls_output = licenses_dir / "opencl-language-server" / version | ||
ocls_output.mkdir(exist_ok=True, parents=True) | ||
logging.info(f"Copy '{root_dir}/LICENSE' to '{ocls_output}'") | ||
copy(graph.root.conanfile, "LICENSE", root_dir, ocls_output) |