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