mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
cmd/gio: add -version flag
For Android and iOS. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -280,8 +280,8 @@ func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
|
||||
manifestSrc := fmt.Sprintf(`<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="%s"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
android:versionCode="%d"
|
||||
android:versionName="1.0.%d">
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-feature android:glEsVersion="0x00030000"/>
|
||||
@@ -297,7 +297,7 @@ func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>`, *appID, appName)
|
||||
</manifest>`, *appID, bi.version, bi.version, appName)
|
||||
manifest := filepath.Join(tmpDir, "AndroidManifest.xml")
|
||||
if err := ioutil.WriteFile(manifest, []byte(manifestSrc), 0660); err != nil {
|
||||
return err
|
||||
|
||||
+7
-4
@@ -20,6 +20,7 @@ var (
|
||||
buildMode = flag.String("buildmode", "exe", "specify buildmode: archive or exe")
|
||||
destPath = flag.String("o", "", `output path. Specify a path with the ".app" suffix for iOS simulators.`)
|
||||
appID = flag.String("appid", "org.gioui.app", "app identifier (for -buildmode=exe)")
|
||||
version = flag.Int("version", 1, "app version (for -buildmode=exe)")
|
||||
printCommands = flag.Bool("x", false, "print the commands")
|
||||
keepWorkdir = flag.Bool("work", false, "print the name of the temporary work directory and do not delete it when exiting.")
|
||||
)
|
||||
@@ -30,6 +31,7 @@ type buildInfo struct {
|
||||
ldflags string
|
||||
target string
|
||||
appID string
|
||||
version int
|
||||
archs []string
|
||||
}
|
||||
|
||||
@@ -67,10 +69,11 @@ func main() {
|
||||
}
|
||||
name = filepath.Base(name)
|
||||
bi := &buildInfo{
|
||||
name: name,
|
||||
pkg: pkg,
|
||||
target: *target,
|
||||
appID: *appID,
|
||||
name: name,
|
||||
pkg: pkg,
|
||||
target: *target,
|
||||
appID: *appID,
|
||||
version: *version,
|
||||
}
|
||||
switch *target {
|
||||
case "js":
|
||||
|
||||
+3
-3
@@ -231,9 +231,9 @@ func buildInfoPlist(bi *buildInfo) string {
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>1.0.%d</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>%d</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
@@ -249,7 +249,7 @@ func buildInfoPlist(bi *buildInfo) string {
|
||||
<integer>1</integer>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>`, bi.appID, appName, platform)
|
||||
</plist>`, bi.appID, appName, bi.version, bi.version, platform)
|
||||
}
|
||||
|
||||
func archiveIOS(tmpDir, target, frameworkRoot string, bi *buildInfo) error {
|
||||
|
||||
Reference in New Issue
Block a user