mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
use proper paths in game's colorscheme-scraping build script, so things work on windows. should fix #33. try re-enabling windows build to confirm. [rebuild]
This commit is contained in:
parent
38bc88d54b
commit
227c20bd38
30
.github/workflows/main.yml
vendored
30
.github/workflows/main.yml
vendored
@ -1,21 +1,21 @@
|
||||
name: Build
|
||||
on: [push]
|
||||
jobs:
|
||||
# TODO The build.rs in game fails for Windows. My guess is the $OUT_DIR env var isn't there.
|
||||
# build-windows:
|
||||
# runs-on: windows-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@master
|
||||
# - uses: hecrj/setup-rust-action@v1
|
||||
# with:
|
||||
# rust-version: 1.40.0
|
||||
# - name: Run build
|
||||
# run: cargo build --release --bin game
|
||||
# - name: Upload binary
|
||||
# uses: actions/upload-artifact@v1
|
||||
# with:
|
||||
# name: game_windows.exe
|
||||
# path: target/release/game.exe
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
if: "contains(github.event.head_commit.message, '[rebuild]')"
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: hecrj/setup-rust-action@v1
|
||||
with:
|
||||
rust-version: 1.40.0
|
||||
- name: Run build
|
||||
run: cargo build --release --bin game
|
||||
- name: Upload binary
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: game_windows.exe
|
||||
path: target/release/game.exe
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
if: "contains(github.event.head_commit.message, '[rebuild]')"
|
||||
|
@ -1,16 +1,18 @@
|
||||
use std::collections::BTreeMap;
|
||||
use std::env;
|
||||
use std::ffi::OsStr;
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Write};
|
||||
use std::path::PathBuf;
|
||||
use walkdir::WalkDir;
|
||||
|
||||
// TODO See https://github.com/dtolnay/inventory for an alternate approach.
|
||||
fn main() {
|
||||
let mut mapping: BTreeMap<String, String> = BTreeMap::new();
|
||||
for entry in WalkDir::new("src") {
|
||||
let path = format!("{}", entry.unwrap().into_path().display());
|
||||
if path.ends_with(".rs") && path != "src/helpers.rs" {
|
||||
for (k, v) in read_file(&path) {
|
||||
let path = entry.unwrap().into_path();
|
||||
if path.extension() == Some(OsStr::new("rs")) && path != PathBuf::from("src/helpers.rs") {
|
||||
for (k, v) in read_file(&format!("{}", path.display())) {
|
||||
if mapping.contains_key(&k) {
|
||||
panic!("Color {} defined twice", k);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user