feat: remove NWScript compiler support
This commit is contained in:
@@ -88,7 +88,6 @@ type Config struct {
|
||||
HAKs []HAKConfig `json:"haks" yaml:"haks"`
|
||||
Inventory InventoryConfig `json:"inventory" yaml:"inventory"`
|
||||
Validation ValidationConfig `json:"validation" yaml:"validation"`
|
||||
Scripts ScriptsConfig `json:"scripts" yaml:"scripts"`
|
||||
Music MusicConfig `json:"music" yaml:"music"`
|
||||
TopData TopDataConfig `json:"topdata" yaml:"topdata"`
|
||||
Extract ExtractConfig `json:"extract" yaml:"extract"`
|
||||
@@ -145,24 +144,6 @@ type ValidationConfig struct {
|
||||
RequiredFields map[string][]string `json:"required_fields" yaml:"required_fields"`
|
||||
}
|
||||
|
||||
type ScriptsConfig struct {
|
||||
SourceDir string `json:"source_dir" yaml:"source_dir"`
|
||||
Cache string `json:"cache" yaml:"cache"`
|
||||
Compiler ScriptCompilerConfig `json:"compiler" yaml:"compiler"`
|
||||
}
|
||||
|
||||
type ScriptCompilerConfig struct {
|
||||
Path string `json:"path" yaml:"path"`
|
||||
Search []string `json:"search" yaml:"search"`
|
||||
Env ScriptCompilerEnvConfig `json:"env" yaml:"env"`
|
||||
}
|
||||
|
||||
type ScriptCompilerEnvConfig struct {
|
||||
Path string `json:"path" yaml:"path"`
|
||||
NWNRoot []string `json:"nwn_root" yaml:"nwn_root"`
|
||||
NWNUserDirectory []string `json:"nwn_user_directory" yaml:"nwn_user_directory"`
|
||||
}
|
||||
|
||||
type HAKConfig struct {
|
||||
Name string `json:"name" yaml:"name"`
|
||||
Priority int `json:"priority" yaml:"priority"`
|
||||
@@ -609,10 +590,6 @@ func (p *Project) ValidateLayout() error {
|
||||
"outputs.hak_archive": p.Config.Outputs.HAKArchive,
|
||||
"generated_assets.topdata_2da": "",
|
||||
"validation.profile": p.Config.Validation.Profile,
|
||||
"scripts.source_dir": p.Config.Scripts.SourceDir,
|
||||
"scripts.cache": p.Config.Scripts.Cache,
|
||||
"scripts.compiler.path": p.Config.Scripts.Compiler.Path,
|
||||
"scripts.compiler.env.path": p.Config.Scripts.Compiler.Env.Path,
|
||||
"topdata.source": p.Config.TopData.Source,
|
||||
"topdata.build": p.Config.TopData.Build,
|
||||
"topdata.reference_builder": p.Config.TopData.ReferenceBuilder,
|
||||
@@ -663,8 +640,6 @@ func (p *Project) ValidateLayout() error {
|
||||
failures = append(failures, validateTopDataRowGeneration(effective.TopData.RowGeneration)...)
|
||||
failures = append(failures, validateTopDataRowExtensions(effective.TopData.RowExtensions)...)
|
||||
failures = append(failures, validateTopDataClassFeatInjections(effective.TopData.ClassFeatInjections)...)
|
||||
failures = append(failures, validateRelativePath("scripts.cache", effective.Scripts.Cache)...)
|
||||
failures = append(failures, validateRelativePath("scripts.source_dir", effective.Scripts.SourceDir)...)
|
||||
failures = append(failures, validateRelativePath("topdata.compiled_2da_dir", effective.TopData.Compiled2DADir)...)
|
||||
failures = append(failures, validateRelativePath("topdata.compiled_tlk", effective.TopData.CompiledTLK)...)
|
||||
failures = append(failures, validateRelativePath("topdata.wiki.output_root", effective.TopData.Wiki.OutputRoot)...)
|
||||
@@ -1347,54 +1322,6 @@ func (p *Project) TopDataPackageTLKPath() string {
|
||||
return filepath.Join(p.BuildDir(), p.TopDataPackageTLKName())
|
||||
}
|
||||
|
||||
func (p *Project) ScriptSourceDir() string {
|
||||
return filepath.Join(p.SourceDir(), filepath.FromSlash(p.EffectiveConfig().Scripts.SourceDir))
|
||||
}
|
||||
|
||||
func (p *Project) ScriptCacheDir() string {
|
||||
return p.rootPath(p.EffectiveConfig().Scripts.Cache)
|
||||
}
|
||||
|
||||
func (p *Project) ScriptCompilerPath() string {
|
||||
path := strings.TrimSpace(p.EffectiveConfig().Scripts.Compiler.Path)
|
||||
if path == "" {
|
||||
return ""
|
||||
}
|
||||
if filepath.IsAbs(path) {
|
||||
return path
|
||||
}
|
||||
return filepath.Join(p.Root, filepath.FromSlash(path))
|
||||
}
|
||||
|
||||
func (p *Project) ScriptCompilerSearchPaths() []string {
|
||||
search := p.EffectiveConfig().Scripts.Compiler.Search
|
||||
out := make([]string, 0, len(search))
|
||||
for _, candidate := range search {
|
||||
candidate = strings.TrimSpace(candidate)
|
||||
if candidate == "" {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(candidate, "PATH:") || filepath.IsAbs(candidate) {
|
||||
out = append(out, candidate)
|
||||
continue
|
||||
}
|
||||
out = append(out, filepath.Join(p.Root, filepath.FromSlash(candidate)))
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func (p *Project) ScriptCompilerPathEnv() string {
|
||||
return p.EffectiveConfig().Scripts.Compiler.Env.Path
|
||||
}
|
||||
|
||||
func (p *Project) ScriptCompilerNWNRootEnvKeys() []string {
|
||||
return slices.Clone(p.EffectiveConfig().Scripts.Compiler.Env.NWNRoot)
|
||||
}
|
||||
|
||||
func (p *Project) ScriptCompilerNWNUserDirectoryEnvKeys() []string {
|
||||
return slices.Clone(p.EffectiveConfig().Scripts.Compiler.Env.NWNUserDirectory)
|
||||
}
|
||||
|
||||
func (p *Project) MusicStageDir() string {
|
||||
return p.rootPath(p.EffectiveConfig().Music.StageRoot)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user