Add 'auto-generated' notices (#66)

This commit is contained in:
Hajime Hoshi 2015-01-07 23:21:52 +09:00
parent 4eaa16b8d1
commit 27cd0610d1
5 changed files with 19 additions and 0 deletions

View File

@ -74,6 +74,8 @@ func init() {
const ebitenKeysTmpl = `{{.License}} const ebitenKeysTmpl = `{{.License}}
// {{.Notice}}
package ebiten package ebiten
@ -93,6 +95,8 @@ const (
const uiKeysTmpl = `{{.License}} const uiKeysTmpl = `{{.License}}
// {{.Notice}}
package ui package ui
type Key int type Key int
@ -105,6 +109,8 @@ const (
const uiKeysGlfwTmpl = `{{.License}} const uiKeysGlfwTmpl = `{{.License}}
// {{.Notice}}
// +build !js // +build !js
package ui package ui
@ -127,6 +133,8 @@ var glfwKeyCodeToKey = map[glfw.Key]Key{
const uiKeysJSTmpl = `{{.License}} const uiKeysJSTmpl = `{{.License}}
// {{.Notice}}
// +build js // +build js
package ui package ui
@ -223,6 +231,8 @@ func main() {
lines := strings.Split(string(l), "\n") lines := strings.Split(string(l), "\n")
license := "// " + strings.Join(lines[:len(lines)-1], "\n// ") license := "// " + strings.Join(lines[:len(lines)-1], "\n// ")
notice := "DO NOT EDIT: This file is auto-generated by genkeys.go."
names := []string{} names := []string{}
namesWithoutMods := []string{} namesWithoutMods := []string{}
codes := []int{} codes := []int{}
@ -255,6 +265,7 @@ func main() {
// NOTE: According to godoc, maps are automatically sorted by key. // NOTE: According to godoc, maps are automatically sorted by key.
tmpl.Execute(f, map[string]interface{}{ tmpl.Execute(f, map[string]interface{}{
"License": license, "License": license,
"Notice": notice,
"KeyCodeToName": keyCodeToName, "KeyCodeToName": keyCodeToName,
"Codes": codes, "Codes": codes,
"KeyNames": names, "KeyNames": names,

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// DO NOT EDIT: This file is auto-generated by genkeys.go.
package ui package ui
type Key int type Key int

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// DO NOT EDIT: This file is auto-generated by genkeys.go.
// +build !js // +build !js
package ui package ui

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// DO NOT EDIT: This file is auto-generated by genkeys.go.
// +build js // +build js
package ui package ui

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// DO NOT EDIT: This file is auto-generated by genkeys.go.
package ebiten package ebiten
import ( import (