Skip to content

Commit

Permalink
Merge pull request cobalt-org#352 from Geobert/cobalt-org#180
Browse files Browse the repository at this point in the history
fixes cobalt-org#180 : Enable syntax highlight to all platform
  • Loading branch information
epage committed Jan 15, 2018
2 parents 2392978 + 2549bfc commit 8003c11
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ matrix:
- 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
- export PATH=$HOME/.cargo/bin:$PATH
script:
- cargo +nightly-2017-10-09 clippy --features "syntax-highlight,sass" -- -D warnings
- cargo +nightly-2017-10-09 clippy --features "sass" -- -D warnings
- rust: stable
env: RUSTFMT=0.8.6
install:
Expand All @@ -47,9 +47,11 @@ script:
- rustc -Vv
- cargo -V
- cargo check --verbose
- cargo check --verbose --features "syntax-highlight,sass"
- cargo test --verbose
- cargo test --verbose --features "syntax-highlight,sass"
- cargo check --no-default-features --verbose
- cargo test --no-default-features --verbose
- cargo check --verbose --features "sass"
- cargo test --verbose --features "sass"

before_deploy:
- sh ci/before_deploy.sh
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ serde_json = "1.0"
toml = "0.4.0"

[dependencies.sass-rs]
version = "0.2.0"
version = "0.2"
optional = true

[dependencies.hyper]
version = "0.10"
default-features = false

[dependencies.syntect]
version = "1.8.0"
version = "1.8"
optional = true
default-features = false
features = ["parsing", "assets", "html", "static-onig", "dump-load"]
Expand All @@ -64,7 +64,7 @@ difference = "1.0"
tempdir = "0.3"

[features]
default = []
default = ["syntax-highlight"]
unstable = []
dev = []

Expand Down
26 changes: 14 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
# Based on the "trust" template v0.1.1
# https://github.com/japaric/trust/tree/v0.1.1

os: Visual Studio 2017

environment:
global:
RUST_VERSION: stable
CRATE_NAME: cobalt
APPVEYOR_CACHE_SKIP_RESTORE: true

matrix:
# Stable channel
- TARGET: x86_64-pc-windows-gnu
CHANNEL: stable
- TARGET: i686-pc-windows-msvc
CHANNEL: stable
- TARGET: x86_64-pc-windows-msvc
CHANNEL: stable
TOOLCHAIN: msvc

# Beta channel
- TARGET: x86_64-pc-windows-msvc
CHANNEL: beta
TOOLCHAIN: msvc

install:
- ps: >-
$Env:PATH += ';C:\msys64\usr\bin'
- if "%TOOLCHAIN%" == "msvc" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- if "%TOOLCHAIN%" == "msys" set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %CHANNEL%
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin

test_script:
- rustc -Vv
- cargo -V

test_script:
# we don't run the "test phase" when doing deploys
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo check --verbose )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo test --verbose )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% build )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% test )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% build --no-default-features )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% test --no-default-features )

before_deploy:
- cargo rustc --target %TARGET% --release --bin cobalt -- -C lto
Expand Down
2 changes: 1 addition & 1 deletion ci/before_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ main() {
;;
esac

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern crate sass_rs;

extern crate itertools;

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

#[macro_use]
Expand Down

0 comments on commit 8003c11

Please sign in to comment.