mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-06 11:40:17 +08:00

* Add some clarifying comments * Remove special handling of window parameters * Improve internal method exclusion * Add test for internal method exclusion * Remove useless blank field from app options This is a leftover from an older version of the static analyser. It should have been removed long ago. * Remove redundant godebug setting gotypesalias=1 is the default starting with go1.23 * Use new range for syntax to simplify code * Remove generator dependency on github.com/samber/lo * Ensure generator testing tasks do not use the test cache * Rename cyclic types test * Test for cyclic imports * Fix import cycle between model files * Sort class aliases after their aliased class * Test class aliases * Fix length of default value for array types * Test array initialization * Add changelog * Update changelog * Fix contrived marking technique in model sorting algorithm * Update binding example * Update test data --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
25 lines
760 B
Go
25 lines
760 B
Go
package generator
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/wailsapp/wails/v3/internal/generator/collect"
|
|
)
|
|
|
|
// generateModels generates a file for exported models from the given index information.
|
|
func (generator *Generator) generateModels(index *collect.PackageIndex) {
|
|
file, err := generator.creator.Create(filepath.Join(index.Package.Path, generator.renderer.ModelsFile()))
|
|
if err != nil {
|
|
generator.logger.Errorf("%v", err)
|
|
generator.logger.Errorf("package %s: exported models generation failed", index.Package.Path)
|
|
return
|
|
}
|
|
defer file.Close()
|
|
|
|
err = generator.renderer.Models(file, index)
|
|
if err != nil {
|
|
generator.logger.Errorf("%v", err)
|
|
generator.logger.Errorf("package %s: exported models generation failed", index.Package.Path)
|
|
}
|
|
}
|