cmd/ebitenmobile: use go:embed

Updates #1258
This commit is contained in:
Hajime Hoshi 2022-09-14 23:41:22 +09:00
parent 95bfa95a91
commit 35259fe09e
3 changed files with 5 additions and 23 deletions

View File

@ -1,17 +0,0 @@
// Copyright 2019 The Ebiten Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:generate go run github.com/hajimehoshi/file2byteslice/cmd/file2byteslice@v1.0.0 -package=main -input=gobind.go -output=gobind.src.go -var gobindsrc
package main

File diff suppressed because one or more lines are too long

View File

@ -15,6 +15,7 @@
package main
import (
_ "embed"
"fmt"
"io/ioutil"
"os"
@ -23,6 +24,9 @@ import (
"runtime"
)
//go:embed gobind.go
var gobind_go []byte
const gomobileHash = "aaac322e2105241d1ac9a25b03d4e916ac6e42c6"
func runCommand(command string, args []string, env []string) error {
@ -156,7 +160,7 @@ import (
if err := os.Mkdir("src", 0755); err != nil {
return tmp, err
}
if err := ioutil.WriteFile(filepath.Join("src", "gobind.go"), gobindsrc, 0644); err != nil {
if err := ioutil.WriteFile(filepath.Join("src", "gobind.go"), gobind_go, 0644); err != nil {
return tmp, err
}