add cargo-generate template for plugin example
This commit is contained in:
parent
2228f584a1
commit
d7601a4352
Binary file not shown.
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
authors = ["{{authors}}"]
|
||||
name = "{{project-name}}"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
pyo3 = "{{PYO3_VERSION}}"
|
||||
plugin_api = { path = "plugin_api" }
|
|
@ -0,0 +1,17 @@
|
|||
[package]
|
||||
name = "plugin_api"
|
||||
version = "0.1.0"
|
||||
description = "Plugin API example"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "plugin_api"
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
#!!! Important - DO NOT ENABLE extension-module FEATURE HERE!!!
|
||||
pyo3 = "{{PYO3_VERSION}}"
|
||||
|
||||
[features]
|
||||
# instead extension-module feature for pyo3 is enabled conditionally when we want to build a standalone extension module to test our plugins without "main" program
|
||||
extension-module = ["pyo3/extension-module"]
|
|
@ -0,0 +1,4 @@
|
|||
variable::set("PYO3_VERSION", "0.18.0");
|
||||
file::rename(".template/Cargo.toml", "Cargo.toml");
|
||||
file::rename(".template/plugin_api/Cargo.toml", "plugin_api/Cargo.toml");
|
||||
file::delete(".template");
|
|
@ -0,0 +1,5 @@
|
|||
[template]
|
||||
ignore = [".nox"]
|
||||
|
||||
[hooks]
|
||||
pre = [".template/pre-script.rhai"]
|
Loading…
Reference in New Issue