Skip to content

Commit 5e21d3f

Browse files
committed
Add plugins to CI
1 parent 12d8763 commit 5e21d3f

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ matrix:
3939
- os: osx
4040
env: AUTOTOOLS=no BUILD=static
4141

42-
script: ./script/ci-build-libsass
42+
script:
43+
- ./script/ci-build-libsass
44+
- ./script/ci-build-plugin math
45+
- ./script/ci-build-plugin glob
46+
- ./script/ci-build-plugin digest
47+
- ./script/ci-build-plugin tests
4348
before_install: ./script/ci-install-deps
4449
install: ./script/ci-install-compiler
4550
after_success: ./script/ci-report-coverage

script/ci-build-plugin

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
PLUGIN=$1
4+
RUBY_BIN=ruby
5+
SASS_SPEC_PATH=sass-spec
6+
SASSC_BIN=sassc/bin/sassc
7+
SASS_SPEC_SPEC_DIR=plugins/libsass-${PLUGIN}/test
8+
9+
if [ -e ./tester ] ; then
10+
SASSC_BIN=./tester
11+
fi
12+
13+
if [ -d ./build/lib ] ; then
14+
cp -a build/lib lib
15+
fi
16+
17+
if [ "x$1" == "x" ] ; then
18+
echo "No plugin name given"
19+
exit 1
20+
fi
21+
22+
mkdir -p plugins
23+
if [ ! -d plugins/libsass-${PLUGIN} ] ; then
24+
git clone https://github.com/mgreter/libsass-${PLUGIN} plugins/libsass-${PLUGIN}
25+
fi
26+
if [ ! -d plugins/libsass-${PLUGIN}/build ] ; then
27+
mkdir plugins/libsass-${PLUGIN}/build
28+
fi
29+
30+
cd plugins/libsass-${PLUGIN}/build
31+
cmake -G "Unix Makefiles" -D LIBSASS_DIR="../../.." ..
32+
make -j2
33+
cd ../../..
34+
35+
# glob only works on paths relative to imports
36+
if [ "x$PLUGIN" == "xglob" ]; then
37+
${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build ${SASS_SPEC_SPEC_DIR}/basic/input.scss > ${SASS_SPEC_SPEC_DIR}/basic/result.css
38+
${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build ${SASS_SPEC_SPEC_DIR}/basic/input.scss --sourcemap > /dev/null
39+
else
40+
cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic > ${SASS_SPEC_SPEC_DIR}/basic/result.css
41+
cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic --sourcemap > /dev/null
42+
fi
43+
44+
diff ${SASS_SPEC_SPEC_DIR}/basic/expected_output.css ${SASS_SPEC_SPEC_DIR}/basic/result.css

src/sass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ extern "C" {
6969
char* ADDCALL sass_compiler_find_include (const char* file, struct Sass_Compiler* compiler)
7070
{
7171
// get the last import entry to get current base directory
72-
// struct Sass_Options* options = sass_compiler_get_options(compiler);
7372
Sass_Import_Entry import = sass_compiler_get_last_import(compiler);
7473
const std::vector<std::string>& incs = compiler->cpp_ctx->include_paths;
7574
// create the vector with paths to lookup
@@ -84,7 +83,6 @@ extern "C" {
8483
char* ADDCALL sass_compiler_find_file (const char* file, struct Sass_Compiler* compiler)
8584
{
8685
// get the last import entry to get current base directory
87-
// struct Sass_Options* options = sass_compiler_get_options(compiler);
8886
Sass_Import_Entry import = sass_compiler_get_last_import(compiler);
8987
const std::vector<std::string>& incs = compiler->cpp_ctx->include_paths;
9088
// create the vector with paths to lookup

0 commit comments

Comments
 (0)