refactor: move main into Lake.Main which is not imported by Lake
This commit is contained in:
parent
1d052a1b39
commit
efadebd5ef
4 changed files with 43 additions and 11 deletions
35
Lake.lean
35
Lake.lean
|
|
@ -1,16 +1,29 @@
|
|||
/-
|
||||
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Gabriel Ebner, Sebastian Ullrich, Mac Malone
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
import Lake.Async
|
||||
import Lake.BuildBin
|
||||
import Lake.BuildModule
|
||||
import Lake.BuildMonad
|
||||
import Lake.BuildPackage
|
||||
import Lake.BuildTarget
|
||||
import Lake.BuildTargets
|
||||
import Lake.BuildTop
|
||||
import Lake.Cli
|
||||
import Lake.CliT
|
||||
import Lake.Compile
|
||||
import Lake.Git
|
||||
import Lake.Glob
|
||||
import Lake.Help
|
||||
import Lake.Init
|
||||
import Lake.LeanConfig
|
||||
import Lake.LeanVersion
|
||||
import Lake.Package
|
||||
import Lake.Resolve
|
||||
import Lake.SearchPath
|
||||
|
||||
def main (args : List String) : IO UInt32 := do
|
||||
try
|
||||
Lake.setupLeanSearchPath
|
||||
Lake.cli args
|
||||
pure 0
|
||||
catch e =>
|
||||
IO.eprintln <| "error: " ++ toString e -- avoid "uncaught exception: ..."
|
||||
pure 1
|
||||
import Lake.Target
|
||||
import Lake.Task
|
||||
import Lake.Trace
|
||||
import Lake.Version
|
||||
|
|
|
|||
16
Lake/Main.lean
Normal file
16
Lake/Main.lean
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/-
|
||||
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Gabriel Ebner, Sebastian Ullrich, Mac Malone
|
||||
-/
|
||||
import Lake.Cli
|
||||
import Lake.SearchPath
|
||||
|
||||
def main (args : List String) : IO UInt32 := do
|
||||
try
|
||||
Lake.setupLeanSearchPath
|
||||
Lake.cli args
|
||||
pure 0
|
||||
catch e =>
|
||||
IO.eprintln <| "error: " ++ toString e -- avoid "uncaught exception: ..."
|
||||
pure 1
|
||||
|
|
@ -7,6 +7,7 @@ def package : PackageConfig := {
|
|||
srcDir := FilePath.mk ".." / ".."
|
||||
oleanDir := "."
|
||||
leancArgs := #["-O3", "-DNDEBUG"]
|
||||
binRoot := `Lake.Main
|
||||
linkArgs :=
|
||||
if Platform.isWindows then
|
||||
#["-Wl,--export-all"]
|
||||
|
|
|
|||
|
|
@ -1 +1,3 @@
|
|||
set -ex
|
||||
${LAKE:-../../build/bin/lake} build-lib
|
||||
${LAKE:-../../build/bin/lake} build-bin
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue