bullet is a project boilerplate generator
|OS|Problem|Solve|
|--|--|--|
|centos|Could not find directory of OpenSSL|yum install openssl-devel|
|ubuntu|linker cc
not found|sudo apt-get install build-essential|
|ubuntu|Could not find directory of OpenSSL|sudo apt install libssl-dev & sudo apt instll pkg-config|
cargo bullet --config=\ when we develop a project, we always write many boilerplate code, config and etc.
so to save your life time.
1. create a project template.
2. config the project with yaml or json or toml.
3. generate the project you can use context as the reference to bullet.toml properties you can use context as the reference to bullet.toml properties, ```text
group = "example"
project = "test" [ext]
content = "ext content" [resources.basicinfo]
nameinfo = {defaultname = "hello"}
typeinfo = {}
ext = {}
fields = [
{nameinfo = {defaultname = "id", camelname="id"}, typeinfo= {java="Long"}},
]
``` |property|must|type|
|----|----|----|
|group|yes|string|
|project|yes|string|
|ext|no|map\ |property|must|type|
|----|----|----|
|nameinfo|yes|name element|
|typeinfo|yes|map\ |property|must|type|
|----|----|----|
|nameinfo|yes|name element|
|typeinfo|yes|map\ |property|must|type|
|----|----|----|
|defaultname|yes|string|
|snakename|no|string|
|hyphenname|no|string|
|uppercamelname|no|string|
|lowercamel_name|no|string|config file example: build.toml
toml
group = "example"
project = "test"
[ext]
my_content = "This is my content"
project structure example: templates/structure/structure.toml
text
project_structure = [
{item_path="{{ context.group }}.{{context.project }}", item_file = "hello.txt", item_tmpl="hello.txt.tmpl", item_type="static"}
]
project template example: templates/template/hello.txt.tmpl
text
hello {{ context.project }} {{ context.ext.my_content }}
generate the project
text
cargo bullet -c build.toml -t templates -o output
idea
For Template Developer
Template Structure
text
root |-- structure/
|-- |-- structure.toml
|-- template/
|-- |-- hello.tmpl
|-- |-- world.tmpl
|-- bullet.toml
Structrue File
Static Structure
for example:
text
item_path = "{{context.project}}.hello"
Dynamic Structure
and you can use resource as the reference to bullet.toml's resource item
for example:
text
item_path = "{{context.project}}.hello" item_file = "{{resource.name_info.default_name}}"
For All User
bullet.toml example
bullet.toml root element
resource element
field element
name element
Supported Templates
Java Spring Gradle
text
cargo bullet install --name=bullet-spring-java
cargo bullet create --name=bullet-spring-java
cargo bullet build --name=bullet-spring-java --output=out
Java Spring Maven
text
cargo bullet install --name=bullet-spring-java-maven
cargo bullet create --name=bullet-spring-java-maven
cargo bullet build --name=bullet-spring-java-maven --output=out
MySQL accumulator
text
cargo bullet install --name=bullet-sql-accumulator
cargo bullet create --name=bullet-sql-accumulator
cargo bullet build --name=bullet-sql-accumulator --output=out