From e07d63f28410cc325f2956cdb71f97a5be8b0f27 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Wed, 9 Oct 2019 12:56:50 -0700 Subject: [PATCH 1/3] Java as code nav language; update javaParser --- src/Data/Language.hs | 2 +- src/Parsing/Parser.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Data/Language.hs b/src/Data/Language.hs index 8c3571198..8eaf0150e 100644 --- a/src/Data/Language.hs +++ b/src/Data/Language.hs @@ -104,7 +104,7 @@ supportedExts = foldr append mempty supportedLanguages lookup k = Map.lookup k Lingo.languages codeNavLanguages :: [Language] -codeNavLanguages = [Go, Ruby, Python, JavaScript, TypeScript, PHP] +codeNavLanguages = [Go, Java, Ruby, Python, JavaScript, TypeScript, PHP] pathIsMinified :: FilePath -> Bool pathIsMinified = isExtensionOf ".min.js" diff --git a/src/Parsing/Parser.hs b/src/Parsing/Parser.hs index e1dce746f..316dc2eaf 100644 --- a/src/Parsing/Parser.hs +++ b/src/Parsing/Parser.hs @@ -180,7 +180,7 @@ goParser' :: c (Term (Sum Go.Syntax)) => (Language, SomeParser c Loc) goParser' = (Go, SomeParser goParser) javaParser' :: c PreciseJava.Term => (Language, SomeParser c Loc) -javaParser' = (Python, SomeParser javaParserPrecise) +javaParser' = (Java, SomeParser javaParserPrecise) javascriptParser' :: c (Term (Sum TSX.Syntax)) => (Language, SomeParser c Loc) javascriptParser' = (JavaScript, SomeParser tsxParser) From 0c5dbadc05fc61cf8f32979164b2468acabe6e31 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Wed, 9 Oct 2019 14:21:59 -0700 Subject: [PATCH 2/3] Update Language spec --- test/Data/Language/Spec.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Data/Language/Spec.hs b/test/Data/Language/Spec.hs index 08e32cf18..dcc2a8c01 100644 --- a/test/Data/Language/Spec.hs +++ b/test/Data/Language/Spec.hs @@ -7,7 +7,7 @@ import Test.Tasty.HUnit testTree :: TestTree testTree = testGroup "Data.Language" [ testCase "supportedExts returns expected list" $ - supportedExts @=? [".go",".rb",".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".rabl",".rake",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr",".py",".bzl",".cgi",".fcgi",".gyp",".gypi",".lmi",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".spec",".tac",".wsgi",".xpy",".js","._js",".bones",".es",".es6",".frag",".gs",".jake",".jsb",".jscad",".jsfl",".jsm",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".ts",".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"] + supportedExts @=? [".go",".java",".rb",".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".rabl",".rake",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr",".py",".bzl",".cgi",".fcgi",".gyp",".gypi",".lmi",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".spec",".tac",".wsgi",".xpy",".js","._js",".bones",".es",".es6",".frag",".gs",".jake",".jsb",".jscad",".jsfl",".jsm",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".ts",".php",".aw",".ctp",".fcgi",".inc",".php3",".php4",".php5",".phps",".phpt"] , testCase "codeNavLanguages returns expected list" $ - codeNavLanguages @=? [Go, Ruby, Python, JavaScript, TypeScript, PHP] + codeNavLanguages @=? [Go, Java, Ruby, Python, JavaScript, TypeScript, PHP] ] From 02b63fb0eb6d4e0e1753fbf0a892581662872cab Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Thu, 10 Oct 2019 13:35:00 -0700 Subject: [PATCH 3/3] Get build working again in Dockerfile --- Dockerfile | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1672f74b1..c68bd4d4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Put protoc and twirp tooling in its own image FROM haskell:8.6 as haskell -RUN cabal new-update hackage.haskell.org,HEAD -RUN cabal new-install proto-lens-protoc +RUN cabal v2-update && \ + cabal v2-install proto-lens-protoc RUN which proto-lens-protoc FROM golang:1.13-stretch AS protoc @@ -22,18 +22,23 @@ ENTRYPOINT ["/protobuf/bin/protoc", "-I/protobuf", "--plugin=protoc-gen-haskell= FROM haskell:8.6 as build WORKDIR /build -# Build and cache the dependencies first so we can cache these layers. +# Build just the dependencies so that this layer can be cached COPY semantic.cabal . -COPY semantic-core semantic-core -RUN cabal new-update hackage.haskell.org,HEAD -RUN cabal new-configure semantic semantic-core -RUN cabal new-build --only-dependencies +COPY semantic-core semantic-core/ +COPY semantic-java semantic-java/ +COPY semantic-json semantic-json/ +COPY semantic-python semantic-python/ +COPY semantic-source semantic-source/ +COPY semantic-tags semantic-tags/ +COPY cabal.project . +RUN cabal v2-update && \ + cabal v2-build --flags="release" --only-dependencies -# Copy in and build the entire project +# Build all of semantic COPY . . -RUN cabal new-build --flags="release" semantic:exe:semantic +RUN cabal v2-build --flags="release" semantic:exe:semantic -# A fake `install` target until we can get `cabal new-install` to work +# A fake `install` target until we can get `cabal v2-install` to work RUN cp $(find dist-newstyle/build/x86_64-linux -name semantic -type f -perm -u=x) /usr/local/bin/semantic # Create a fresh image containing only the compiled CLI program, so that the