add-compiler-option

Add compiler options to Metro across Gradle plugin components and tests.

1.4k|105|Updated Nov 5, 2024
One-click install
npx skills add https://github.com/ZacSweers/metro --skill add-compiler-option
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-compiler-option
Source: https://github.com/ZacSweers/metro/tree/main/.claude/skills/add-metro-option
Command: npx skills add https://github.com/ZacSweers/metro --skill add-compiler-option

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured, repeatable guide for introducing a new compiler option in Metro. It consolidates the required edits across MetroOptions, the Gradle plugin extension, the Gradle subplugin, and tests to ensure consistent integration and avoid drift.

Core Features & Use Cases

  • Stepwise updates to MetroOptions, including adding a new MetroOption entry and wiring builder properties and load logic.
  • Integration with the Gradle tooling: GradlePluginExtension and GradleGradleSubplugin wiring to expose and apply the option in builds.
  • Test coverage guidance and directives to validate the option across compiler tests.

Quick Start

Create a new option named my-new-option and implement the required changes across MetroOptions.kt, the Gradle plugin extension, the Gradle subplugin, and tests as described in the Files to Update section. Then run the test suite to verify behavior.

Frequently Asked Questions about add-compiler-option

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new compiler option to Metro?

To add a new compiler option to Metro, you update MetroOptions with the new entry, wire builder properties and load logic, then integrate the DSL and plugin wiring in MetroPluginExtension and MetroGradleSubplugin. Finally, add test stubs to validate the option.

What files need to be updated when introducing a Metro Gradle plugin option?

Introducing a Metro Gradle plugin option requires updates across MetroOptions.kt, MetroPluginExtension for the Gradle DSL, MetroGradleSubplugin for plugin integration, and test files to ensure consistent behavior and avoid drift across the compiler and build tooling.

Does adding a boolean compiler option in Metro require the same steps as a non-boolean option?

Yes, adding a boolean or non-boolean compiler option in Metro follows the same structured process. Both require defining the option in MetroOptions, implementing loading logic, exposing Gradle DSL properties, wiring the subplugin, and adding compiler test coverage.

How does Metro load compiler options from the Gradle plugin extension?

Metro loads compiler options by reading the configured properties from the Gradle plugin extension DSL and translating them into MetroOption entries within MetroOptions, which the Gradle subplugin then applies to the compiler during the build compilation phase.

Why do my Metro compiler options drift out of sync with the Gradle plugin?

Metro compiler options drift out of sync when updates are not applied consistently across MetroOptions, MetroPluginExtension, MetroGradleSubplugin, and tests. A structured stepwise approach to editing all required files prevents this integration drift.

Are compiler tests required when adding a new Metro option?

Yes, compiler tests are required when adding a new Metro option. The process includes generating test stubs and providing test coverage guidance to validate that the option behaves correctly across the compiler and Gradle plugin integration.