相当于自动运行前面的所有命令,不同的是生成的目录和文件 在 本地的缓存: ~/.conan/… ,而不是在当前文件。
现在我们知道我们已经完成了配方的所有步骤。 因此,现在将尝试运行配方并将其完全放入本地缓存中。
通常的命令是conan create
,它基本上使用test_package文件夹的conan test
执行先前的命令:
$ conan create . user/channel
即使使用此命令,如果某些操作无效,程序包创建者也可以遍历本地缓存。 这可以通过--keep-source
和--keep-build
标志来完成。
如果在跟踪中看到source()
方法已正确执行,但包创建最终失败,则可以在下次使用--keep-source
创建conan create
时跳过source()
方法:
$ conan create . user/channel --keep-source
hello/1.1@user/channel: A new conanfile.py version was exported
hello/1.1@user/channel: Folder: C:\Users\conan\.conan\data\hello\1.1\user\channel\export
hello/1.1@user/channel (test package): Installing C:\Users\conan\repos\features\package_development_flow\test_package\conanfile.py
Requirements
hello/1.1@user/channel from local
Packages
hello/1.1@user/channel:6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
hello/1.1@user/channel: WARN: Forced build from source
hello/1.1@user/channel: Building your package in C:\Users\conan\.conan\data\hello\1.1\user\channel\build\6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
hello/1.1@user/channel: Configuring sources in C:\Users\conan\.conan\data\hello\1.1\user\channel\source
Cloning into 'hello'...
remote: Counting objects: 17, done.
remote: Total 17 (delta 0), reused 0 (delta 0), pack-reused 17
Unpacking objects: 100% (17/17), done.
Switched to a new branch 'static_shared'
Branch 'static_shared' set up to track remote branch 'static_shared' from 'origin'.
hello/1.1@user/channel: Copying sources to build folder
hello/1.1@user/channel: Generator cmake created conanbuildinfo.cmake
hello/1.1@user/channel: Calling build()
...
如果您发现库的构建也正确,您也可以使用 --hold-build
标志跳过build()
步骤:
$ conan create . user/channel --keep-build