ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Add dockable Art tools, animation and previews, guarded asset workflows, and the Web Asset Studio built on the shared Art Core. Expand English and Russian documentation, interactive Try scenes, examples and editor icons. Add audio waveform navigation, source analysis, guarded previews and a browser Worker mixer. Preserve source changes and recovery with bounded checks, and strengthen native, browser and interoperability CI. Prepare version 0.12.5 and manually built native artifact candidates. Fix the production site image demo build dependency. Reuse immutable scene indices when capturing keyframes. Wait for real Persist save/load completion in component tests. Stabilize browser Game View captures outside pointer hover. Aseprite interchange and persistent Audio EDL recovery remain limited; the artifact workflow does not publish releases or change stable.
65 lines
2.0 KiB
Go
65 lines
2.0 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"go/ast"
|
|
"go/parser"
|
|
"go/token"
|
|
"path/filepath"
|
|
"regexp"
|
|
"strconv"
|
|
)
|
|
|
|
var engineSourceVersionPattern = regexp.MustCompile(`^v?[0-9]+\.[0-9]+\.[0-9]+(?:[-+][0-9A-Za-z][0-9A-Za-z.+-]*)?$`)
|
|
|
|
// sourceEngineVersion reads the exact source being packaged. Importing engine
|
|
// into this static builder would unnecessarily pull in native/render modules;
|
|
// using the builder executable's own version could describe a different tree.
|
|
// The older aegoVersion field records the requested compatible engine base.
|
|
func sourceEngineVersion(root string) (string, error) {
|
|
file := filepath.Join(root, "engine", "config.go")
|
|
data, err := readBounded(file, 1<<20)
|
|
if err != nil {
|
|
return "", fmt.Errorf("read engine source version: %w", err)
|
|
}
|
|
parsed, err := parser.ParseFile(token.NewFileSet(), file, data, 0)
|
|
if err != nil {
|
|
return "", fmt.Errorf("parse engine source version: %w", err)
|
|
}
|
|
var version string
|
|
found := false
|
|
for _, declaration := range parsed.Decls {
|
|
group, ok := declaration.(*ast.GenDecl)
|
|
if !ok || (group.Tok != token.VAR && group.Tok != token.CONST) {
|
|
continue
|
|
}
|
|
for _, specification := range group.Specs {
|
|
value, ok := specification.(*ast.ValueSpec)
|
|
if !ok {
|
|
continue
|
|
}
|
|
for index, name := range value.Names {
|
|
if name.Name != "Version" {
|
|
continue
|
|
}
|
|
if found || len(value.Values) != len(value.Names) {
|
|
return "", fmt.Errorf("engine/config.go Version must have one explicit string value")
|
|
}
|
|
literal, ok := value.Values[index].(*ast.BasicLit)
|
|
if !ok || literal.Kind != token.STRING {
|
|
return "", fmt.Errorf("engine/config.go Version must be a string literal")
|
|
}
|
|
version, err = strconv.Unquote(literal.Value)
|
|
if err != nil || !engineSourceVersionPattern.MatchString(version) {
|
|
return "", fmt.Errorf("engine/config.go Version is not a supported version string")
|
|
}
|
|
found = true
|
|
}
|
|
}
|
|
}
|
|
if !found {
|
|
return "", fmt.Errorf("engine/config.go has no explicit Version declaration")
|
|
}
|
|
return version, nil
|
|
}
|