mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
cmd/ebitenmobile: update the default Android SDK version to 21
This commit is contained in:
parent
25a814d561
commit
5c0c084b6e
@ -54,11 +54,6 @@ func goEnv(name string) string {
|
|||||||
return strings.TrimSpace(string(val))
|
return strings.TrimSpace(string(val))
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
// Copied from gomobile.
|
|
||||||
minAndroidAPI = 15
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
buildA bool // -a
|
buildA bool // -a
|
||||||
buildI bool // -i
|
buildI bool // -i
|
||||||
@ -99,6 +94,11 @@ func main() {
|
|||||||
flag.Usage()
|
flag.Usage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// minAndroidAPI specifies the minimum API version for Android.
|
||||||
|
// Now Google Player v23.30.99+ drops the API level that is older than 21.
|
||||||
|
// See https://apilevels.com/.
|
||||||
|
const minAndroidAPI = 21
|
||||||
|
|
||||||
var flagset flag.FlagSet
|
var flagset flag.FlagSet
|
||||||
flagset.StringVar(&buildO, "o", "", "")
|
flagset.StringVar(&buildO, "o", "", "")
|
||||||
flagset.StringVar(&buildGcflags, "gcflags", "", "")
|
flagset.StringVar(&buildGcflags, "gcflags", "", "")
|
||||||
@ -150,6 +150,20 @@ func main() {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If args doesn't include '-androidapi', set it to args explicitly.
|
||||||
|
// It's because ebitenmobile's default API level is different from gomobile's one.
|
||||||
|
if buildTarget == "android" && buildAndroidAPI == minAndroidAPI {
|
||||||
|
var found bool
|
||||||
|
flag.Visit(func(f *flag.Flag) {
|
||||||
|
if f.Name == "androidapi" {
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if !found {
|
||||||
|
args = append([]string{args[0], "-androidapi", fmt.Sprintf("%d", minAndroidAPI)}, args[1:]...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := doBind(args, &flagset, buildTarget); err != nil {
|
if err := doBind(args, &flagset, buildTarget); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user