daml/rattle/MainScala.hs
Neil Mitchell bfa019997a
Prototype to accelerate Windows development (#411)
* Initial rattle prototype

* Build the IDE core

* Ignore the Rattle directory

* Clean up the dependencies

* Require stack-1.10, since that does much better extra-dep caching

* Streamline the ghc-lib dependencies

* Compile more pieces

* Add a build.bat

* Make the Windows build use the correct stack.yaml to bootstrap

* Fix up enough to build on Windows

* Generate the dylib's on Mac

* Remove accidental -v

* Make the Haskell build driven by the Bazel metadata

* Get proto3-suite building

* Delete the unneeded haskell-dependencies

* Allow generating the proto files and compiling them

* Fix metadata to deal with """ syntax

* Fix metadata to deal with a list of globs

* More work in the direction of daml-ghc

* Use correct daml_lf proto version

* Tell GHC to use shared objects in TH

* Specify needed packages

* wip

* wip

* Switch to the fork of gRPC-haskell

* Build executables with rattle

* setup build.sbt in daml-lf

* Build binaries with rattle

* rattle-sbt, move scala build scripts out of daml-lf subdir, and into rattle subdir

* convert scala-build.sh into MainScala.hs

* Clean up rattle build

* Pre-merge clean up

* Switch to the newer version of ghc-lib-parser

* remove dev ls from MainScala.hs

* compile java generated from protos as separate projects

* Add copyright headers

* HLint fixes

* Uscrewup an HLint fix

* fix scala formatting of rattle/build.sbt
2019-04-12 10:45:11 +01:00

38 lines
1.1 KiB
Haskell

-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
module MainScala(main) where
import Rattle
import Metadata
import Util
import Data.Char
import Data.Maybe
import System.IO.Extra
import System.Info.Extra
import System.Process.Extra
import System.FilePattern.Directory
import System.FilePath
import System.Directory
import System.Environment
import System.IO.Unsafe
import Control.Monad.Extra
import Data.List.Extra
bash :: String -> IO ()
bash s = cmd_ "bash" ["-v", "-c", s]
main :: IO ()
main = rattle $ do
putStrLn " ---- Starting SCALA rattle build ----"
bash "mkdir -p daml-lf/gen/for-archive/src/main/scala"
bash "(cd daml-lf/archive; protoc da/*.proto --java_out=../gen/for-archive/src/main/scala)"
bash "mkdir -p daml-lf/gen/for-transaction/src/main/scala"
bash "(cd daml-lf/transaction/src/main/protobuf; protoc com/digitalasset/daml/lf/*.proto --java_out=../../../../gen/for-transaction/src/main/scala)"
bash "cp rattle/build.sbt daml-lf"
bash "(cd daml-lf; sbt compile)"
--bash "(cd daml-lf; sbt test)"