-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
2,041 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
# Created by https://www.gitignore.io/api/haskell | ||
|
||
### Haskell ### | ||
dist | ||
dist-* | ||
cabal-dev | ||
*.o | ||
*.hi | ||
*.chi | ||
*.chs.h | ||
*.dyn_o | ||
*.dyn_hi | ||
.hpc | ||
.hsenv | ||
.cabal-sandbox/ | ||
cabal.sandbox.config | ||
*.prof | ||
*.aux | ||
*.hp | ||
*.eventlog | ||
.stack-work/ | ||
cabal.project.local | ||
.HTF/ | ||
static/out.jsexe/*js* | ||
static/out.jsexe/*stats* | ||
static/out.jsexe/*webapp* | ||
|
||
# End of https://www.gitignore.io/api/haskell | ||
|
||
*.swp | ||
*.swo | ||
*.DS_Store | ||
/.idea | ||
/.ideaHaskellLib | ||
/haskell-do.iml | ||
/out | ||
|
||
*.cabal | ||
|
||
lastproject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This is the simple Travis configuration, which is intended for use | ||
# on applications which do not require cross-platform and | ||
# multiple-GHC-version support. For more information and other | ||
# options, see: | ||
# | ||
# https://docs.haskellstack.org/en/stable/travis_ci/ | ||
# | ||
# Copy these contents into the root directory of your Github project in a file | ||
# named .travis.yml | ||
|
||
# Use new container infrastructure to enable caching | ||
sudo: false | ||
|
||
# Do not choose a language; we provide our own build tools. | ||
language: generic | ||
|
||
# Caching so the next build will be fast too. | ||
cache: | ||
directories: | ||
- $HOME/.stack | ||
|
||
# Ensure necessary system libraries are present | ||
addons: | ||
apt: | ||
packages: | ||
- libgmp-dev | ||
|
||
before_install: | ||
# Download and unpack the stack executable | ||
- mkdir -p ~/.local/bin | ||
- export PATH=$HOME/.local/bin:$PATH | ||
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' | ||
|
||
install: | ||
# Build dependencies | ||
- stack --no-terminal --install-ghc test --only-dependencies | ||
|
||
script: | ||
# Build the package, its tests, and its docs and run the tests | ||
- stack --no-terminal test --haddock --no-haddock-deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#!/usr/bin/env stack | ||
-- stack --resolver lts-8.11 --install-ghc runghc --package turtle-1.3.2 --package foldl | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
import Prelude hiding (FilePath) | ||
import Turtle | ||
import Control.Monad (when) | ||
import Data.Text as T | ||
import Data.Text (Text) | ||
import System.Info (os) | ||
import qualified Control.Foldl as Foldl | ||
import Filesystem.Path.CurrentOS | ||
|
||
clientStackYaml = "client-stack.yaml" | ||
serverStackYaml = "stack.yaml" | ||
|
||
main = do | ||
projectDirectory <- pwdAsText | ||
BuildCommand all gui core orchestrator run <- options "Haskell.do build file" buildSwitches | ||
if all | ||
then buildAll projectDirectory | ||
else do | ||
when gui $ buildGUI projectDirectory | ||
when core $ buildCore projectDirectory | ||
when orchestrator $ buildOrchestrator projectDirectory | ||
when run $ runHaskellDo projectDirectory | ||
|
||
|
||
buildSwitches :: Parser BuildCommand | ||
buildSwitches = BuildCommand | ||
<$> switch "all" 'a' "Build all subprojects, without running Haskell.do" | ||
<*> switch "gui" 'g' "Build GUI" | ||
<*> switch "core" 'c' "Build processing/compilation core" | ||
<*> switch "orchestrator" 'o' "Build orchestrator" | ||
<*> switch "run" 'r' "Run Haskell.do" | ||
|
||
buildAll projectDirectory = do | ||
buildCore projectDirectory | ||
buildGUI projectDirectory | ||
buildOrchestrator projectDirectory | ||
|
||
buildCore :: Text -> IO () | ||
buildCore pdir = do | ||
echo "Building core" | ||
exitCode <- shell ("stack build --stack-yaml=" <> serverStackYaml) "" | ||
when (exitCode /= ExitSuccess) (error "Core: Build failed") | ||
return () | ||
|
||
|
||
buildGUI pdir = | ||
if isWindows os | ||
then die "GHCJS currently does not support Windows, please try from a *nix machine." | ||
else do | ||
echo "Building GUI" | ||
shell "mkdir -p static" "" | ||
Just directory <- fold (inshell "stack path --stack-yaml=client-stack.yaml --local-install-root" Turtle.empty) Foldl.head | ||
exitCode <- shell ("stack build --stack-yaml=" <> clientStackYaml) "" | ||
when (exitCode /= ExitSuccess) (error "GUI: Build failed") | ||
shell "rm -rf static/out.jsexe/*.js" "" | ||
shell "rm -rf static/out.jsexe/*.externs" "" | ||
shell "rm -rf static/out.jsexe/*.stats" "" | ||
shell "rm -rf static/out.jsexe/*.webapp" "" | ||
shell ("cp -R " <> lineToText directory <> "/bin/haskell-do.jsexe/*.js static/out.jsexe") "" | ||
return () | ||
|
||
|
||
buildOrchestrator pdir = | ||
echo "" | ||
|
||
|
||
runHaskellDo pdir = do | ||
echo "Running Haskell.do" | ||
shell ("stack exec haskell-do --stack-yaml=" <> serverStackYaml <> " -- 8080") "" | ||
return () | ||
|
||
|
||
|
||
|
||
-- Helpers | ||
isWindows operatingSystem = "mingw" `T.isPrefixOf` T.pack operatingSystem | ||
isOSX operatingSystem = "darwin" `T.isPrefixOf` T.pack operatingSystem | ||
|
||
makeTextPath = T.pack . encodeString . fromText | ||
|
||
pwdAsText :: IO Text | ||
pwdAsText = T.pack <$> encodeString <$> pwd | ||
|
||
data BuildCommand = BuildCommand | ||
{ buildCommandAll :: Bool | ||
, buildCommandGui :: Bool | ||
, buildCommandCore :: Bool | ||
, buildCommandOrchestrator :: Bool | ||
, buildCommandRun :: Bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Contributing to HaskellDO | ||
|
||
# Getting Started | ||
* Create a [GitHub](https://github.com) account if you do not already have one | ||
* Check if a ticket for your issue exists, if not create one | ||
* Make sure your ticket details the issue and the steps to reproduce the bug | ||
* If your ticket proposes a new feature for haskell.do, please provide an explanation of the feature, what problem it solves, and possible use cases | ||
* Fork the repository on GitHub | ||
|
||
# Changing HaskellDO | ||
* Create a branch from `master` to work on your feature with a descriptive name | ||
* Make commits frequently with descriptive comments (detailed below) | ||
* Add tests to ensure proper functionality | ||
* Please do not submit until all tests are passed | ||
|
||
Commit messages should stick to the following format: `(issue number) issue name description` | ||
|
||
E.g: | ||
|
||
``` | ||
Example issue | ||
Steps to recreate: | ||
- Put toast in oven | ||
- Turn oven off | ||
- ???? | ||
An issue would then here go into detail describing the issue, and perhaps even suggesting a fix | ||
``` | ||
|
||
# Making Small Changes | ||
When changing things like documentation, it is not always necessary to create a ticket. Instead simply add the documentation, and send a PR with a message of the following form: | ||
|
||
``` | ||
(doc) Added documentation to <file-name> | ||
<file-name> lacked proper documentation on how <function> works. | ||
This commit adds documentation describing <function>, and provides various examples. | ||
``` | ||
|
||
# Submitting Changes | ||
* Push your changes to the branch in your fork of the repository | ||
* Submit a pull request | ||
* The haskell.do team will review your PR as quickly and provide feedback | ||
* After receiving feedback, either make the required changes, or your branch will be merged | ||
|
||
Thanks for contributing to haskell.do, happy hacking! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Haskell.do | ||
|
||
Copyright 2016-2017 The Agile Monkeys S.L. | ||
|
||
This product includes software developet at | ||
The Agile Monkeys S.L. (http://www.theagilemonkeys.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
![Banner](static/out.jsexe/banner.png) | ||
|
||
[![Gitter](https://badges.gitter.im/theam/haskell-do.svg)](https://gitter.im/theam/haskell-do?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
[![Build Status](https://travis-ci.org/theam/haskell-do.svg?branch=develop)](https://travis-ci.org/theam/haskell-do) | ||
|
||
[haskell.do](haskell.do) is a Haskell code editor, centered around interactive development. You can get it on [the website](haskell.do). | ||
|
||
Pull Requests are greatly appreciated, check out [our contributing guidelines](CONTRIBUTING.md). | ||
|
||
## Building from source | ||
|
||
The only *3rd-party* requirements to build [haskell.do](haskell.do) are [Stack](http://haskellstack.org/) and [NodeJS](https://nodejs.org/) (due to GHCJS). | ||
|
||
`git clone https://github.com/theam/haskell-do && cd haskell-do` | ||
|
||
`stack Build.hs -h` for detailed usage of the build file. | ||
|
||
`stack Build.hs -a` for building project. | ||
|
||
`stack Build.hs -r` for running [haskell.do](haskell.do) on port `8080`. | ||
|
||
## Contributing | ||
|
||
Wanna contribute? Make sure that you've read our [contributor guidelines](https://github.com/theam/haskell-do/blob/master/CONTRIBUTING.md). | ||
We'd like to hear from you and your ideas, get in touch with other contributors through: | ||
|
||
- [Gitter](https://gitter.im/theam/haskell-do) | ||
- [The issues page](https://github.com/theam/haskell-do/blob/master/CONTRIBUTING.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
resolver: lts-7.19 | ||
compiler: ghcjs-0.2.1.9007019_ghc-8.0.1 | ||
compiler-check: match-exact | ||
|
||
setup-info: | ||
ghcjs: | ||
source: | ||
ghcjs-0.2.1.9007019_ghc-8.0.1: | ||
url: http://ghcjs.tolysz.org/ghc-8.0-2017-02-05-lts-7.19-9007019.tar.gz | ||
sha1: d2cfc25f9cda32a25a87d9af68891b2186ee52f9 | ||
|
||
packages: | ||
- location: '.' | ||
- extra-dep: true | ||
location: | ||
git: https://github.com/transient-haskell/transient | ||
commit: f38fd2869b045564445edcc0fa3274490a750219 | ||
- extra-dep: true | ||
location: | ||
git: https://github.com/transient-haskell/transient-universe | ||
commit: f5ce492ff31808e05dca85957f9ce6a1a48c7a62 | ||
- extra-dep: true | ||
location: | ||
git: https://github.com/geraldus/ghcjs-perch | ||
commit: 6c238f6ab9624eb1e950059d602aaff35446476b | ||
- extra-dep: true | ||
location: | ||
git: https://github.com/transient-haskell/axiom | ||
commit: ee39119817ff05ed7385ced4c8c0e7ee0ed7f682 | ||
|
||
|
||
extra-deps: [] | ||
|
||
flags: {} | ||
|
||
extra-package-dbs: [] |
Oops, something went wrong.