examples: remove example build tag (#2433)

Closes #1462
This commit is contained in:
Artem Yadelskyi 2022-11-03 13:24:09 +02:00 committed by GitHub
parent 0762db3b3e
commit 86e694941f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
87 changed files with 33 additions and 191 deletions

View File

@ -14,4 +14,4 @@ sources:
tasks:
- build: |
cd ebiten
go build -tags=example ./...
go build ./...

View File

@ -13,4 +13,4 @@ sources:
tasks:
- build: |
cd ebiten
go build -tags=example ./...
go build ./...

View File

@ -15,4 +15,4 @@ sources:
tasks:
- build: |
cd ebiten
go build -tags=example ./...
go build ./...

View File

@ -13,4 +13,4 @@ sources:
tasks:
- build: |
cd ebiten
go build -tags=example ./...
go build ./...

View File

@ -16,4 +16,4 @@ sources:
tasks:
- build: |
cd ebiten
go build -tags=example ./...
go build ./...

View File

@ -10,4 +10,4 @@ rm -rf /usr/local/go && tar -C /usr/local -xzf ${GO_FILENAME}
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
# Run the tests
go test -tags=example -v ./...
go test -v ./...

View File

@ -64,32 +64,32 @@ jobs:
- name: go vet
run: |
go list -tags=example ./... | grep -v -x -F -f .github/workflows/govetblock.txt | xargs go vet -tags=example
go list ./... | grep -v -x -F -f .github/workflows/govetblock.txt | xargs go vet
- name: go vet (vettool)
run: |
(cd .github/workflows/vettools; go install .)
go vet -vettool=$(which vettools)${{ startsWith(matrix.os, 'windows-') && '.exe' || '' }} -tags=example -v ./...
go vet -vettool=$(which vettools)${{ startsWith(matrix.os, 'windows-') && '.exe' || '' }} -v ./...
- name: go build
run: |
go build -tags=example -v ./...
go build -v ./...
# Compile without optimization to check potential stack overflow.
# The option '-gcflags=all=-N -l' is often used at Visual Studio Code.
# See also https://go.googlesource.com/vscode-go/+/HEAD/docs/debugging.md#launch and the issue #2120.
go build -tags=example "-gcflags=all=-N -l" -v ./...
env GOOS=js GOARCH=wasm go build -tags=example -v ./...
env GOOS=windows GOARCH=386 go build -tags=example -v ./...
env GOOS=windows GOARCH=amd64 go build -tags=example -v ./...
env GOOS=windows GOARCH=arm go build -tags=example -v ./...
env GOOS=windows GOARCH=arm64 go build -tags=example -v ./...
go build "-gcflags=all=-N -l" -v ./...
env GOOS=js GOARCH=wasm go build -v ./...
env GOOS=windows GOARCH=386 go build -v ./...
env GOOS=windows GOARCH=amd64 go build -v ./...
env GOOS=windows GOARCH=arm go build -v ./...
env GOOS=windows GOARCH=arm64 go build -v ./...
- name: go build (macOS)
if: ${{ startsWith(matrix.os, 'macos-') }}
run: |
env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -tags=example -v ./...
env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -tags=example -o flappy_amd64 -v ./examples/flappy
env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -tags=example -o flappy_arm64 -v ./examples/flappy
env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -v ./...
env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o flappy_amd64 -v ./examples/flappy
env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o flappy_arm64 -v ./examples/flappy
lipo -create flappy_amd64 flappy_arm64 -output flappy
file flappy
rm flappy
@ -97,8 +97,8 @@ jobs:
- name: go build (NintendoSDK)
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
go build -tags=example,nintendosdk -v ./...
go build -tags=example,ebitencbackend -v ./... # For backward compatibility. Remove this in the future (#2190).
go build -tags=nintendosdk -v ./...
go build -tags=ebitencbackend -v ./... # For backward compatibility. Remove this in the future (#2190).
- name: go mod vendor
run: |
@ -121,7 +121,7 @@ jobs:
# TODO: Add more test environments (#1305)
if: ${{ startsWith(matrix.os, 'ubuntu-') || startsWith(matrix.os, 'windows-') }}
run: |
go test -tags=example -shuffle=on -v ./...
go test -shuffle=on -v ./...
- name: go test (Linux 386)
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
@ -130,23 +130,23 @@ jobs:
sudo apt-get update
sudo apt-get install gcc-multilib
sudo apt-get install libasound2-dev:i386 libgl1-mesa-dev:i386 libxcursor-dev:i386 libxi-dev:i386 libxinerama-dev:i386 libxrandr-dev:i386 libxxf86vm-dev:i386
env CGO_ENABLED=1 GOARCH=386 go test -tags=example -shuffle=on -v ./...
env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v ./...
- name: go test (Linux OpenGL ES)
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
sudo apt-get install libgles2-mesa-dev
env EBITENGINE_GRAPHICS_LIBRARY=opengl go test -tags=example,opengles -shuffle=on -v ./...
env EBITENGINE_GRAPHICS_LIBRARY=opengl go test -tags=opengles -shuffle=on -v ./...
- name: go test (Windows 386)
if: ${{ startsWith(matrix.os, 'windows-') }}
run: |
env GOARCH=386 go test -tags=example -shuffle=on -v ./...
env GOARCH=386 go test -shuffle=on -v ./...
- name: go test (Wasm)
run: |
env GOOS=js GOARCH=wasm go test -tags=example -shuffle=on -v ./...
env GOOS=js GOARCH=wasm EBITENGINE_OPENGL=webgl1 go test -tags=example -shuffle=on -v ./...
env GOOS=js GOARCH=wasm go test -shuffle=on -v ./...
env GOOS=js GOARCH=wasm EBITENGINE_OPENGL=webgl1 go test -shuffle=on -v ./...
- name: Install ebitenmobile
run: |

View File

@ -43,5 +43,5 @@ jobs:
- name: govulncheck
run: |
govulncheck -tags=example ./...
env GOOS=js GOARCH=wasm govulncheck -tags=example ./...
govulncheck ./...
env GOOS=js GOARCH=wasm govulncheck ./...

View File

@ -45,14 +45,6 @@ For example, formatting by `go fmt` is required.
You don't have to update existing files' license comments.
## Adding build tags for examples
```go
//go:build example
```
`example` is to prevent from installing executions by `go get github.com/hajimehoshi/ebiten/v2/...`.
## Implementation details
See the [documents](https://ebitengine.org/en/documents/implementation.html) about internal implementation.

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -3,7 +3,7 @@
## Desktops
```sh
go run -tags=example github.com/hajimehoshi/ebiten/v2/examples/rotate
go run github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
## Android
@ -11,13 +11,13 @@ go run -tags=example github.com/hajimehoshi/ebiten/v2/examples/rotate
Install [gomobile](https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile) first.
```sh
gomobile install -tags=example github.com/hajimehoshi/ebiten/v2/examples/rotate
gomobile install github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
## iOS
```sh
gomobile build -target=ios -tags=example -work github.com/hajimehoshi/ebiten/v2/examples/rotate
gomobile build -target=ios -work github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
Then, open the `WORK` directory, open `main.xcodeproj`, add signing, and run the project.

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
// This is an example to implement an audio player.
// See examples/wav for a simpler example to play a sound file.

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example && !js
//go:build !js
package main

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example && (microsoftgdk || nintendosdk)
//go:build microsoftgdk || nintendosdk
// This file is for some special environments using 'microsoftgdk' or 'nintendosdk'.
// You usually don't have to care about this file.

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -21,8 +21,6 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
// Mascot is a desktop mascot on cross platforms.
// This is inspired by mattn's gopher (https://github.com/mattn/gopher).
package main

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
// This example is an experiment to minify images with various filters.
// When linear filter is used, mipmap images should be used for high-quality rendering (#578).

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
// This example is just to check if Ebitengine can draw fine checker pattern evenly.
// If there is something wrong in the implementation, the result might include
// uneven patterns (#459).

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
// This demo is inspired by the xscreensaver 'squirals'.
package main

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build example
package main
import (