feat(ir): add typed builder for Gradle@3#1113
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Conversation
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>
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a typed builder struct for
Gradle@3to the ado-aw IR.Motivation
Previously, any code that needed to emit a
Gradle@3step had to hand-craftTaskStep::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: newGradlebuilder struct with typed enums (JavaHomeOption,JdkVersion,JdkArchitecture,CodeCoverageTool) and 10 unit testssrc/compile/ir/tasks/mod.rs:pub mod gradle;declaration (alphabetical order)ADO Task Reference
Gradle@3gradleWrapperFile(default:gradlew),tasks(default:build)options,publishJUnitResults,testResultsFiles,codeCoverageToolOption,codeCoverageClassFilesDirectories,codeCoverageFailIfEmpty,javaHomeOption,jdkVersionOption,jdkDirectory,jdkArchitectureOption,gradleOptionsValidation
cargo build --all-targetscargo test(10 new unit tests pass)cargo clippy --all-targets --all-features --workspace -- -D warningsCreated by the ado-task-ir-contributor workflow.