This repository has been archived by the owner on Feb 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (66 loc) · 2.63 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.PHONY: build test docs
# Node binaries path
NODE_BIN=./node_modules/.bin
# Output files
OUTPUT_CSS=./dist/siimple-icons.css
OUTPUT_CSS_MIN=./dist/siimple-icons.min.css
OUTPUT_SVG=./dist/siimple-icons.svg
OUTPUT_FONTS=./dist/fonts
OUTPUT_FONTS_SVG=${OUTPUT_FONTS}/siimple-icons.font.svg
OUTPUT_FONTS_TTF=${OUTPUT_FONTS}/siimple-icons.font.ttf
OUTPUT_FONTS_WOFF=${OUTPUT_FONTS}/siimple-icons.font.woff
OUTPUT_FONTS_WOFF2=${OUTPUT_FONTS}/siimple-icons.font.woff2
# Install dependencies
install:
npm install
# Run sass lint
lint:
${NODE_BIN}/sass-lint -v
# Build the fonts and the css files
build:
@logger -s "Build started"
@logger -s "Compiling SCSS templates"
node ./scripts/templates.js --source scss
@logger -s "Compiling CSS files"
mkdir -p ${OUTPUT_FONTS}
${NODE_BIN}/sass index.scss ${OUTPUT_CSS}
node ./scripts/header.js > ./dist/header.txt
cat ./dist/header.txt ${OUTPUT_CSS} > ${OUTPUT_CSS}.temp
rm ./dist/header.txt
rm ${OUTPUT_CSS}
mv ${OUTPUT_CSS}.temp ${OUTPUT_CSS}
@logger -s "Autoprefix and clean the generated CSS file"
${NODE_BIN}/postcss --use autoprefixer --config ./postcss.config.js --map false --output ${OUTPUT_CSS} ${OUTPUT_CSS}
${NODE_BIN}/cleancss --compatibility "*" --level 2 --output ${OUTPUT_CSS_MIN} ${OUTPUT_CSS}
@logger -s "Generating SVG sprites"
node ./scripts/build-svg-sprites.js --output ${OUTPUT_SVG}
@logger -s "Generating SVG font"
node ./scripts/build-svg-font.js --output ${OUTPUT_FONTS_SVG}
@logger -s "Generating TTF font"
${NODE_BIN}/svg2ttf ${OUTPUT_FONTS_SVG} ${OUTPUT_FONTS_TTF}
@logger -s "Generating WOFF font"
${NODE_BIN}/ttf2woff ${OUTPUT_FONTS_TTF} ${OUTPUT_FONTS_WOFF}
@logger -s "Generating WOFF2 font"
${NODE_BIN}/woff2_compress.js ${OUTPUT_FONTS_TTF} ${OUTPUT_FONTS_WOFF2}
@logger -s "Build finished"
# Build tests
test:
node ./scripts/templates.js --source test
# Build docs
docs:
cd ./docs && bundle exec jekyll build
mkdir -p ./docs/_site/assets/js ./docs/_site/assets/css
${NODE_BIN}/sass ./docs/_sass/main.scss ./docs/_site/assets/css/main.css --load-path=./bower_components/
cp ./node_modules/react/umd/react.production.min.js ./docs/_site/assets/js/
cp ./node_modules/react-dom/umd/react-dom.production.min.js ./docs/_site/assets/js/
cp ./bower_components/siimple/dist/siimple.min.css ./docs/_site/assets/css/
cp ./bower_components/siimple-colors/dist/siimple-colors.min.css ./docs/_site/assets/css/
cp ./dist/siimple-icons.min.css ./docs/_site/assets/css/
cp -R ./dist/fonts ./docs/_site/assets/css/
cp ./icons.json ./docs/_site/assets/
# Serve documentation
docs-serve:
${NODE_BIN}/stattic --folder ./docs/_site/ --port 5000 --cors
# Publish docs
docs-publish:
make docs