1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 22:28:10 +03:00

Move code generated from protos into separate package

This commit is contained in:
Timothy Clem 2020-06-04 09:26:11 -07:00
parent e485681b1a
commit 4a1de42deb
10 changed files with 96 additions and 9 deletions

View File

@ -11,13 +11,14 @@ packages: .
semantic-json
semantic-parse
semantic-php
semantic-proto
semantic-python
semantic-ruby
semantic-rust
semantic-scope-graph
semantic-tags
semantic-tsx
semantic-typescript
semantic-tags
semantic-rust
-- Packages brought in from other repos instead of hackage
-- ATTENTION: remember to update cabal.project.ci when bumping SHAs here!

View File

@ -16,6 +16,6 @@ export PROJECT="github.com/github/semantic"
# Dockerfile for where the protoc pluggins are configured.
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/go/src/$PROJECT -w /go/src/$PROJECT \
semantic-protoc --proto_path=proto \
--haskell_out=./src \
--jsonpb_haskell_out=./src \
--haskell_out=./semantic-proto/src \
--jsonpb_haskell_out=./semantic-proto/src \
semantic.proto

21
semantic-proto/LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 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-proto/README.md Normal file
View File

@ -0,0 +1,18 @@
# semantic-proto
Datatypes generated from the protobuf schema
## Development
This project consists of a Haskell package named `semantic-proto`. The librarys sources are in [`src`][].
Development of `semantic-proto` 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-proto/src

2
semantic-proto/Setup.hs Normal file
View File

@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain

View File

@ -0,0 +1,48 @@
cabal-version: 2.4
name: semantic-proto
version: 0.0.0.0
synopsis: Datatypes generated from protobuf schema
description: Datatypes generated from protobuf schema
homepage: https://github.com/github/semantic/tree/master/semantic-proto#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: Language
build-type: Simple
stability: alpha
extra-source-files: README.md
tested-with: GHC == 8.6.5
library
exposed-modules:
Proto.Semantic
, Proto.Semantic_Fields
, Proto.Semantic_JSON
build-depends:
base >= 4.13 && < 5
, aeson ^>= 1.4.2.0
, text ^>= 1.2.3.1
, proto-lens >= 0.5 && < 0.7
, proto-lens-jsonpb
, proto-lens-runtime >= 0.5 && <0.7
hs-source-dirs: src
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
if (impl(ghc >= 8.8))
ghc-options: -Wno-missing-deriving-strategies

View File

@ -214,9 +214,6 @@ library
-- High-level flow & operational functionality (logging, stats, etc.)
, Semantic.Analysis
-- API
, Proto.Semantic
, Proto.Semantic_Fields
, Proto.Semantic_JSON
, Semantic.Api
, Semantic.Api.Bridge
, Semantic.Api.Diffs
@ -274,8 +271,6 @@ library
, pretty-show ^>= 1.9.5
, profunctors ^>= 5.3
, proto-lens >= 0.5 && < 0.7
, proto-lens-jsonpb
, proto-lens-runtime >= 0.5 && <0.7
, reducers ^>= 3.12.3
, semantic-go ^>= 0
, semantic-java ^>= 0
@ -284,6 +279,7 @@ library
, semantic-python ^>= 0
, semantic-codeql ^>= 0
, semantic-ruby ^>= 0
, semantic-proto ^>= 0
, semantic-scope-graph ^>= 0
, semantic-tags ^>= 0
, semantic-tsx ^>= 0
@ -381,6 +377,7 @@ test-suite parse-examples
, foldl ^>= 1.4.5
, lens >= 4.17 && < 4.19
, resourcet ^>= 1.2
, semantic-proto ^>= 0
, streaming
, streaming-bytestring ^>= 0.1.6
, tasty