Skip to main content

scala-cli-adding-directives

Add or change using directives in Scala CLI. Use when adding a new //> using directive, registering a directive handler, or editing directive preprocessing.

소스 정보

저장소
VirtusLab/scala-cli
최근 소스 활동
2026년 3월 18일 07:40
감지된 SKILL.md 언어
영어
스타
645
포크
169

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
scala-cli-adding-directives
description
Add or change using directives in Scala CLI. Use when adding a new //> using directive, registering a directive handler, or editing directive preprocessing.
# Adding a new directive (Scala CLI) 1. **Create a case class** in `modules/directives/src/main/scala/scala/build/preprocessing/directives/` extending one of: - `HasBuildOptions` — produces `BuildOptions` directly - `HasBuildOptionsWithRequirements` — produces `BuildOptions` with scoped requirements (e.g. `test.dep`) - `HasBuildRequirements` — produces `BuildRequirements` (for `//> require`) 2. **Annotate**: `@DirectiveLevel(SpecificationLevel.EXPERIMENTAL)`, `@DirectiveDescription("…")`, `@DirectiveUsage("…")`, `@DirectiveExamples("…")`, `@DirectiveName("key")` on fields. 3. **Companion**: `val handler: DirectiveHandler[YourDirective] = DirectiveHandler.derive` 4. **Register** in `modules/build/.../DirectivesPreprocessingUtils.scala` in the right list: `usingDirectiveHandlers`, `usingDirectiveWithReqsHandlers`, or `requireDirectiveHandlers`. 5. **Regenerate reference docs**: `./mill -i 'generate-reference-doc[]'.run` CLI options always override directive values when both set the same thing.
GitHub에서 보기