mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
cmd/gio: use package name for app name in -buildmode=exe
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -233,6 +233,7 @@ func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
appName := strings.Title(filepath.Base(bi.pkg))
|
||||
manifestSrc := fmt.Sprintf(`<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="%s"
|
||||
@@ -243,7 +244,7 @@ func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
|
||||
<uses-feature android:glEsVersion="0x00030000"/>
|
||||
<application android:label="Gio">
|
||||
<activity android:name="org.gioui.GioActivity"
|
||||
android:label="Gio"
|
||||
android:label="%s"
|
||||
android:theme="@android:style/Theme.NoTitleBar"
|
||||
android:configChanges="orientation|keyboardHidden">
|
||||
<intent-filter>
|
||||
@@ -252,7 +253,7 @@ func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>`, *appID)
|
||||
</manifest>`, *appID, appName)
|
||||
manifest := filepath.Join(tmpDir, "AndroidManifest.xml")
|
||||
if err := ioutil.WriteFile(manifest, []byte(manifestSrc), 0600); err != nil {
|
||||
return err
|
||||
|
||||
+3
-2
@@ -174,6 +174,7 @@ int main(int argc, char * argv[]) {
|
||||
if _, err := runCmd(lipo); err != nil {
|
||||
return err
|
||||
}
|
||||
appName := strings.Title(filepath.Base(bi.pkg))
|
||||
infoPlistSrc := fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
@@ -187,7 +188,7 @@ int main(int argc, char * argv[]) {
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Gio</string>
|
||||
<string>%s</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
@@ -197,7 +198,7 @@ int main(int argc, char * argv[]) {
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
</dict>
|
||||
</plist>`, *appID)
|
||||
</plist>`, *appID, appName)
|
||||
infoPlist := filepath.Join(app, "Info.plist")
|
||||
if err := ioutil.WriteFile(infoPlist, []byte(infoPlistSrc), 0600); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user