From 3bb69f939df6b19a397a00fa6da71d163de8aec2 Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Tue, 21 May 2024 07:48:06 -0400 Subject: [PATCH] feat: Add copilot add script --- .gitignore | 8 +------- scripts/add-copilot.sh | 14 ++++++++++++++ scripts/copilot_lakefile.txt | 23 +++++++++++++++++++++++ 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100755 scripts/add-copilot.sh create mode 100644 scripts/copilot_lakefile.txt diff --git a/.gitignore b/.gitignore index eb3c204..d701102 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,4 @@ /build /lake-packages/* .lake/packages/* -.lake/build -# Section: To be ignored, except when updating Lean and MathLib versions -.lake/lakefile.olean -.lake/lakefile.olean.trace -lake-manifest.json -lakefile.lean -# End Section. \ No newline at end of file +.lake/build \ No newline at end of file diff --git a/scripts/add-copilot.sh b/scripts/add-copilot.sh new file mode 100755 index 0000000..8db5a88 --- /dev/null +++ b/scripts/add-copilot.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + + +cp ./scripts/copilot_lakefile.txt lakefile.lean + +lake update LeanCopilot + +lake exe LeanCopilot/download + +lake build + +echo ".........................................................................." +echo "Please do not push changes to the following files: lakefile.lean, .lake/lakefile.olean, + .lake/lakefile.olean.trace, lake-manifest.json." diff --git a/scripts/copilot_lakefile.txt b/scripts/copilot_lakefile.txt new file mode 100644 index 0000000..1c73ce2 --- /dev/null +++ b/scripts/copilot_lakefile.txt @@ -0,0 +1,23 @@ +import Lake +open Lake DSL + +package «hep_lean» { + -- add any package configuration options here +} + +require mathlib from git + "https://github.com/leanprover-community/mathlib4.git" + +@[default_target] +lean_lib «HepLean» { + -- add any library configuration options here + moreLinkArgs := #[ + "-L./.lake/packages/LeanCopilot/.lake/build/lib", + "-lctranslate2" + ] +} + +meta if get_config? env = some "dev" then -- dev is so not everyone has to build it +require «doc-gen4» from git "https://github.com/leanprover/doc-gen4" @ "main" + +require LeanCopilot from git "https://github.com/lean-dojo/LeanCopilot.git" @ "v1.2.1" \ No newline at end of file