2024-10-20 16:17:37 +09:00
|
|
|
import Lake
|
|
|
|
open Lake DSL
|
|
|
|
|
|
|
|
meta if get_config? env = some "dev" then -- dev is so not everyone has to build it
|
2024-10-21 12:37:11 +09:00
|
|
|
require "leanprover" / "doc-gen4"
|
2024-10-20 16:17:37 +09:00
|
|
|
|
|
|
|
package "doug" where
|
|
|
|
version := v!"0.1.0"
|
|
|
|
|
|
|
|
lean_lib «Doug» where
|
|
|
|
-- add library configuration options here
|
|
|
|
|
|
|
|
@[default_target]
|
|
|
|
lean_exe "doug" where
|
|
|
|
root := `Main
|
|
|
|
|
|
|
|
/--
|
|
|
|
Doug
|
|
|
|
-/
|
|
|
|
script test (args) do
|
2024-10-21 12:37:11 +09:00
|
|
|
let exe := (← doug.get).file
|
|
|
|
IO.println s!"exe: {exe}"
|
|
|
|
IO.println s!"args: {args}"
|
|
|
|
let proc ← IO.Process.spawn
|
|
|
|
⟨{stdin := .inherit, stdout := .piped, stderr := .piped},
|
|
|
|
exe.toString, args.toArray, none, #[], false ⟩
|
|
|
|
IO.println s!"{← proc.tryWait}"
|
|
|
|
IO.print (← proc.stdout.readToEnd)
|
|
|
|
IO.eprintln (← IO.FS.Handle.readToEnd proc.stderr)
|
|
|
|
let ret ← proc.wait
|
|
|
|
IO.println s!"returned: {ret}"
|
|
|
|
pure ret
|