基于忍者和python的元构建系统
craftr-build的Python项目详细描述
crafter是一个基于Python 3脚本的元构建系统,它生成 Ninja生成清单。它 强制使用易于重用的模块化构建定义 并附带支持各种编程的标准库 语言和公共图书馆。
功能
- [X]旨在实现跨平台兼容(定期在 Windows、Mac OS和Linux)
- [X]将构建定义划分为版本化模块
- [X]将实际的Python函数嵌入到构建过程中(关键字 任务)
- [X]完全可复制生成的依赖项锁定文件
- []包管理器(托管在Craftr.net)
基本用法
$ craftr version # Print Craftr version and exit $ craftr export # Generate Ninja manifest $ craftr build [target [target [...]]] # Build all or the specified target(s) $ craftr clean [-r] [target [target [...]]] # Clean all or the specified target(s) $ craftr startpackage <name> [directory] # Start a new Craftr project (manifest, Craftrfile) $ craftr lock # Generate a .dependency-lock file (after craftr export)
^ {STR 1 } $c++示例强>
cxx=load('craftr.lang.cxx')program=cxx.executable(inputs=cxx.compile_cpp(sources=glob('src/**/*.cpp')),output='main')
java示例
java=load('craftr.lang.java')jar=java.jar(inputs=java.compile(src_dir=local('src')),output='myapp',entry_point='Main')
c示例
cs=load('craftr.lang.csharp')app=cs.compile(sources=glob('src/**/*.cs'),output='Main',target='exe')
cython示例
cython=load('craftr.lang.cython')primes=cython.project(sources=[local('Primes.pyx')],main=local('Main.pyx'))run=runtarget(primes.main)
如何贡献
请create an Issue如果你有 任何问题、问题或功能请求。
安装
请确保指定要安装的特定版本,因为 pypi上还没有craftr 2.x的未标记版本,并且 否则pip将安装craftr 1.x(这是完全不同的)。得到 Craftr 2的最新稳定版本,使用
$ pip install craftr-build==2.0.0
为了得到最新的开发版本,我建议安装crafter 从git存储库到virtualenv。
$ virtualenv -p python3 env && source env/bin/activate $ git clone https://github.com/craftr-build/craftr.git -b development $ cd craftr $ pip install -e .
要求
python依赖项(自动安装)
许可证
The Craftr build system Copyright (C) 2016 Niklas Rosenstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
有关详细信息,请参见LICENSE.txt文件。