Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ _build/
**/metals.sbt
**/.scala-build/*

daml/daml-ide-mono/daml/
daml/daml-ide-mono/.vscode/
.vscode/*
!.vscode/settings.json
# Make sure test files are checkedin
Expand Down
15 changes: 15 additions & 0 deletions daml/daml-ide-mono/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# What is this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this under daml/daml-ide-mono? feels a bit too niche for a top-level directory

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


This directory, along with its fake `daml.yaml` can be populated with symlinks by
`./scripts/setup-mono-package.sh` to serve as a fake single-dar package containing all the daml in
Splice such that cross-package changes can be worked on with a tighter feedback loop using the
Daml Language Server (LSP) in VS Code or other editors, e.g. by running `dpm studio` in this directory
after having run the script.

You'll also have to remember to re-run the script if you add new `.daml` files to any package.

You should still verify that everything builds/tests for real once you're done of course, but this mode
of interaction can be very useful to eliminate 12-20 second build cycles and instead get immediate
feedback from the VS Code extension when working on tests and making changes that would otherwise be in
their upstream DAR dependencies, for example.

17 changes: 17 additions & 0 deletions daml/daml-ide-mono/daml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sdk-version: 3.5.2
name: splice-mono-ide
source: daml
version: 0.0.1
dependencies:
- daml-prim
- daml-stdlib
- daml-script
build-options:
- --ghc-option=-Wunused-binds
- --ghc-option=-Wunused-matches
- --target=2.1
- -Wno-upgrade-exceptions
- -Wno-deprecated-exceptions
- -Wno-template-interface-depends-on-daml-script
- -Wno-upgrade-interfaces
- --force-utility-package=no
1 change: 1 addition & 0 deletions docs/gen-daml-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ DAML_PROJECT_FILES="\
-not -ipath '*splitwell*' \
-not -ipath '*app-manager*' \
-not -ipath '*dummy-holding*' \
-not -ipath '*daml-ide-mono*' \
-print)"
DAML_PROJECT_FILES=$(printf "%s\n" "$DAML_PROJECT_FILES" | grep -vf <(printf "%s\n" "${NON_COMPILED_DAML_PROJECTS[@]}" | xargs -n1 basename))

Expand Down
2 changes: 1 addition & 1 deletion scripts/rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ function subcmd_no_illegal_daml_references() {
)
for pattern in "${illegal_patterns[@]}"; do
echo "Checking for occurences of '$pattern' (case sensitive, in code other than splitwell)"
if rg -P "$pattern" daml/ token-standard/ -g '!*/splitwell/*' -g '!*/splitwell-test/*' -g '!daml/dars.lock' -g '!token-standard/README.md' -g '!token-standard/V2_VALIDATION.md' -g '!token-standard/TOKEN_STANDARD_V2_DEVNET.md' -g '!*.json' -g '!token-standard/dependencies/*' -g '!**/target/'; then
if rg -P "$pattern" daml/ token-standard/ -g '!*/splitwell/*' -g '!*/splitwell-test/*' -g '!daml/dars.lock' -g '!token-standard/README.md' -g '!token-standard/V2_VALIDATION.md' -g '!token-standard/TOKEN_STANDARD_V2_DEVNET.md' -g'!daml/daml-ide-mono/README.md' -g '!*.json' -g '!token-standard/dependencies/*' -g '!**/target/'; then
echo "$pattern occurs in Daml code (other than splitwell), remove all references"
exit 1
fi
Expand Down
34 changes: 34 additions & 0 deletions scripts/setup-mono-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Populate daml/daml-ide-mono/daml/ with per-file symlinks into every
# workspace Daml package's source tree. daml/daml-ide-mono/daml.yaml is
# checked in and static - this script only regenerates the source tree
# so that VS Code can work on the union as a single package.
#
# Re-run this any time a .daml file is added or removed anywhere in the
# workspace.

set -euo pipefail

repo=$(cd "$(dirname "$0")/.." && pwd)
dest="$repo/daml/daml-ide-mono/daml"

rm -rf "$dest"
mkdir -p "$dest"

for pkg in "$repo"/daml/*/daml.yaml \
"$repo"/token-standard/*/daml.yaml \
"$repo"/token-standard/examples/*/daml.yaml; do
src=$(dirname "$pkg")/daml
[ -d "$src" ] || continue
( cd "$src" && find . -name '*.daml' -printf '%P\n' ) |
while IFS= read -r rel; do
link="$dest/$rel"
mkdir -p "$(dirname "$link")"
target=$(realpath --relative-to="$(dirname "$link")" "$src/$rel")
ln -sfn "$target" "$link"
done
done
Loading