Skip to content

Commit c4210ad

Browse files
authored
try out bazel_upgradable (#83)
1 parent 1244625 commit c4210ad

28 files changed

+1439
-305
lines changed

.bazelrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@ build --jobs 128
22
build --cxxopt='-std=c++17'
33

44
build --copt=-fdiagnostics-color=always
5-
run --copt=-fdiagnostics-color=always
5+
run --copt=-fdiagnostics-color=always
6+
7+
# Dependencies locking
8+
sync --experimental_repository_resolved_file=resolved.bzl
9+
build --experimental_resolved_file_instead_of_workspace=resolved.bzl
10+
build --experimental_repository_hash_file=resolved.bzl
11+
build --experimental_verify_repository_rules=@bazel_tools//tools/build_defs/repo:git.bzl%git_repository

.github/workflows/vsenv.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
3+
SET VSWHERE="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"
4+
5+
:: See https://github.com/microsoft/vswhere/wiki/Find-VC
6+
for /f "usebackq delims=*" %%i in (`%VSWHERE% -latest -property installationPath`) do (
7+
call "%%i"\Common7\Tools\vsdevcmd.bat %*
8+
)
9+
10+
:: Loop over all environment variables and make them global using set-env.
11+
:: See: https://help.github.com/en/articles/development-tools-for-github-actions#set-an-environment-variable-set-env
12+
:: See: https://stackoverflow.com/questions/39183272/loop-through-all-environmental-variables-and-take-actions-depending-on-prefix
13+
setlocal
14+
for /f "delims== tokens=1,2" %%a in ('set') do (
15+
echo ::set-env name=%%a::%%b
16+
)
17+
endlocal

.github/workflows/workflow.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on: push
2+
name: Build
3+
env:
4+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5+
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6+
jobs:
7+
build_on_ubuntu:
8+
name: Build on ubuntu
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Install
13+
run: sudo apt update && sudo apt-get install -y libgl1-mesa-dev xorg-dev
14+
- run: bazelisk build voidstar
15+
16+
build_on_macos:
17+
name: Build on macos
18+
runs-on: macos-latest
19+
steps:
20+
- uses: actions/setup-python@v1
21+
with:
22+
python-version: '3.x'
23+
- uses: actions/checkout@v2
24+
- run: bazelisk build voidstar
25+
26+
build_on_windows:
27+
name: Build on windows
28+
runs-on: windows-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
# Trying to install & use GCC
33+
# From https://github.com/onqtam/doctest/pull/285/files
34+
- name: Install (Windows)
35+
shell: powershell
36+
run: |
37+
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
38+
scoop install ninja --global
39+
#if ("${{ matrix.compiler }}".StartsWith("clang")) {
40+
# scoop install llvm --global
41+
#}
42+
#if ("${{ matrix.compiler }}" -eq "gcc") {
43+
# Chocolatey GCC is broken on the windows-2019 image.
44+
# See: https://github.com/DaanDeMeyer/doctest/runs/231595515
45+
# See: https://github.community/t5/GitHub-Actions/Something-is-wrong-with-the-chocolatey-installed-version-of-gcc/td-p/32413
46+
scoop install gcc --global
47+
echo "::set-env name=CC::gcc"
48+
echo "::set-env name=CXX::g++"
49+
#} elseif ("${{ matrix.compiler }}" -eq "clang") {
50+
# echo "::set-env name=CC::clang"
51+
# echo "::set-env name=CXX::clang++"
52+
#} else {
53+
# echo "::set-env name=CC::${{ matrix.compiler }}"
54+
# echo "::set-env name=CXX::${{ matrix.compiler }}"
55+
#}
56+
# Scoop modifies the PATH so we make the modified PATH global.
57+
echo "::set-env name=PATH::$env:PATH"
58+
- name: Configure x64
59+
run: .github\workflows\vsenv.bat -arch=x64 -host_arch=x64
60+
61+
- shell: bash
62+
run: |
63+
gcc --version || true
64+
clang --version || true
65+
66+
- run: bazelisk build voidstar

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
travis-miners
22

3-
/build
4-
53
/parts
64
/prime
75
/snap/.snapcraft
86
/stage
97
/voidstar_*.snap
10-
/bazel-*

.travis.yml

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,11 @@
11
sudo: false
22
language: cpp
3-
compiler:
4-
- clang
5-
- gcc
6-
os:
7-
- osx
8-
- linux
93

104
addons:
115
apt:
126
packages:
13-
- libglew-dev
14-
- xorg-dev
15-
- libgl1-mesa-dev
16-
- libc++-dev
177
- cppcheck
188

19-
before_install:
20-
- openssl aes-256-cbc -K $encrypted_b87f4dd04cd0_key -iv $encrypted_b87f4dd04cd0_iv -in travis-miners.enc -out travis-miners -d
21-
22-
install:
23-
- |
24-
case "$TRAVIS_OS_NAME" in
25-
'osx')
26-
travis_wait 15 brew update
27-
travis_wait 15 brew install glew
28-
curl -#fSLo ./bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-darwin-amd64 && chmod +x ./bazel
29-
;;
30-
'linux')
31-
curl -#fSLo ./bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 && chmod +x ./bazel
32-
;;
33-
esac
34-
35-
before_script:
36-
- ./bazel --version || true
37-
- $CC --version || true
38-
- $CXX --version || true
39-
409
script:
41-
- ./bazel build //voidstar
42-
- ./bazel-bin/voidstar/voidstar -h
43-
- ./bazel-bin/voidstar/voidstar --help
44-
- ./bazel-bin/voidstar/voidstar -l
45-
- ./bazel-bin/voidstar/voidstar --list
46-
#- ./bazel-bin/voidstar/voidstar $(echo */)
47-
- mv -v bazel-bin/voidstar/voidstar "bazel-bin/voidstar/voidstar-$(git describe --abbrev --dirty --always --tags)-$TRAVIS_OS_NAME-$(basename $CC)"
48-
- if [[ "$TRAVIS_OS_NAME" = 'linux' ]]; then cppcheck --error-exitcode=1 --enable=all -Ivoidstar/include/ voids tar/; fi
49-
50-
after_success:
51-
- |
52-
if [[ "$TRAVIS_SECURE_ENV_VARS" == 'true' ]] && [[ "$TRAVIS_BRANCH" == 'master' ]] && [[ "$TRAVIS_PULL_REQUEST" == 'false' ]] && [[ "$TRAVIS_OS_NAME" == 'linux' ]]; then
53-
major=v1
54-
minor="$(($(git describe --tags | grep $major | cut -d. -f2) + 1))"
55-
tag=$major.$minor.$TRAVIS_BUILD_ID
56-
echo Tag: $tag
57-
msg="$(git log -1 --pretty=%B | head -n 1)"
58-
echo "Message: $msg"
59-
echo Commit: $TRAVIS_COMMIT
60-
if [[ 0 -ne "$(git tag --contains $TRAVIS_COMMIT | wc -l)" ]]; then echo 'Already tagged this commit!' && exit 0; fi
61-
git config --global user.email 'pierrefenoll+travis-voidstar@gmail.com'
62-
git config --global user.name 'Autotag'
63-
git remote set-url origin git@github.com:$TRAVIS_REPO_SLUG.git
64-
git tag -a $tag -m "$msg" $TRAVIS_COMMIT
65-
chmod 600 travis-miners
66-
eval `ssh-agent -s`
67-
ssh-add travis-miners
68-
echo Tagging $TRAVIS_COMMIT with $tag
69-
git push --tags || true
70-
fi
71-
72-
deploy:
73-
provider: releases
74-
api_key:
75-
secure: cu/xvTwEXo4SD9BUb84dRSBCu8NB5KaHEFhERVlwGd9feKllpRpo1Vaflwzmoa/JEpdq5cgIV4b4f8OUtmPHlCeHq0nq6l7+Sl0p0yW0juSH0rDvJgJTde+Rma70RKVjz4mgtgLHa/PKNBHbdPl3kmVQ/aUZtF1qYN6ObiS+a+gIFQcUX0IQfJhBHRLxmc94ozW/9FxXzz0zhENeE8PWAMhAWdmxHnlYQPBuWw6EYsbzhD5s1lkywzBNprJ+XTqtc7dgTUUwZ7UkkhpQ4RrfRzjJUpKb2pjDo+8WZhsCjYnQRTCquKF4eoDM2barD/KuzRx/W+pD+eLZG7NLlm4t592mVwO+p9py330+UgS8JdNl+GJfq9QrK23Uo6FMaG/SoHO1qFd5J5RHdFO0QhCKj/BxSirayc0Jv4e04X7a8ssasIX19KpINiZO/kQZAhioumm7UXLo6cKn1nzPbPkZJ7efvKkauSMCkQgd/UZ07P3ZxgEYn9eU3KLohNq1HFxCoBsCwSXSqSkUAVRA0QAgJBUCeD/ZCuRi5icgbi7AT/OeiP0YXoi1o6aGqMIp5AQ3ysSOosJRuwSjbeZ1YgxonqVYATH1jJPg0fzyPASLGIx90UN8MmBxe/CXk0gNOrf3TTYYgdWErwB1lRcbb0fZvYfu/FDb3vp2tQjTrM/Q+qY=
76-
skip_cleanup: true
77-
overwrite: true
78-
file_glob: true
79-
file: bazel-bin/voidstar/voidstar-*
80-
on:
81-
tags: true
10+
# - mv -v bazel-bin/voidstar/voidstar "bazel-bin/voidstar/voidstar-$(git describe --abbrev --dirty --always --tags)-$TRAVIS_OS_NAME-$(basename $CC)"
11+
- cppcheck --error-exitcode=1 --enable=all -Ivoidstar/include/ voids tar/

BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
licenses(["notice"])
2+
exports_files(["LICENSE"])

Dockerfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

Dockerfile.dev

Lines changed: 0 additions & 10 deletions
This file was deleted.

LOCKFILE.bzl

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ The actual file being represented below [is data/BigPictureBG.tga](http://www.do
2727
## Usage
2828

2929
```shell
30-
bazel build //voidstar
31-
./bazel-bin/voidstar/voidstar --move ../data/*
30+
bazel build voidstar
31+
./bazel-bin/voidstar/voidstar --move bazel-bin/voidstar/voidstar data/*
3232
```
3333

3434
```
@@ -83,14 +83,13 @@ mv your/interesting/files/* data/
8383

8484
1. Download one of the `osx` files of [the latest release](https://github.com/fenollp/voidstar/releases/latest)
8585
1. Open Terminal.app (you can search for it in Spotlight)
86-
1. Type `brew install glew` then press ENTER. This installs the GLEW dependency.
8786
1. Type `chmod u+x ` then drag and drop the file you downloaded then press ENTER (now this file can be executed)
8887
1. Now drag and drop your executable then drag a file you want to look at (e.g. `data/dragon.vox`) then press ENTER
8988
1. A window should appear. Move your mouse and play with your keyboard's arrows. You should see some colored dots in 3D.
9089

9190
### on any Linux distribution
9291

93-
`sudo snap install voidstar`
92+
`snap install voidstar`
9493

9594
This relies on [snaps](https://snapcraft.io/docs/core/install).
9695

@@ -107,23 +106,5 @@ https://github.com/fenollp/voidstar/issues/2
107106
### Debian
108107

109108
```shell
110-
sudo apt install libglew-dev
109+
sudo apt-get install mesa-common-dev libegl1-mesa-dev libgles2-mesa-dev xorg-dev
111110
```
112-
113-
### OSX
114-
115-
```shell
116-
brew install glew
117-
```
118-
119-
### Web
120-
121-
https://github.com/fenollp/voidstar/issues/9
122-
123-
### Android
124-
125-
https://github.com/fenollp/voidstar/issues/7
126-
127-
### iOS
128-
129-
https://github.com/fenollp/voidstar/issues/8

0 commit comments

Comments
 (0)