Unverified Commit 9f10be04 authored by Thomas Cameron's avatar Thomas Cameron Committed by GitHub
Browse files

Add `RUSTFLAGS = aws_sdk_unstable` as environment variable when running Cargo from kotlin (#2614)

## Motivation and Context
This PR set `aws_sdk_unstable` to RUSTFALGS when running cargo from
kotlin.

It is required to enable test gated features introduced on RFC30.

No breaking changers are introduced.

## Description
add `RUSTFLAGS = aws_sdk_unstable` when running cargo from kotlin.


## Parent PR
This PR is listed as one of prerequisite PRs on this PR.

- https://github.com/awslabs/smithy-rs/pull/2615

## Testing
NA.

----
*By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.*
parent bc4c1862
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -244,12 +244,14 @@ fun Project.registerCargoCommandsTasks(
    this.tasks.register<Exec>(Cargo.CHECK.toString) {
        dependsOn(dependentTasks)
        workingDir(outputDir)
        environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
        commandLine("cargo", "check", "--lib", "--tests", "--benches", "--all-features")
    }

    this.tasks.register<Exec>(Cargo.TEST.toString) {
        dependsOn(dependentTasks)
        workingDir(outputDir)
        environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
        commandLine("cargo", "test", "--all-features")
    }

@@ -257,12 +259,14 @@ fun Project.registerCargoCommandsTasks(
        dependsOn(dependentTasks)
        workingDir(outputDir)
        environment("RUSTDOCFLAGS", defaultRustDocFlags)
        environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
        commandLine("cargo", "doc", "--no-deps", "--document-private-items")
    }

    this.tasks.register<Exec>(Cargo.CLIPPY.toString) {
        dependsOn(dependentTasks)
        workingDir(outputDir)
        environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
        commandLine("cargo", "clippy")
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ private fun runCli(
                }
            }
            .copyTo(action)
        action.environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
        action.execute()
    }
}