mirror of
https://github.com/github/semantic.git
synced 2025-01-09 00:56:32 +03:00
Define a semantic-source package.
This commit is contained in:
parent
cc19d78d7c
commit
974e2ca0ea
@ -1,4 +1,4 @@
|
||||
packages: . semantic-core semantic-python
|
||||
packages: . semantic-core semantic-python semantic-source
|
||||
|
||||
jobs: $ncpus
|
||||
|
||||
|
21
semantic-source/LICENSE
Normal file
21
semantic-source/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2015-2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
18
semantic-source/README.md
Normal file
18
semantic-source/README.md
Normal file
@ -0,0 +1,18 @@
|
||||
# semantic-source
|
||||
|
||||
Types and functionality for working with source code (program text).
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
This project consists of a Haskell package named `semantic-source`. The library’s sources are in [`src`][].
|
||||
|
||||
Development of `semantic-source` is typically done using `cabal v2-build`:
|
||||
|
||||
```shell
|
||||
cabal v2-build # build the library
|
||||
cabal v2-repl # load the package into ghci
|
||||
cabal v2-test # build and run the doctests
|
||||
```
|
||||
|
||||
[`src`]: https://github.com/github/semantic/tree/master/semantic-source/src
|
2
semantic-source/Setup.hs
Normal file
2
semantic-source/Setup.hs
Normal file
@ -0,0 +1,2 @@
|
||||
import Distribution.Simple
|
||||
main = defaultMain
|
59
semantic-source/semantic-source.cabal
Normal file
59
semantic-source/semantic-source.cabal
Normal file
@ -0,0 +1,59 @@
|
||||
cabal-version: 2.4
|
||||
|
||||
name: semantic-source
|
||||
version: 0.0.0.0
|
||||
synopsis: Types and functionality for working with source code
|
||||
description: Types and functionality for working with source code (program text).
|
||||
homepage: https://github.com/github/semantic/tree/master/semantic-source#readme
|
||||
bug-reports: https://github.com/github/semantic/issues
|
||||
license: MIT
|
||||
license-file: LICENSE
|
||||
author: The Semantic authors
|
||||
maintainer: opensource+semantic@github.com
|
||||
copyright: (c) 2019 GitHub, Inc.
|
||||
category: Data
|
||||
build-type: Simple
|
||||
stability: alpha
|
||||
extra-source-files:
|
||||
README.md
|
||||
|
||||
|
||||
tested-with:
|
||||
GHC == 8.6.5
|
||||
|
||||
common common
|
||||
default-language: Haskell2010
|
||||
ghc-options:
|
||||
-Weverything
|
||||
-Wno-missing-local-signatures
|
||||
-Wno-missing-import-lists
|
||||
-Wno-implicit-prelude
|
||||
-Wno-safe
|
||||
-Wno-unsafe
|
||||
-Wno-name-shadowing
|
||||
-Wno-monomorphism-restriction
|
||||
-Wno-missed-specialisations
|
||||
-Wno-all-missed-specialisations
|
||||
-Wno-star-is-type
|
||||
|
||||
library
|
||||
import: common
|
||||
-- exposed-modules:
|
||||
-- other-modules:
|
||||
-- other-extensions:
|
||||
build-depends:
|
||||
base >= 4.12 && < 5
|
||||
hs-source-dirs: src
|
||||
|
||||
test-suite doctest
|
||||
import: common
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Doctest.hs
|
||||
build-depends:
|
||||
base
|
||||
, doctest >=0.7 && <1.0
|
||||
hs-source-dirs: test
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
location: https://github.com/github/semantic
|
12
semantic-source/test/Doctest.hs
Normal file
12
semantic-source/test/Doctest.hs
Normal file
@ -0,0 +1,12 @@
|
||||
module Main
|
||||
( main
|
||||
) where
|
||||
|
||||
import System.Environment
|
||||
import Test.DocTest
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
args <- getArgs
|
||||
autogen <- fmap (<> "/build/doctest/autogen") <$> lookupEnv "HASKELL_DIST_DIR"
|
||||
doctest (maybe id ((:) . ("-i" <>)) autogen ("-isemantic-source/src" : "--fast" : if null args then ["semantic-source/src"] else args))
|
Loading…
Reference in New Issue
Block a user