Skip to content

Commit 6d56d75

Browse files
author
Geobert Quach
committed
fixes #180 : Enable syntax highlight to all platform
- Remove windows-gnu target, support of Windows only through MSVC - Remove 32 bits support - Switch to Visual Studio 2017 to avoid PBD error
1 parent ba70b62 commit 6d56d75

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ matrix:
2828
- if [[ `cargo +nightly-2017-10-09 clippy -- --version` != $CLIPPY_VERS* ]] ; then travis_wait cargo +nightly-2017-10-09 install clippy --vers "$CLIPPY_VERS" --force; fi
2929
- export PATH=$HOME/.cargo/bin:$PATH
3030
script:
31-
- cargo +nightly-2017-10-09 clippy --features "syntax-highlight,sass" -- -D warnings
31+
- cargo +nightly-2017-10-09 clippy --features "sass" -- -D warnings
3232
- rust: stable
3333
env: RUSTFMT=0.8.6
3434
install:
@@ -47,9 +47,11 @@ script:
4747
- rustc -Vv
4848
- cargo -V
4949
- cargo check --verbose
50-
- cargo check --verbose --features "syntax-highlight,sass"
5150
- cargo test --verbose
52-
- cargo test --verbose --features "syntax-highlight,sass"
51+
- cargo check --no-default-features --verbose
52+
- cargo test --no-default-features --verbose
53+
- cargo check --verbose --features "sass"
54+
- cargo test --verbose --features "sass"
5355

5456
before_deploy:
5557
- sh ci/before_deploy.sh

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ serde_json = "1.0"
4545
toml = "0.4.0"
4646

4747
[dependencies.sass-rs]
48-
version = "0.2.0"
48+
version = "0.2"
4949
optional = true
5050

5151
[dependencies.hyper]
5252
version = "0.10"
5353
default-features = false
5454

5555
[dependencies.syntect]
56-
version = "1.8.0"
56+
version = "1.8"
5757
optional = true
5858
default-features = false
5959
features = ["parsing", "assets", "html", "static-onig", "dump-load"]
@@ -64,7 +64,7 @@ difference = "1.0"
6464
tempdir = "0.3"
6565

6666
[features]
67-
default = []
67+
default = ["syntax-highlight"]
6868
unstable = []
6969
dev = []
7070

appveyor.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,41 @@
11
# Based on the "trust" template v0.1.1
22
# https://github.com/japaric/trust/tree/v0.1.1
33

4+
os: Visual Studio 2017
5+
46
environment:
57
global:
6-
RUST_VERSION: stable
78
CRATE_NAME: cobalt
89
APPVEYOR_CACHE_SKIP_RESTORE: true
10+
MSBUILD_NODE_CONNECTION_TIMEOUT: 0
911

1012
matrix:
1113
# Stable channel
12-
- TARGET: x86_64-pc-windows-gnu
13-
CHANNEL: stable
14-
- TARGET: i686-pc-windows-msvc
15-
CHANNEL: stable
1614
- TARGET: x86_64-pc-windows-msvc
1715
CHANNEL: stable
16+
TOOLCHAIN: msvc
17+
PLATFORM: x86_64
1818
# Beta channel
1919
- TARGET: x86_64-pc-windows-msvc
2020
CHANNEL: beta
21+
TOOLCHAIN: msvc
22+
PLATFORM: x86_64
2123

2224
install:
23-
- ps: >-
24-
$Env:PATH += ';C:\msys64\usr\bin'
25+
- if "%TOOLCHAIN%" == "msvc" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
26+
- if "%TOOLCHAIN%" == "msys" set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%
2527
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
26-
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
28+
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %CHANNEL%
2729
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
28-
29-
test_script:
3030
- rustc -Vv
3131
- cargo -V
32+
33+
test_script:
3234
# we don't run the "test phase" when doing deploys
33-
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo check --verbose )
34-
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo test --verbose )
35+
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% build )
36+
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% test )
37+
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% build --no-default-features )
38+
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% test --no-default-features )
3539

3640
before_deploy:
3741
- cargo rustc --target %TARGET% --release --bin cobalt -- -C lto

ci/before_deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ main() {
1313
;;
1414
esac
1515

16-
cargo rustc --target $TARGET --release --bin cobalt --features="syntax-highlight" -- -C lto
16+
cargo rustc --target $TARGET --release --bin cobalt -- -C lto
1717

1818
cp target/$TARGET/release/cobalt $stage/
1919

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ extern crate sass_rs;
6767

6868
extern crate itertools;
6969

70-
#[cfg(all(feature = "syntax-highlight", not(windows)))]
70+
#[cfg(all(feature = "syntax-highlight"))]
7171
extern crate syntect;
7272

7373
#[macro_use]

0 commit comments

Comments
 (0)