Skip to content

Commit

Permalink
docs:add build instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Jun 29, 2024
1 parent 3270561 commit 5f4e189
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 32 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING_zh.md → CONTRIBUTING-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## 代码风格

请遵循我们的[代码风格指南](docs/code_style-zh.md)以保持代码的一致性。
请遵循我们的[代码风格指南](docs/code-style-zh.md)以保持代码的一致性。

## 提交更改

Expand All @@ -28,9 +28,9 @@

对于你的代码,无论是GDScript还是Rust都需要编写适当的测试来覆盖你的代码,我们使用Github Action来运行测试

[关于Rust的测试的指引](./docs/rust_test-zh.md)
[关于Rust的测试的指引](./docs/rust-test-zh.md)

我们会运行一些Godot场景来检查基本的错误,要运行的Godot场景被记录于```test_scene```中,在日常开发中,你可以通过运行```script/godot_test.py```来进行基础的测试
我们会运行一些Godot场景来检查基本的错误,要运行的Godot场景被记录于`test_scene`中,在日常开发中,你可以通过运行`script/godot_test.py`来进行基础的测试

## 版本控制

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ First, thank you for being interested in this project and willing to do some con

## Code Style

Please obey our [Code Style Guide](docs/code_style.md) to maintain code consistency
Please obey our [Code Style Guide](./docs/code-style.md) to maintain code consistency

## Commit Changes

Expand All @@ -28,9 +28,9 @@ If you want to commit changes,please obey the following steps:

For your code,you should write necessary tests to cover your code in both GDScript and Rust.We use Github Action to run the tests

[Rust Test Guide](./docs/rust_test.md)
[Rust Test Guide](./docs/rust-test.md)

We will run some Godot scenes to check basic errors.The scenes should be ran is recorded in ```test_scene```.In daily development,you can run ```script/godot_test.py```to conduct basic testing
We will run some Godot scenes to check basic errors.The scenes should be ran is recorded in `test_scene`.In daily development,you can run `script/godot_test.py`to conduct basic testing

## Version Control

Expand Down
13 changes: 2 additions & 11 deletions README_zh.md → README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,8 @@

## 构建指南

| 依赖 |
| :---------------- |
| Godot 4.3 |
| Gettext |
| Protobuf Compiler |
| Rust Compiler |

接下来,你可以运行`cd script && python build.py`来构建extension(Debug和Release)

最终,你可以启动godot编辑器来开发或导出游戏.
关于细节,请阅读[这里](./docs/build-guide-zh.md)

## 贡献

如果你想做出任何贡献,请看[CONTRIBUTING.md](./CONTRIBUTING_zh.md)
如果你想做出任何贡献,请看[CONTRIBUTING.md](./CONTRIBUTING-zh.md)
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Zenith

## [中文](./README_zh.md)
## [中文](./README-zh.md)

![Total Lines](https://tokei.rs/github/skyuoi/zenith)
|Platform|Status|
Expand All @@ -13,16 +13,7 @@ A indie fan game about undertale and terraria, developed in godot engine

## Build Guide

| dependencies |
| :---------------- |
| Godot 4.3 |
| Gettext |
| Protobuf Compiler |
| Rust Compiler |

Then you can run `cd script && python build.py` to build the extension (both Debug and Release)

Finally,you can start godot editor and develop or export the game.
For details,please see [this](./docs/build-guide.md)

## Contribution

Expand Down
15 changes: 15 additions & 0 deletions docs/build-guide-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 构建指南

| 依赖 |
| :---------------- |
| Godot 4.3 |
| Gettext |
| Protobuf Compiler |
| Rust Compiler |

关于Protobuf Compiler,我们首先会在本地查找是否存在protoc,如果存在可用的编译器,我们会直接采用,对于某些特殊需求,例如protoc版本过低等,我们也提供了自动编译protoc的选项,该选项默认关闭,可以通过`cargo build --package proto --features protobuf_feature`来启用捆绑的protoc,
注意,该选项可能使你的构建目录增大,构建时间增长若干倍,仍然建议提前安装好protoc

接下来,你可以运行`cd script && python build.py`来构建extension(Debug和Release)

最终,你可以启动godot编辑器来开发或导出游戏.
16 changes: 16 additions & 0 deletions docs/build-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Build Guide

| dependencies |
| :---------------- |
| Godot 4.3 |
| Gettext |
| Protobuf Compiler |
| Rust Compiler |

Regarding the Protobuf Compiler, we first check for the existence of a local protoc executable. If a usable compiler is found, it will be utilized directly. For certain special requirements, such as when the protoc version is too low, we also provide an option to
automatically compile a bundled protoc. This option is turned off by default and can be enabled by using cargo build --package proto --features protobuf_feature. Note that this option may significantly increase your build directory size and extend the build time by
several times. It is still recommended to install protoc in advance.

Then you can run `cd script && python build.py` to build the extension (both Debug and Release)

Finally,you can start godot editor and develop or export the game.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions gdrust/proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ fn main() {
}
}
if should_compile {
let mut compile = false;
let mut _compile = false;
#[cfg(feature = "protobuf_feature")]
{
std::env::set_var("PROTOC", protobuf_src::protoc());
compile = true;
_compile = true;
}
if !compile {
eprintln!("protoc not found,you can try use \"cargo build --features protobuf_feature\" to compile a protoc");
if !_compile {
eprintln!("protoc not found,you can try use \"cargo build --package proto --features protobuf_feature\" to compile a protoc");
exit(1);
}
}
Expand Down

0 comments on commit 5f4e189

Please sign in to comment.