Skip to content

feat(ir): add typed builder for Gradle@3#1113

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
feat/ir-gradle-builder-2ef74c2dc9cd29a9
Draft

feat(ir): add typed builder for Gradle@3#1113
github-actions[bot] wants to merge 1 commit into
mainfrom
feat/ir-gradle-builder-2ef74c2dc9cd29a9

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for Gradle@3 to the ado-aw IR.

Motivation

Previously, any code that needed to emit a Gradle@3 step had to hand-craft TaskStep::new(...) with raw string input keys. This PR introduces a typed builder struct (new(gradle_wrapper_file, tasks) + typed optional setters + into_step()) so required inputs are positional, optional inputs and their constrained values are type-checked, and call sites stop using stringly-typed keys.

Changes

  • src/compile/ir/tasks/gradle.rs: new Gradle builder struct with typed enums (JavaHomeOption, JdkVersion, JdkArchitecture, CodeCoverageTool) and 10 unit tests
  • src/compile/ir/tasks/mod.rs: pub mod gradle; declaration (alphabetical order)

ADO Task Reference

  • Task: Gradle@3
  • Docs: (https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/gradle-v3)
  • Required inputs: gradleWrapperFile (default: gradlew), tasks (default: build)
  • Optional inputs: options, publishJUnitResults, testResultsFiles, codeCoverageToolOption, codeCoverageClassFilesDirectories, codeCoverageFailIfEmpty, javaHomeOption, jdkVersionOption, jdkDirectory, jdkArchitectureOption, gradleOptions

Validation

  • cargo build --all-targets
  • cargo test (10 new unit tests pass)
  • cargo clippy --all-targets --all-features --workspace -- -D warnings

Created by the ado-task-ir-contributor workflow.

Generated by ADO Task IR Contributor · 828.8 AIC · ⌖ 31.1 AIC · ⊞ 38.1K ·

Adds a typed builder struct `Gradle` in `src/compile/ir/tasks/gradle.rs`
for the `Gradle@3` ADO pipeline task.

The builder exposes:
- `new(gradle_wrapper_file, tasks)` — required inputs as positional parameters
- Chained setters for all optional inputs: `options`, `publish_junit_results`,
  `test_results_files`, `code_coverage_tool`, `java_home_option`, `jdk_version`,
  `jdk_directory`, `jdk_architecture`, `gradle_options`, `with_display_name`
- Typed enums: `JavaHomeOption`, `JdkVersion`, `JdkArchitecture`, `CodeCoverageTool`
- `into_step() -> TaskStep` — only emits explicitly-set inputs

Includes 10 unit tests covering the common usage paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants