sonolus-go

module
v1.1.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: MIT

README

sonolus-go

sonolus-go 是使用 Go 编写 Sonolus 引擎的编译工具链。它将受支持的 Go DSL 编译为 Play、Watch、Preview 和 Tutorial EngineData,并可生成引擎目录或 Sonolus pack。

下载与安装

GitHub Releases 下载对应平台的预编译可执行文件,并将其加入 PATH

也可以从源码安装。项目需要 Go 1.25 或更高版本:

go install github.com/WindowsSov8forUs/sonolus-go/cmd/sonolus-go@latest

开发当前仓库时可直接编译:

git clone https://github.com/WindowsSov8forUs/sonolus-go.git
cd sonolus-go
go build ./cmd/sonolus-go

验证安装:

sonolus-go version

基础使用

引擎源码必须位于 Go module 中,入口 package 为 main。从一个最小四模式项目开始,请阅读快速开始

编译全部四种模式:

sonolus-go build -name my-engine -m all ./engine

只编译 Play:

sonolus-go build -name my-engine -m play ./engine

启动带源码监听和自动重编译的开发服务器:

sonolus-go serve -name my-engine ./engine

生成 pack:

sonolus-go pack -name my-engine -author "YourName" ./engine

打包 level JSON:

sonolus-go level ./level.json

命令输入直接使用 Go package patterns。单个明确目录可以省略 -name;多个 pattern、import pattern 或 wildcard 需要显式指定。完整参数见命令行参考

文档

许可

MIT

Directories

Path Synopsis
cmd
sonolus-go command
sonolus-go is the Go implementation of the Sonolus engine compiler.
sonolus-go is the Go implementation of the Sonolus engine compiler.
examples
conformance command
minimal command
internal
build
Package build packages compiled engine data into the on-disk Sonolus file layout: each datum is gzip-compressed, mirroring sonolus.py's package_data / PackagedEngine.write.
Package build packages compiled engine data into the on-disk Sonolus file layout: each datum is gzip-compressed, mirroring sonolus.py's package_data / PackagedEngine.write.
compiler/backend
Package backend lowers source-independent frontend IR into Sonolus engine data.
Package backend lowers source-independent frontend IR into Sonolus engine data.
compiler/catalog
Package catalog is the single semantic index for the public Sonolus Go DSL.
Package catalog is the single semantic index for the public Sonolus Go DSL.
compiler/intrinsic
Package intrinsic defines the limited standard-library surface understood by the compiler.
Package intrinsic defines the limited standard-library surface understood by the compiler.
compiler/ir
Package ir defines the source-independent, typed control-flow IR emitted by the compiler frontend.
Package ir defines the source-independent, typed control-flow IR emitted by the compiler frontend.
compiler/optimize
Package optimize provides source-independent optimization passes for the strongly typed compiler IR.
Package optimize provides source-independent optimization passes for the strongly typed compiler IR.
compiler/tag
Package tag parses namespaced Go struct tags used by the compiler.
Package tag parses namespaced Go struct tags used by the compiler.
level
Package level compiles and packages Sonolus levels (charts).
Package level compiles and packages Sonolus levels (charts).
pack
Package pack provides the adapter layer between sonolus-go's compiler output and sonolus-pack-go's source tree input.
Package pack provides the adapter layer between sonolus-go's compiler output and sonolus-pack-go's source tree input.
Package sonolus declares the compile-time API used by Sonolus engine source.
Package sonolus declares the compile-time API used by Sonolus engine source.
native
Code generated by gencatalog; DO NOT EDIT.
Code generated by gencatalog; DO NOT EDIT.
play
Package play declares Play-mode markers and runtime facades.
Package play declares Play-mode markers and runtime facades.
preview
Package preview declares Preview-mode markers and runtime facades.
Package preview declares Preview-mode markers and runtime facades.
tutorial
Package tutorial declares Tutorial-mode markers and runtime facades.
Package tutorial declares Tutorial-mode markers and runtime facades.
watch
Package watch declares Watch-mode markers and runtime facades.
Package watch declares Watch-mode markers and runtime facades.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL