Skip to content

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

Merged
jamesadevine merged 2 commits into
mainfrom
feat/ir-gradle-builder-2ef74c2dc9cd29a9
Jun 24, 2026
Merged

feat(ir): add typed builder for Gradle@3#1113
jamesadevine merged 2 commits 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
@jamesadevine jamesadevine marked this pull request as ready for review June 24, 2026 16:04
…r-2ef74c2dc9cd29a9

# Conflicts:
#	src/compile/ir/tasks/mod.rs
@jamesadevine jamesadevine merged commit 2a070e0 into main Jun 24, 2026
3 checks passed
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.

1 participant