### Install BSP Configuration Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Install the Build Server Protocol (BSP) configuration file for IDE integration. ```shell # write BSP config file deder bsp install ``` -------------------------------- ### Early-access Client Installation Source: https://github.com/sake92/deder/blob/main/README.md Installs an early-access client by downloading a JAR or native version, renaming it, making it executable, and adding it to the PATH. ```shell 1. download `deder-client.jar` (or a native version) from [early release](https://github.com/sake92/deder/releases/tag/early-access) 1. rename it to just `deder` 1. do `chmod +x deder` 1. put it in `PATH` ``` -------------------------------- ### Set up Grafana LGTM Collector Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/otel.md Clone the Grafana LGTM Docker repository and run the setup script to start the collector. This provides a local environment for viewing traces, logs, and metrics. ```shell git clone git@github.com:grafana/docker-otel-lgtm.git cd docker-otel-lgtm ./run-lgtm.sh ``` -------------------------------- ### Set up Jaeger Collector Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/otel.md Run a Jaeger Docker container to collect and visualize distributed traces. This is a simple way to get started with OTEL tracing. ```shell docker run --rm --name jaeger \ -p 16686:16686 \ -p 4317:4317 \ -p 4318:4318 \ -p 5778:5778 \ -p 9411:9411 \ cr.jaegertracing.io/jaegertracing/jaeger:2.14.0 ``` -------------------------------- ### Hash Chain Example Source: https://github.com/sake92/deder/blob/main/docs/content/reference/caching.md Illustrates the flow of hashes in a typical task graph, showing how output hashes from one task become inputs for the next. ```text SourceFileTask (CachedTask leaf) ──► outputHash = hash(file contents) │ ▼ compileClasspath (CachedTask) ──────► inputsHash = hash(dep outputHashes) │ outputHash = hash(result) ▼ compile (CachedTask) ───────────────► skips if its inputs are unchanged outputHash = hash(classes dir) │ ▼ assembly (CachedTask) ──────────────► skips if compile's outputHash unchanged ``` -------------------------------- ### Install Deder on Windows Source: https://github.com/sake92/deder/blob/main/README.md Installs Deder using Scoop by adding the custom bucket and installing the package. ```shell scoop bucket add sake92 https://github.com/sake92/scoop-bucket.git scoop install deder ``` -------------------------------- ### Dependency Tree Analysis Example Output Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Example output from the `depsTree` task, illustrating total size, version conflicts, and dependency structure. ```text Dependency Tree for module: core Total size: 245MB ⚠️ Conflicts: 1 Direct Dependencies: └── org.junit.jupiter:junit-jupiter-api:5.9.2 (2.1MB | 3.3MB) ├── org.opentest4j:opentest4j:1.2.1 (95KB | 95KB) └── org.junit.platform:junit-platform-commons:1.9.2 (1.2MB | 1.2MB) ⚠️ Version Conflicts: org.opentest4j:opentest4j: • 1.2.0 • 1.2.1 ➜ Resolved: 1.2.1 ``` -------------------------------- ### Install Shell Completions Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Install shell completions for Deder. Supports bash, zsh, and fish shells. ```shell deder complete -s bash -o > ~/.local/share/bash-completion/completions/deder # open another shell to test it # also supports zsh, fish, powershell ``` -------------------------------- ### Create Deder Build File Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/quickstart.md Create a `deder.pkl` file in your project root to define your project's modules and build configurations. This example sets up a Scala module with specified Scala version, main class, and test dependencies. ```pkl amends "https://sake92.github.io/deder/config/early-access/DederProject.pkl" local const myModules = new CreateScalaModules { root = "my-module" template = new { scalaVersion = "3.7.4" mainClass = "mymodule.Main" } testTemplate = (template.asTest()) { deps { "org.scalameta::munit:1.2.1" } } }.get modules { ...myModules } ``` -------------------------------- ### Run Vite for Frontend Development Source: https://github.com/sake92/deder/blob/main/examples/scalajs/README.md Start the Vite development server. This command is used to serve and reload the frontend application when changes are detected. ```shell npm run dev ``` -------------------------------- ### Install Deder on macOS and Linux Source: https://github.com/sake92/deder/blob/main/README.md Installs Deder using Homebrew by tapping the repository and installing the package. ```shell brew tap sake92/tap brew install deder ``` -------------------------------- ### Install Deder BSP Source: https://github.com/sake92/deder/blob/main/docs/content/index.md Installs the Build Server Protocol (BSP) for Deder, enabling IDE integration with VSCode or IntelliJ. ```shell deder bsp install ``` -------------------------------- ### Disable Default Repositories and Add Custom Source: https://github.com/sake92/deder/blob/main/docs/content/reference/repositories.md Turn off Deder's default repositories and explicitly define your own, useful for air-gapped or strict internal setups. ```pkl repositories { new MavenRepository { url = "https://nexus.mycompany.com/repository/maven-public/" } } includeDefaultRepos = false ``` -------------------------------- ### Execute REPL Task Source: https://github.com/sake92/deder/blob/main/docs/content/reference/tasks.md Starts an interactive REPL for Scala or JShell depending on the module type. This task is always run. ```shell deder exec -t repl -m mymodule ``` -------------------------------- ### Task Construction with Deder Source: https://github.com/sake92/deder/blob/main/AGENTS.md Example of constructing a task using the fluent TaskBuilder API, specifying dependencies and the execution logic. ```scala TaskBuilder.make[T]("name").dependsOn(otherTask).build { ctx => ... } ``` -------------------------------- ### Deder Test Filtering Examples Source: https://github.com/sake92/deder/blob/main/docs/content/reference/tasks.md Examples demonstrating how to filter tests using the 'deder exec' command. You can specify the module, a test suite prefix, or a specific test case. ```shell deder exec -t test -m mymodule-test # all tests in module ``` ```shell deder exec -t test -m mymodule-test com.example.% # suites matching prefix ``` ```shell deder exec -t test -m mymodule-test com.example.FooSuite#test1 # single test ``` -------------------------------- ### Implement DederPluginApi in Scala Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/plugins.md Example of implementing the `DederPluginApi` trait to define a custom plugin. The `init` method is called on plugin load to register new tasks. ```scala import ba.sake.deder.* class MyPluginImpl extends DederPluginApi: def id: String = "my-plugin" // Called on every (re)load. Return tasks to register, or Seq.empty for no tasks. def init(params: PluginInitParams): Either[String, Seq[AbstractTask[?]]] = val myTask = TaskBuilder .make[String]("myTask") // T must have JsonRW and Hashable instances .build { ctx => // do something, return a result "done" } Right(Seq(myTask)) ``` -------------------------------- ### Run All Integration Tests Source: https://github.com/sake92/deder/blob/main/CONTRIBUTING.md Builds the server and client, then runs all integration tests. ```shell ./scripts/run-it-tests.sh ``` -------------------------------- ### Explore Build Modules Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md List all modules in the build. Supports output formats like JSON, Mermaid, and DOT. ```shell # list modules # supports --format json|mermaid|dot deder modules ``` -------------------------------- ### Create Scala Main File Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/packaging.md A simple Scala file that defines the main entry point for the application. This file contains the 'Hello world!' print statement. ```scala package myapp @main def Main() = println("Hello world!") ``` -------------------------------- ### Explore Build Tasks Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md List all available tasks in the build. Supports output formats like JSON, Mermaid, and DOT. ```shell # list tasks # supports --format json|mermaid|dot deder tasks ``` -------------------------------- ### Build Server and Client Locally Source: https://github.com/sake92/deder/blob/main/CONTRIBUTING.md Builds the Deder server and client executables. Ensure the client is in your PATH after building. ```shell ./scripts/gen-config-bindings.sh deder exec -t assembly -m server # client executable JAR deder exec -t assembly -m client # or as native client deder exec -t graalvmNativeImage -m client # AND PUT CLIENT IN PATH !!! for example: cp .deder/out/client/assembly/out.jar /usr/local/bin/deder cp .deder/out/client/graalvmNativeImage/native-executable /usr/local/bin/deder # then you can run commands: cd examples/multi # start from clean state, copy the server JAR etc ./reset.sh ``` -------------------------------- ### Configure Local Directory Repository Source: https://github.com/sake92/deder/blob/main/docs/content/reference/repositories.md Use a `file://` URL to specify a local directory with a Maven layout as a repository. ```pkl repositories { new MavenRepository { url = "file:///abs/path/to/local-repo" } } ``` -------------------------------- ### Import Build Tool Configuration Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Import build tool configurations. Can auto-detect the build tool or be explicitly overridden. ```shell deder import # autodetect build tool deder import --from sbt # explicit override ``` -------------------------------- ### Publish to Sonatype Maven Central Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/publishing.md Run the command to publish your library to Sonatype Maven Central after setting up credentials and PGP keys. ```shell deder exec -t publish ``` -------------------------------- ### Define Maven Application Configuration Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/mvn-apps.md Configure a Maven application with its dependencies, main class, and arguments. Arguments can include static values and dynamically generated paths. ```pkl mvnApps = new Mapping { ["myapp"] = new MvnApp { deps { "com.example:myapp:1.0.0" } mainClass = "com.example.myapp.Main" args { // e.g. pass in some arguments to the main class "someparameter" ...m.sources.toList().map((src) -> "\(m.root)/\(src)") } } } ``` -------------------------------- ### Filter Modules Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/cross-project.md Optionally filter out specific modules from the generated list if they are not needed or compatible, for example, removing Scala Native modules for a particular Scala version. ```pkl modules { ...commonModules.filter((m) -> !m.id.endsWith("-native-3.7.4")) } ``` -------------------------------- ### Explore Deder Build Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/quickstart.md Use Deder CLI commands to explore your build configuration. `deder modules` lists all modules, `deder tasks` lists available tasks, and `deder plan` shows the execution plan for a specific task. ```bash # List all modules deder modules # List all available tasks deder tasks # See the execution plan for a specific task deder plan -m my-module -t compile ``` -------------------------------- ### Generate Java Bindings using Convenience Wrapper Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/plugins.md If developing within a Deder checkout, use the provided convenience wrapper script to generate plugin bindings. ```shell ./scripts/gen-plugin-bindings.sh my-plugin ``` -------------------------------- ### Run Plugin Integration Test Suite Source: https://github.com/sake92/deder/blob/main/CONTRIBUTING.md Executes the plugin integration test suite. This is done after publishing local modules and rebuilding the server. ```shell ./scripts/run-it-tests.sh ba.sake.deder.PluginIntegrationSuite ``` -------------------------------- ### Publish to Local Maven Repository Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/publishing.md Execute the command to publish the library to your local Maven repository (`~/.m2/repository`). This command requires minimal POM information. ```shell deder exec -t publishLocal ``` -------------------------------- ### Set Credentials for Sonatype Publishing Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/publishing.md Configure environment variables with your Sonatype username, password, and PGP key details for publishing to Maven Central. Credentials follow the pattern `DEDER__`. ```shell export DEDER_SONATYPE_USERNAME="..." export DEDER_SONATYPE_PASSWORD="..." export DEDER_SONATYPE_PGP_SECRET="..." export DEDER_SONATYPE_PGP_PASSPHRASE="..." ``` -------------------------------- ### Run Scalafix and Scalafmt Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Execute Scalafix for code fixes and Scalafmt for code formatting. Supports checking for issues without applying changes. ```shell # fix with scalafix deder exec -t fix deder exec -t fixCheck # format with scalafmt deder exec -t runMvnApp -m mymodule fmt deder exec -t runMvnApp -m mymodule fmtCheck ``` -------------------------------- ### Run Maven Application Entry Point Source: https://github.com/sake92/deder/blob/main/docs/content/reference/tasks.md Executes a named Maven application entry point declared in `deder.pkl`. Built-in apps like `fmt` and `fmtCheck` are available for Scala modules. ```shell deder exec -t runMvnApp -m myapp fmt # format with Scalafmt ``` ```shell deder exec -t runMvnApp -m myapp fmtCheck # check formatting ``` -------------------------------- ### Create Deder Project Configuration Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/packaging.md Defines project modules and dependencies using Deder's configuration language. This file sets up Scala modules, including their versions and dependencies. ```pkl amends "https://sake92.github.io/deder/config/early-access/DederProject.pkl" local const myappModules = new CreateScalaModules { root = "myapp" template = new { scalaVersion = "3.7.1" deps { "com.lihaoyi::pprint:0.9.5" } mainClass = "myapp.Main" } testTemplate = (template.asTest()) { deps { "org.scalameta::munit:1.2.1" } } }.get modules { ...myappModules.all } ``` -------------------------------- ### Print Task Execution Plan Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Print the execution plan for a specific task. Supports output formats like JSON, Mermaid, and DOT. ```shell # print execution plan for a task # supports --format json|mermaid|dot deder plan -m common -t compileClasspath ``` -------------------------------- ### Launch Server-Level Tools Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Launch various server-level tools provided by Deder, such as the TUI dashboard. Arguments can be passed to the tools. ```shell # launch a server-level tool deder tool # list available tools deder tool tui # launch the TUI dashboard deder tool tui -- --port 8080 # pass args to the tool ``` -------------------------------- ### List All Modules Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/cross-project.md Use the `deder modules` command to view all the modules that have been generated and included in the build configuration. ```shell $ deder modules ``` -------------------------------- ### Configure Server Properties Source: https://github.com/sake92/deder/blob/main/docs/content/reference/server-properties.md Specify server properties like local paths, log level, and Java options in the .deder/server.properties file. Ensure to restart the server after making changes. ```properties localPath=myprojects/deder/.deder/out/server/assembly/out.jar testRunnerLocalPath=myprojects/deder/.deder/out/test-runner/assembly/out.jar logLevel=debug logRolloverPattern=%d{yyyy-MM-dd-HH} logMaxHistory=14 logTotalSizeCap=500MB JAVA_OPTS=-javaagent:otel.jar -Dotel.service.name=my-project -Dotel.exporter.otlp.protocol=grpc -Dotel.exporter.otlp.endpoint=http://localhost:4317 ``` -------------------------------- ### Build and Publish Artifacts Source: https://github.com/sake92/deder/blob/main/docs/content/reference/tasks.md Tasks for building JARs, uber-JARs, and publishing artifacts to local or remote Maven repositories. Ensure `publish = true` is set in `deder.pkl` for publishing. ```shell deder exec -t assembly -m myapp java -jar .deder/out/myapp/assembly/out.jar ``` ```shell deder exec -t publishLocal -m mylib ``` ```shell deder exec -t publish -m mylib ``` -------------------------------- ### Generate Java Bindings for Pkl Schema Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/plugins.md Generate Java configuration classes from your Pkl schema using `pkl-codegen-java`. This command should be run within your plugin repository. ```shell # In your own plugin repository — use pkl-codegen-java directly: pkl-codegen-java \ --output-dir my-plugin/src \ my-plugin/resources/MyPluginModule.pkl ``` -------------------------------- ### Read Typed Config in Plugin init Function Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/plugins.md Implement the `init` function in your plugin to read and utilize the typed configuration. This involves evaluating the Pkl module and accessing its typed properties. ```scala import ba.sake.deder.* class MyPluginImpl extends DederPluginApi: def id: String = "my-plugin" def init(params: PluginInitParams): Either[String, Seq[AbstractTask[?]]] = val pluginModule = PluginConfigEvaluators.evaluate( getClass.getClassLoader, modulePath = "MyPluginModule.pkl", configText = params.configText, clazz = classOf[MyPluginModule] ) val greeting = pluginModule.config.greeting val myTask = TaskBuilder .make[String]("myTask") .build { ctx => ctx.notifications.add(ServerNotification.logInfo(greeting)) greeting } Right(Seq(myTask)) ``` -------------------------------- ### Publish to Sonatype Maven Central Source: https://github.com/sake92/deder/blob/main/examples/publish/README.md Publish artifacts to Sonatype Maven Central by setting necessary environment variables for authentication and then executing the 'publish' task. Ensure all credentials are correctly exported. ```shell export DEDER_PGP_PASSPHRASE="..." export DEDER_PGP_SECRET="..." export DEDER_SONATYPE_PASSWORD="..." export DEDER_SONATYPE_USERNAME="..." deder exec -t publish ``` -------------------------------- ### Run Module Main Class Source: https://github.com/sake92/deder/blob/main/docs/content/reference/tasks.md Executes the configured main class of a module. Supports watch mode for continuous execution. Use `runMain` to specify an alternative main class. ```shell deder exec -t run -m myapp ``` ```shell deder exec -t run -m myapp --watch ``` ```shell deder exec -t runMain -m myapp com.example.AltMain ``` -------------------------------- ### Download and Configure OTEL Java Agent for Deder Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/otel.md Download the latest OpenTelemetry Java agent JAR file. Then, configure the Deder server's JVM options to use this agent, specifying the service name and OTEL collector endpoint. ```shell curl -L -o otel.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar # set the agent options in .deder/server.properties: JAVA_OPTS=-javaagent:path/to/otel.jar -Dotel.service.name=my-project -Dotel.exporter.otlp.protocol=grpc -Dotel.exporter.otlp.endpoint=http://localhost:4317 ``` -------------------------------- ### Add Modules to Build Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/cross-project.md Include all generated cross-project modules into the main `modules` section of your Deder configuration. ```pkl modules { ...commonModules } ``` -------------------------------- ### Deriving Output Path in Task Execution Source: https://github.com/sake92/deder/blob/main/AGENTS.md Demonstrates how to derive an output path within the task's execute method instead of depending on it, to prevent filesystem feedback loops and incorrect caching. ```scala ctx.out / os.up / "classes" ``` -------------------------------- ### Publish Local Config and Plugin API Source: https://github.com/sake92/deder/blob/main/CONTRIBUTING.md Publishes the 'config' and 'plugin-api' modules to the local Maven repository. Required after modifying these modules before building dependent modules or running integration tests. ```shell deder exec -t publishLocal -m config -m plugin-api ``` -------------------------------- ### Multi-Fork Parallelism (maxTestForks) Source: https://github.com/sake92/deder/blob/main/docs/content/reference/testing.md Use `maxTestForks` to spawn multiple forked JVMs for a module, distributing test classes across them using LPT bin packing. The effective fork count is limited by the number of discovered test classes. ```pkl testTemplate = (template.asTest()) { maxTestForks = 4 // up to 4 forked JVMs for this module } ``` -------------------------------- ### Run Assembly JAR Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/packaging.md Executes the generated assembly JAR. This demonstrates that the uber JAR is self-contained and can be run without external dependencies. ```shell java -jar .deder/out/myapp/assembly/out.jar ``` -------------------------------- ### Execute Tasks Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Execute tasks on modules. Supports specifying tasks, modules, wildcards, exclusions, and watch mode. ```shell # by default executes compile on all modules deder exec # execute "compile" task explicitly, on all modules deder exec -t compile # compile the "common" module deder exec -t compile -m common # compile modules that start with "uber" deder exec -t compile -m uber% # compile modules that start with "uber", except "uber-test" deder exec -t compile -m uber% -m ~uber-test # run the "uber" module deder exec -t run -m uber # execute "run" in watch mode deder exec -t run -m frontend --watch # even in multiple terminals at the same time!!! deder exec -t run -m backend --watch # generate an "uber" jar, assembly of all deps and your code deder exec -t assembly -m uber java -jar .deder/out/uber/assembly/out.jar # execute all tests on all test modules deder exec -t test # execute tests on "uber-test" module deder exec -t test -m uber-test # execute a specific test suite deder exec -t test uber.MyTestSuite1 # execute test suites that start with "uber" deder exec -t test uber.% # execute specific test called "test1" in suite uber.MyTestSuite1 deder exec -t test uber.MyTestSuite1#test1 ``` -------------------------------- ### Run Scala Native Executable Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/scalanative.md Execute the compiled Scala Native application from the specified output directory. ```shell ./.deder/out/cli/nativeLink/cli ``` -------------------------------- ### Build Assembly JAR Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/packaging.md Packages the project into an assembly JAR (uber JAR), which includes all dependencies and can be run directly. This is useful for creating standalone applications. ```shell deder exec -t assembly -m myapp ``` -------------------------------- ### Common Deder Commands Source: https://github.com/sake92/deder/blob/main/README.md Provides a list of frequently used Deder commands for compiling, testing, building, running, and managing the build tool. ```shell deder exec # compile all modules (default task) ``` ```shell deder exec -t compile -m common # compile a specific module ``` ```shell deder exec -t test # run all tests ``` ```shell deder exec -t test -m mymod-test # run tests for one module ``` ```shell deder exec -t assembly -m app # build an uber JAR ``` ```shell deder exec -t run -m app --watch # run with file-watching ``` ```shell deder import # import project from sbt ``` ```shell deder bsp install # write BSP config for IDE import ``` ```shell deder shutdown # stop the background server ``` -------------------------------- ### Add Java Library Dependency Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/dependencies.md Use this syntax to add a standard Java library dependency. It follows the groupId:artifactId:version format. ```pkl deps { "org.immutables:value-annotations:2.12.0" } ``` -------------------------------- ### Initialize Fuse.js for Client-Side Search Source: https://github.com/sake92/deder/blob/main/docs/_layouts/search-results.html This script initializes Fuse.js with website entries and search keys. It's used for performing client-side searches on fetched JSON data. Ensure 'entries.json' is available at the specified path. ```javascript import Fuse from 'https://cdn.jsdelivr.net/npm/fuse.js@7.1.0/dist/fuse.mjs' const urlParams = new URLSearchParams(window.location.search); const qParam = urlParams.get('q'); const entries = await fetch('{{ site.base_url }}/search/entries.json').then(r => r.json()); console.log("All entries: ", entries); const fuse = new Fuse(entries, { keys: [ { name: 'title' }, { name: 'text' } ], includeMatches: true, }); const searchRes = fuse.search(qParam); console.log("Search results for:", qParam, searchRes); ``` -------------------------------- ### Project .deder Directory Structure Source: https://github.com/sake92/deder/blob/main/docs/content/reference/files-layout.md Illustrates the typical layout of the .deder directory created in a project's root. This includes subdirectories for logs, build outputs (assembly, classes), server and test runner JARs, configuration files, and communication sockets. ```shell .deder/ ├── logs │ ├── client │ │ ├── cli-client_2026-02-27-12-54-32_186830.log │ └── server.log ├── out │ ├── mylibrary # module name │ │ ├── assembly │ │ .... # assembly task files │ │ ├── classes │ │ │ └── ba │ │ │ └── ... # class files etc. ├── server.jar # the server JAR file ├── test-runner.jar # the test-runner JAR file ├── server.properties # server config file, can be edited and commited to git ├── server.lock # server lock file, only one is allowed to run at a time ├── server-cli.sock # unix domain socket for CLI clients ├── server-bsp.sock # unix domain socket for BSP clients └── server.current.version # cached version tag for this project ``` -------------------------------- ### Run Server Unit Tests Source: https://github.com/sake92/deder/blob/main/CONTRIBUTING.md Executes unit tests for the Deder server. ```shell deder exec -t test -m server-test ``` -------------------------------- ### Execute Scala.js Linking Task Source: https://github.com/sake92/deder/blob/main/docs/content/reference/tasks.md Links Scala.js code in fast/development mode. This task is cached. ```shell deder exec -t fastLinkJs -m myjsmodule ``` -------------------------------- ### Deder Build Commands Source: https://github.com/sake92/deder/blob/main/AGENTS.md Common commands for building the project, regenerating bindings, running tests, and executing specific test suites. ```sh ./scripts/gen-config-bindings.sh # regenerate Pkl→Java config bindings (required before first build) ./scripts/build-jars.sh # build client, server and test-runner fat JAR (assembly) deder exec -t test -m server-test # run unit tests (munit) ./scripts/run-it-tests.sh # build everything + run integration tests ./scripts/run-it-tests.sh ba.sake.deder.bsp.BspIntegrationSuite # single IT suite ``` -------------------------------- ### Analyze Dependency Tree Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Analyze the dependency tree of a module, including size metrics and conflict detection. Provides details on direct and transitive dependencies. ```shell # analyze dependency tree with size metrics and conflict detection deder exec -t depsTree -m mymodule ``` -------------------------------- ### Pass JVM Options with jvmOptions Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/env-vars.md Configure JVM options for your application or tests by specifying them in the `jvmOptions` property within your module configuration. ```pkl jvmOptions { "-Xmx128m" "-XX:+PrintCompilation" } ``` -------------------------------- ### Rename Deder client JAR to executable Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/installation.md After downloading the deder-client.jar, rename it to 'deder' to make it executable. ```bash mv deder-client.jar deder ``` -------------------------------- ### Generate Modules Mermaid Diagram Source: https://github.com/sake92/deder/blob/main/docs/content/index.md Generates a Mermaid diagram representing the project's module structure. Requires the 'mmdc' command-line tool. ```shell deder modules -f mermaid | mmdc -i - -o modules.svg ``` -------------------------------- ### Execute GraalVM Native Image Task Source: https://github.com/sake92/deder/blob/main/docs/content/reference/tasks.md Executes the `graalvmNativeImage` task for a specified module. Ensure GraalVM is configured in `deder.pkl` or via the `$GRAALVM_HOME` environment variable. ```shell deder exec -t graalvmNativeImage -m myapp .deder/out/myapp/graalvmNativeImage/native-executable ``` -------------------------------- ### Deder Architecture Overview Source: https://github.com/sake92/deder/blob/main/AGENTS.md Illustrates the communication flow between the Deder client and server using Unix domain sockets. The server has two main components: a CLI server and a BSP server. ```text client (Java, native-image) --Unix socket--> server (Scala 3) ├── CLI server (.deder/server-cli.sock) └── BSP server (.deder/server-bsp.sock) ``` -------------------------------- ### Make Deder executable Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/installation.md Grant execute permissions to the deder binary. ```bash chmod +x deder ``` -------------------------------- ### Declare Custom Maven Repositories Source: https://github.com/sake92/deder/blob/main/docs/content/reference/repositories.md Add custom Maven repositories to your `deder.pkl` to resolve artifacts from internal servers or public mirrors. ```pkl repositories { new MavenRepository { url = "https://nexus.mycompany.com/repository/maven-releases/" } new MavenRepository { url = "https://jitpack.io" } } ``` -------------------------------- ### Move Deder to system PATH Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/installation.md Place the deder executable in a directory included in your system's PATH for global access. ```bash sudo mv deder /usr/local/bin/ ``` -------------------------------- ### Configure Scala Native Project with Deder Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/scalanative.md Define a Scala Native module for your Deder project. Ensure the `deder.pkl` file is in your project root. ```pkl amends "https://sake92.github.io/deder/config/early-access/DederProject.pkl" local const cli: ScalaNativeModule = new { id = "cli" scalaVersion = "3.7.4" scalaNativeVersion = "0.5.10" } modules { cli } ``` -------------------------------- ### Run Specific Integration Test Suite Source: https://github.com/sake92/deder/blob/main/CONTRIBUTING.md Executes a specific integration test suite by its class name. ```shell ./scripts/run-it-tests.sh ba.sake.deder.bsp.BspIntegrationSuite ``` -------------------------------- ### Add Dependency to Local Project Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/publishing.md Include a published local artifact as a dependency in another project by specifying its group ID, artifact ID, and version. ```pkl deps { "com.example::deder-example-library:0.0.1-SNAPSHOT" } ``` -------------------------------- ### Clean Module Output and Caches Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Clean build artifacts for modules. Supports cleaning all modules, specific modules, modules matching a wildcard, or excluding specific modules. Can also target specific tasks like 'compile'. ```shell deder clean # clean all modules deder clean -m mymodule # clean specific module deder clean -m mod1 -m mod2 # clean multiple modules deder clean -m mod% # clean modules matching wildcard deder clean -m mod% -m ~mod-test # exclude module from wildcard match (~ negates) deder clean -t compile # clean compile task on all modules deder clean -m mymodule -t test # clean test task on specific module ``` -------------------------------- ### Declare Custom Maven Repositories Source: https://github.com/sake92/deder/blob/main/docs/content/reference/cheatsheet.md Declare custom Maven repositories in the `deder.pkl` configuration file. Optionally disable default repositories. ```pkl repositories { new MavenRepository { url = "https://nexus.example.com/releases/" } } # includeDefaultRepos = false # force empty default repos, no local .m2 and Maven Central ``` -------------------------------- ### Create Git Worktree Source: https://github.com/sake92/deder/blob/main/AGENTS.md Use this command to create an isolated worktree for development. Always create a descriptive branch name. All edits, commits, and builds should happen inside this worktree. ```bash git worktree add .worktrees/ ``` -------------------------------- ### Compile All Modules Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/quickstart.md Use the `deder exec -t compile` command to compile all modules in your project. The `compile` task is the default, so `deder exec` will also compile all modules. ```bash # Compile all modules deder exec -t compile # default task is compile, no need to specify it deder exec ``` -------------------------------- ### Run Test-Common Unit Tests Source: https://github.com/sake92/deder/blob/main/CONTRIBUTING.md Executes unit tests for the test-common module. ```shell deder exec -t testInMemory -m test-common-test ``` -------------------------------- ### Configure Local Server Path Source: https://github.com/sake92/deder/blob/main/CONTRIBUTING.md Specifies the local path to the Deder server and test runner JARs in the server properties file. This bypasses the global artifact cache. ```properties # .deder/server.properties localPath=/path/to/your/deder/.deder/out/server/assembly/out.jar testRunnerLocalPath=/path/to/your/deder/.deder/out/test-runner/assembly/out.jar ``` -------------------------------- ### Add Scala.js Library Dependency Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/dependencies.md For Scala.js modules, use double-colon syntax in both separators. This will resolve with a Scala binary version suffix and a platform suffix like _sjs1. ```pkl deps { "org.scala-js::scalajs-dom::2.2.0" } ``` -------------------------------- ### Define Cross-Project Modules Source: https://github.com/sake92/deder/blob/main/docs/content/tutorials/cross-project.md Use `CreateCrossModules` to generate modules for JVM, JS, and Native for specified Scala versions. Configure Scala.js and Scala Native versions within the templates. ```ts amends "https://sake92.github.io/deder/config/early-access/DederProject.pkl" local const scalaVersions = List("2.13.18", "3.7.4") local const commonModules: List = scalaVersions .map((sv) -> new CreateCrossModules { root = "common" template = new { scalaVersion = sv } jsTemplate = (template.asJs()) { scalaJsVersion = "1.20.2" } nativeTemplate = (template.asNative()) { scalaNativeVersion = "0.5.10" } } .get .all ) .flatten() modules { ...commonModules } ``` -------------------------------- ### Use Typed Plugin Config in Deder Project Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/plugins.md In a consumer Deder project, import your plugin's Pkl module and instantiate the typed plugin class directly within the `deder.pkl` configuration file. ```pkl amends "https://sake92.github.io/deder/config/early-access/DederProject.pkl" import "https://example.github.io/myuser/my-deder-plugin/MyPluginModule.pkl" as MPM plugins { new MPM.MyPlugin { config = new { greeting = "Hello from typed config!" } } } ``` -------------------------------- ### Pass Environment Variables with forkEnv Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/env-vars.md Use the `forkEnv` property in your module configuration to define environment variables that will be available when running your app or tests with `deder exec`. ```pkl forkEnv { ["MY_VAR"] = "true" } ``` -------------------------------- ### Run openapi4s CLI with MvnApp Source: https://github.com/sake92/deder/blob/main/examples/mvnApp/README.md Execute the openapi4s CLI within the custom MvnApp to generate code from an OpenAPI spec. Ensure the MvnApp is configured to run the openapi4s tool. ```shell deder exec -t runMvnApp openapi4s ``` -------------------------------- ### Custom Hashable Instance for Task Results Source: https://github.com/sake92/deder/blob/main/AGENTS.md Illustrates the necessity of a custom Hashable instance for task result data classes containing DederPath or os.Path to ensure correct caching based on content. ```scala CompileResult ``` -------------------------------- ### Generate Dependency Graph SVG Source: https://github.com/sake92/deder/blob/main/docs/content/index.md Generates an SVG visualization of the dependency graph for a specific task within a module. Requires the 'dot' command-line tool. ```shell deder plan -m common -t compileClasspath -f dot | dot -Tsvg > bla.svg ``` -------------------------------- ### Add Scala Library Dependency Source: https://github.com/sake92/deder/blob/main/docs/content/howtos/dependencies.md Use double-colon syntax for Scala library dependencies. For Scala 3 modules, a Scala binary version suffix like _3 is automatically appended. ```pkl deps { "ba.sake::sharaf-undertow:0.17.0" } ``` ```pkl > This can be used if you want to add a Scala 2 library to a Scala 3 project. > E.g. "com.example:my_scala2_lib_2.13:0.0.1" ```