diff --git a/.gitignore b/.gitignore index 3ec510d..20c60d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /build -/lean_packages/* -!/lean_packages/manifest.json +/lake-packages/* diff --git a/DocGen4/Load.lean b/DocGen4/Load.lean index 07b4d97..fc2ef09 100644 --- a/DocGen4/Load.lean +++ b/DocGen4/Load.lean @@ -13,7 +13,6 @@ import Lean.Data.HashMap namespace DocGen4 open Lean System IO - /-- Sets up a lake workspace for the current project. Furthermore initialize the Lean search path with the path to the proper compiler from lean-toolchain @@ -21,7 +20,8 @@ as well as all the dependencies. -/ def lakeSetup : IO (Except UInt32 Lake.Workspace) := do let (leanInstall?, lakeInstall?) ← Lake.findInstall? - match ←(EIO.toIO' <| Lake.mkLoadConfig {leanInstall?, lakeInstall?}) with + let config := Lake.mkLoadConfig.{0} {leanInstall?, lakeInstall?} + match ←(EIO.toIO' config) with | .ok config => let ws : Lake.Workspace ← Lake.loadWorkspace config |>.run Lake.MonadLog.eio diff --git a/DocGen4/Output/SourceLinker.lean b/DocGen4/Output/SourceLinker.lean index dd3ba56..30c0657 100644 --- a/DocGen4/Output/SourceLinker.lean +++ b/DocGen4/Output/SourceLinker.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Henrik Böving -/ import Lean -import Lake +import Lake.Load namespace DocGen4.Output @@ -65,8 +65,8 @@ def sourceLinker (ws : Lake.Workspace) : IO (Name → Option DeclarationRange |>.run (Lake.MonadLog.eio .normal) |>.toIO (λ _ => IO.userError "Failed to load lake manifest") for pkg in manifest.toArray do - let value := (getGithubBaseUrl pkg.url, pkg.rev) - gitMap := gitMap.insert pkg.name value + if let .git _ url rev .. := pkg then + gitMap := gitMap.insert pkg.name (getGithubBaseUrl url, rev) pure λ module range => let parts := module.components.map Name.toString diff --git a/lake-manifest.json b/lake-manifest.json new file mode 100644 index 0000000..b546371 --- /dev/null +++ b/lake-manifest.json @@ -0,0 +1,32 @@ +{"version": 3, + "packages": + [{"git": + {"url": "https://github.com/mhuisi/lean4-cli", + "subDir?": null, + "rev": "5a858c32963b6b19be0d477a30a1f4b6c120be7e", + "name": "Cli", + "inputRev?": "nightly"}}, + {"git": + {"url": "https://github.com/hargonix/LeanInk", + "subDir?": null, + "rev": "9f3101452135964ac9107ec8e9910bfd14022bbc", + "name": "leanInk", + "inputRev?": "doc-gen"}}, + {"git": + {"url": "https://github.com/xubaiw/Unicode.lean", + "subDir?": null, + "rev": "6dd6ae3a3839c8350a91876b090eda85cf538d1d", + "name": "Unicode", + "inputRev?": "main"}}, + {"git": + {"url": "https://github.com/leanprover/lake", + "subDir?": null, + "rev": "051cf403f12da80a44802810d9098f2bbed61d93", + "name": "lake", + "inputRev?": "master"}}, + {"git": + {"url": "https://github.com/xubaiw/CMark.lean", + "subDir?": null, + "rev": "2cc7cdeef67184f84db6731450e4c2b258c28fe8", + "name": "CMark", + "inputRev?": "main"}}]} diff --git a/lean-toolchain b/lean-toolchain index 042d8d2..a287eeb 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:nightly-2022-11-21 +leanprover/lean4:nightly-2022-11-30 diff --git a/lean_packages/manifest.json b/lean_packages/manifest.json deleted file mode 100644 index 7a6d443..0000000 --- a/lean_packages/manifest.json +++ /dev/null @@ -1,22 +0,0 @@ -{"version": 2, - "packages": - [{"url": "https://github.com/mhuisi/lean4-cli", - "rev": "5a858c32963b6b19be0d477a30a1f4b6c120be7e", - "name": "Cli", - "inputRev": "nightly"}, - {"url": "https://github.com/hargonix/LeanInk", - "rev": "9f3101452135964ac9107ec8e9910bfd14022bbc", - "name": "leanInk", - "inputRev": "doc-gen"}, - {"url": "https://github.com/xubaiw/Unicode.lean", - "rev": "6dd6ae3a3839c8350a91876b090eda85cf538d1d", - "name": "Unicode", - "inputRev": "main"}, - {"url": "https://github.com/leanprover/lake", - "rev": "004034496ef84b21976a940edc65f335340bd2ec", - "name": "lake", - "inputRev": "master"}, - {"url": "https://github.com/xubaiw/CMark.lean", - "rev": "2cc7cdeef67184f84db6731450e4c2b258c28fe8", - "name": "CMark", - "inputRev": "main"}]}