blob: e93ae885e24f7d007fd1a84b1f7f3c30113e7872 [file] [log] [blame]
// 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.
//go:build ignore
// +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.
// Code 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)
}
}