mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
d3106682dd
* Add a REPL for each Scala target, for debugging. For each Scala library target, this adds a `*_repl` target that can be built and run to provide a Scala REPL with access to the library and all its dependencies. To use: ``` $ bazel build //ledger/ledger-on-memory:ledger-on-memory_repl INFO: Invocation ID: f1c4ec07-68e7-4bc2-a182-40f6ea035110 INFO: Analyzed target //ledger/ledger-on-memory:ledger-on-memory_repl (32 packages loaded, 714 targets configured). INFO: Found 1 target... Target //ledger/ledger-on-memory:ledger-on-memory_repl up-to-date: bazel-bin/ledger/ledger-on-memory/ledger-on-memory_repl.jar bazel-bin/ledger/ledger-on-memory/ledger-on-memory_repl INFO: Build completed successfully, 7 total actions $ ./bazel-bin/ledger/ledger-on-memory/ledger-on-memory_repl Welcome to Scala 2.12.13 (OpenJDK 64-Bit Server VM, Java 1.8.0_272). Type in expressions for evaluation. Or try :help. scala> import scala.concurrent.ExecutionContext.Implicits.global scala> import com.google.protobuf.ByteString scala> import com.daml.ledger.on.memory._ scala> import com.daml.ledger.participant.state.kvutils.OffsetBuilder scala> import com.daml.ledger.participant.state.kvutils.Raw scala> import com.daml.ledger.participant.state.kvutils.api.LedgerRecord scala> val state = InMemoryState.empty state: com.daml.ledger.on.memory.InMemoryState = com.daml.ledger.on.memory.InMemoryState@ff21443 scala> state.write { (log, state) => Future { log += LedgerRecord(OffsetBuilder.fromLong(1), Raw.LogEntryId(ByteString.copyFromUtf8("A")), Raw.Envelope(ByteString.EMPTY)) } } ``` The REPL target has the tag "manual", so will only be built on demand. CHANGELOG_BEGIN CHANGELOG_END * Turns out you can run a REPL with `bazel run`. |
||
---|---|---|
.. | ||
client_server | ||
dev_env_tool | ||
java_testing | ||
packaging | ||
runfiles | ||
sh | ||
absl-mingw.patch | ||
build_environment.bzl | ||
BUILD.bazel | ||
create_workspace.bzl | ||
fat_cc_library.bzl | ||
ghc_dwarf.bzl | ||
grpc-bazel-apple.patch | ||
grpc-bazel-mingw.patch | ||
grpc-haskell-core-cpp-options.patch | ||
grpc-haskell-core-upgrade.patch | ||
haskell_proto3_suite_deriving_defaults.patch | ||
haskell-c2hs.patch | ||
haskell-cc-wrapper-windows.patch | ||
haskell-ghcide-binary-q.patch | ||
haskell-ghcide-expose-compat.patch | ||
haskell-hie-bios.patch | ||
haskell-js-dgtable.patch | ||
haskell-js-flot.patch | ||
haskell-js-jquery.patch | ||
haskell-lsp-test-no-reexport.patch | ||
haskell-opt.patch | ||
haskell-shake.patch | ||
haskell-strict-source-names.patch | ||
haskell-windows-extra-libraries.patch | ||
haskell-windows-remove-fake-libs.patch | ||
haskell-zip.patch | ||
haskell.bzl | ||
hlint.bzl | ||
java.bzl | ||
javadoc_library.bzl | ||
nixpkgs-disable-http2.patch | ||
oracle.bzl | ||
os_info.bzl | ||
pkg.bzl | ||
pom_file.bzl | ||
pom_template.xml | ||
proto.bzl | ||
protobuf-win32.patch | ||
remote_apis_no_services.patch | ||
rules_nodejs_bash.patch | ||
rules_nodejs_node_dependency.patch | ||
rules_nodejs_npm_cli_path.patch | ||
rules_scala_suite_tags.patch | ||
rules-nixpkgs-llvm-cov.patch | ||
scala_version.bzl | ||
scala-escape-jvmflags.patch | ||
scala.bzl |