mirror of
https://gitcode.com/JianFeeeee/homeagent-sdk.git
synced 2026-09-20 08:58:03 +00:00
refactor: centralize ABI metadata into meta/meta.go
- meta/meta.go: add ABIVersion, ABIVersionMin, 45 dispatch method IDs - tools/plugindev/cmd_init.go: cabiVersion -> meta.ABIVersion - tools/plugindev/templates.go: C header comments reference meta.go
This commit is contained in:
@ -6,9 +6,9 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
const cabiVersion = 1
|
||||
"gitcode.com/JianFeeeee/homeagent-sdk/meta"
|
||||
)
|
||||
|
||||
type PlgConfig struct {
|
||||
Name string `json:"name"`
|
||||
@ -84,7 +84,7 @@ func cmdInit(args []string) {
|
||||
Targets: targets,
|
||||
},
|
||||
IsLua: isLua,
|
||||
CABIVersion: cabiVersion,
|
||||
CABIVersion: meta.ABIVersion,
|
||||
CABIHeader: tmplCABIHeader,
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
module github.com/JianFeeeee/homeagent-sdk/tools/plugindev
|
||||
|
||||
go 1.21
|
||||
go 1.25.0
|
||||
|
||||
require gitcode.com/JianFeeeee/homeagent-sdk v0.0.0
|
||||
|
||||
replace gitcode.com/JianFeeeee/homeagent-sdk => ../../
|
||||
|
||||
@ -279,9 +279,11 @@ func main() {}
|
||||
`
|
||||
|
||||
// tmplCABIHeader — shared C ABI type definitions for both core and plugin
|
||||
// 此模板中的常量应与 core/internal/meta/meta.go 保持一致(ABI 版本、dispatch method IDs)。
|
||||
const tmplCABIHeader = `
|
||||
#ifndef HOMEAGENT_CABI_H
|
||||
#define HOMEAGENT_CABI_H
|
||||
// HOMEAGENT_ABI_VERSION 与 sdk/meta/meta.go ABIVersion 同步
|
||||
#define HOMEAGENT_ABI_VERSION 1
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user