class GradleVariantConfiguration extends VariantConfiguration<CoreBuildType, CoreProductFlavor, CoreProductFlavor> {

    @NonNull
    public AndroidVersion getMinSdkVersionWithTargetDeviceApi() {
        Integer targetApiLevel = projectOptions.get(IntegerOption.IDE_TARGET_DEVICE_API);
        if (targetApiLevel != null && isMultiDexEnabled() && getBuildType().isDebuggable()) {
            // Consider runtime API passed from the IDE only if multi-dex is enabled and the app is
            // debuggable.
            int minVersion =
                    getTargetSdkVersion().getApiLevel() > 1
                            ? Integer.min(getTargetSdkVersion().getApiLevel(), targetApiLevel)
                            : targetApiLevel;

            return new AndroidVersion(minVersion);
        } else {
            return super.getMinSdkVersion();
        }
    }

    @VisibleForTesting  GradleVariantConfiguration(
            @NonNull ProjectOptions projectOptions,
            @Nullable
                    VariantConfiguration<CoreBuildType, CoreProductFlavor, CoreProductFlavor>
                            testedConfig,
            @NonNull CoreProductFlavor defaultConfig,
            @NonNull SourceProvider defaultSourceProvider,
            @Nullable ManifestAttributeSupplier mainManifestAttributeSupplier,
            @NonNull CoreBuildType buildType,
            @Nullable SourceProvider buildTypeSourceProvider,
            @NonNull VariantType type,
            @Nullable CoreSigningConfig signingConfigOverride,
            @NonNull EvalIssueReporter issueReporter,
            @NonNull BooleanSupplier isInExecutionPhase);

}