mirror of
https://github.com/go-i2p/gomobile-java.git
synced 2025-07-13 14:18:23 -04:00

Current output byte-for-byte of pkg binres is close, but not exact, to output of aapt. The current exceptions to this are as follows: * sort order of certain attributes * typed value of minSdkVersion These differences do not appear to affect the encoded manifest from working correctly. Further details on the byte differences can be seen in TestEncode. Fixes golang/go#13109 Change-Id: Ibfb7731143f0e2baeeb7dd5b04aa649566606a53 Reviewed-on: https://go-review.googlesource.com/20030 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
// Copyright 2016 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build ignore
|
|
|
|
// Genarsc generates stripped down version of android.jar resources used
|
|
// for validation of manifest entries.
|
|
//
|
|
// Requires ANDROID_HOME be set to the path of the Android SDK and the
|
|
// current sdk platform installed that matches MinSDK.
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"io/ioutil"
|
|
"log"
|
|
"strconv"
|
|
|
|
"golang.org/x/mobile/internal/binres"
|
|
)
|
|
|
|
const tmpl = `// Copyright 2016 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// File is automatically generated by genarsc.go. DO NOT EDIT.
|
|
|
|
package binres
|
|
|
|
var arsc = []byte(%s)`
|
|
|
|
func main() {
|
|
arsc, err := binres.PackResources()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if err := ioutil.WriteFile("arsc.go", []byte(fmt.Sprintf(tmpl, strconv.Quote(string(arsc)))), 0644); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|