From dc8097dae689b68e54b006c64cee4f8df59b4a14 Mon Sep 17 00:00:00 2001 From: tydeu Date: Sun, 24 Jul 2022 21:32:07 -0400 Subject: [PATCH] feat: support `pkg/` to disambiguate packages --- Lake/CLI/Build.lean | 4 +++- examples/targets/test.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Lake/CLI/Build.lean b/Lake/CLI/Build.lean index 1211f35502..7af8d33441 100644 --- a/Lake/CLI/Build.lean +++ b/Lake/CLI/Build.lean @@ -155,7 +155,9 @@ def resolveTargetBaseSpec (ws : Workspace) (spec : String) (facet : Name) : Exce | [pkgSpec, targetSpec] => let pkgSpec := if pkgSpec.startsWith "@" then pkgSpec.drop 1 else pkgSpec let pkg ← parsePackageSpec ws pkgSpec - if targetSpec.startsWith "+" then + if targetSpec.isEmpty then + resolvePackageTarget ws pkg facet + else if targetSpec.startsWith "+" then let mod := targetSpec.drop 1 |>.toName if let some mod := pkg.findModule? mod then resolveModuleTarget ws mod facet diff --git a/examples/targets/test.sh b/examples/targets/test.sh index c7b341c74e..9b26b85b1a 100755 --- a/examples/targets/test.sh +++ b/examples/targets/test.sh @@ -27,7 +27,7 @@ $LAKE build Bar:o test -f ./build/ir/Bar.o -$LAKE build +$LAKE build targets/ ./build/bin/c test -f ./build/lib/Foo.olean