Skip to content

Commit

Permalink
Merge 21fbfa6 into ef917cd
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Mar 15, 2020
2 parents ef917cd + 21fbfa6 commit c707026
Show file tree
Hide file tree
Showing 15 changed files with 1,151 additions and 456 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.stack-work
/stack.yaml.lock
/cabal.config
/cabal.sandbox.config
/dist
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
---
language: generic
dist: xenial
os: linux

env: PACKAGE=tokstyle TARGET=x86_64-linux

cache:
timeout: 3
directories:
- $HOME/.stack

before_install:
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://github.com/TokTok/hs-tools/releases/download/v0.1/hs-tools-v0.1.tar.gz | tar xz -C $HOME
- travis_retry curl -L https://github.com/TokTok/hs-tools/releases/download/v0.6/hs-tools-v0.6.tar.gz | tar xz -C $HOME

script:
- hlint .
- stylish-haskell-lhs -i .
- git diff --exit-code
- ./expand_yacc.pl src/Tokstyle/Cimple/Parser.y src/Tokstyle/Cimple/Parser.y
- stack --no-terminal test --coverage
- shc $PACKAGE testsuite
- stack install
- tar zcf $PACKAGE-$TARGET-$TRAVIS_TAG.tar.gz -C $HOME/.local $(grep executable $PACKAGE.cabal | awk '{print "bin/"$2}')

deploy:
provider: releases
api_key:
token:
secure: n1kpXjJDqNRo5d2j2YyPuAEej3rL9G1W3JdfArG5QdHGUjKNaObAhuHZ6qo7d9LILt0IMssdZ4qz9qTySiu1BUd2lfAdrh7uoXhPzwYuswgcoVfFomEkkbejpyZK8FR4ZRdeQaU6xXWq1E+Q4Y7bkGJIK4/lSxjA6tfkv+KreHyCZqvuyCsdmJbKRMAq8QrCR9Ak/8+laJj+jp0Qs/uiDVH6PWoD414tLzuOKFNUG6pqfAPWaFCIplDjkzmcN8vt43yCYc2O5TUUPb2VLZm9lBr4JsT4UKsfpcON2U13Fe0Q5zD+U1yCwM7BYuS6WPXnk8ylJLjjANoWoXdVzYJZ38v3PH9GySmY54Hyc5vh71UEBjjbNSd0kBBUnhIuQ0z1nXFduJ5bNnxxLHT7w+HVD5nKO6W4m/00Q3h2ULHD8u4yf0vE2mFqaFQsjkjb5/23b0MKBPrq2Cl+VsdZseKjAXfBV9R2kRApq+ljGdLgNbGyYzZJrJTQY9cxkAn+xvoJJoTBBdN0dxSFY/N08t3mMow1bDr4nLsJWgH0h5A5PgODU1v5f/gSClp1kUpKpC/olryzancG5NfEvdrP6s/jBUx72KQPlBMar7g79Kk8PjQXGs1pvqnWMYhIGExVCRJ8nFNpyl0MhmZhySB3QsqNCNcuQRHstBqI0ugbJuuD+n8=
file: $PACKAGE-$TARGET-$TRAVIS_TAG.tar.gz
skip_cleanup: true
Expand Down
57 changes: 53 additions & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,36 @@ alex_lexer(
src = "src/Tokstyle/Cimple/Lexer.x",
)

haskell_library(
name = "cimple-lexer",
srcs = [
"src/Tokstyle/Cimple/Lexer.hs",
"src/Tokstyle/Cimple/Tokens.hs",
],
compiler_flags = [
"-Wall",
"-Werror",
],
src_strip_prefix = "src",
version = "0.0.2",
visibility = ["//hs-tokstyle:__subpackages__"],
deps = [
hazel_library("array"),
hazel_library("base"),
hazel_library("text"),
],
)

happy_parser(
name = "Parser",
src = "src/Tokstyle/Cimple/Parser.y",
preproc = "expand_yacc.pl",
)

haskell_library(
name = "hs-tokstyle",
srcs = glob(["src/**/*.*hs"]) + [
"src/Tokstyle/Cimple/Lexer.hs",
name = "cimple-parser",
srcs = [
"src/Tokstyle/Cimple/AST.hs",
"src/Tokstyle/Cimple/Parser.hs",
],
compiler_flags = [
Expand All @@ -30,11 +51,37 @@ haskell_library(
],
src_strip_prefix = "src",
version = "0.0.2",
visibility = ["//visibility:public"],
visibility = ["//hs-tokstyle:__subpackages__"],
deps = [
":cimple-lexer",
hazel_library("array"),
hazel_library("base"),
],
)

haskell_library(
name = "hs-tokstyle",
srcs = glob(
["src/**/*.*hs"],
exclude = [
"src/Tokstyle/Cimple/AST.hs",
"src/Tokstyle/Cimple/Tokens.hs",
],
),
compiler_flags = [
"-Wall",
"-Werror",
"-Wno-unused-imports",
],
src_strip_prefix = "src",
version = "0.0.2",
visibility = ["//visibility:public"],
deps = [
":cimple-lexer",
":cimple-parser",
hazel_library("base"),
hazel_library("bytestring"),
hazel_library("containers"),
hazel_library("deepseq"),
hazel_library("filepath"),
hazel_library("groom"),
Expand All @@ -50,6 +97,8 @@ hspec_test(
"-Werror",
],
deps = [
":cimple-lexer",
":cimple-parser",
":hs-tokstyle",
hazel_library("base"),
hazel_library("hspec"),
Expand Down

0 comments on commit c707026

Please sign in to comment.