cmd/ebitenmobile: bug fix: the first character of a framework name must be an upper case

Updates #2192
This commit is contained in:
Hajime Hoshi 2022-07-09 18:30:38 +09:00
parent 41756e512d
commit ddaef29bc9

View File

@ -238,8 +238,12 @@ func doBind(args []string, flagset *flag.FlagSet, buildOS string) error {
continue
}
frameworkName := filepath.Base(buildO)
frameworkName = frameworkName[:len(frameworkName)-len(".xcframework")] + ".framework"
dir := filepath.Join(buildO, name, frameworkName, "Versions", "A")
frameworkNameBase := frameworkName[:len(frameworkName)-len(".xcframework")]
// The first character must be an upper case (#2192).
// TODO: strings.Title is used here for the consistency with gomobile (see cmd/gomobile/bind_iosapp.go).
// As strings.Title is deprecated, golang.org/x/text/cases should be used.
frameworkNameBase = strings.Title(frameworkNameBase)
dir := filepath.Join(buildO, name, frameworkNameBase+".framework", "Versions", "A")
if err := ioutil.WriteFile(filepath.Join(dir, "Headers", prefixUpper+"EbitenViewController.h"), []byte(replacePrefixes(objcH)), 0644); err != nil {
return err