[Gradle, MPP] Suppress deprecation warnings for tests with an old AGP
#KT-52998 In Progress
This commit is contained in:
committed by
Space Team
parent
8120025076
commit
75c9fd3032
+10
@@ -999,6 +999,16 @@ fun BaseGradleIT.BuildOptions.withFreeCommandLineArgument(argument: String) = co
|
|||||||
freeCommandLineArgs = freeCommandLineArgs + argument
|
freeCommandLineArgs = freeCommandLineArgs + argument
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun BaseGradleIT.BuildOptions.suppressDeprecationWarningsOnAgpLessThan(
|
||||||
|
agpVersion: AGPVersion,
|
||||||
|
@Suppress("UNUSED_PARAMETER") reason: String // just to require specifying a reason for suppressing
|
||||||
|
) =
|
||||||
|
if ((androidGradlePluginVersion ?: error("AGP version expected to be configured")) >= agpVersion) {
|
||||||
|
this
|
||||||
|
} else {
|
||||||
|
copy(warningMode = WarningMode.All)
|
||||||
|
}
|
||||||
|
|
||||||
private const val MAVEN_LOCAL_URL_PLACEHOLDER = "<mavenLocalUrl>"
|
private const val MAVEN_LOCAL_URL_PLACEHOLDER = "<mavenLocalUrl>"
|
||||||
internal const val PLUGIN_MARKER_VERSION_PLACEHOLDER = "<pluginMarkerVersion>"
|
internal const val PLUGIN_MARKER_VERSION_PLACEHOLDER = "<pluginMarkerVersion>"
|
||||||
|
|
||||||
|
|||||||
+7
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.gradle.native
|
|||||||
import org.gradle.api.logging.configuration.WarningMode
|
import org.gradle.api.logging.configuration.WarningMode
|
||||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
||||||
|
import org.jetbrains.kotlin.gradle.suppressDeprecationWarningsOnAgpLessThan
|
||||||
import org.jetbrains.kotlin.gradle.util.AGPVersion
|
import org.jetbrains.kotlin.gradle.util.AGPVersion
|
||||||
import org.jetbrains.kotlin.gradle.util.modify
|
import org.jetbrains.kotlin.gradle.util.modify
|
||||||
import org.jetbrains.kotlin.konan.target.HostManager
|
import org.jetbrains.kotlin.konan.target.HostManager
|
||||||
@@ -136,6 +137,9 @@ class AppleFrameworkIT : BaseGradleIT() {
|
|||||||
"TARGET_BUILD_DIR" to "testBuildDir",
|
"TARGET_BUILD_DIR" to "testBuildDir",
|
||||||
"FRAMEWORKS_FOLDER_PATH" to "testFrameworksDir"
|
"FRAMEWORKS_FOLDER_PATH" to "testFrameworksDir"
|
||||||
)
|
)
|
||||||
|
).suppressDeprecationWarningsOnAgpLessThan(
|
||||||
|
AGPVersion.v7_3_0,
|
||||||
|
"uses deprecated IncrementalTaskInputs"
|
||||||
)
|
)
|
||||||
build("tasks", options = options) {
|
build("tasks", options = options) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
@@ -164,6 +168,9 @@ class AppleFrameworkIT : BaseGradleIT() {
|
|||||||
"SDK_NAME" to "iphoneos",
|
"SDK_NAME" to "iphoneos",
|
||||||
"ARCHS" to "arm64"
|
"ARCHS" to "arm64"
|
||||||
)
|
)
|
||||||
|
).suppressDeprecationWarningsOnAgpLessThan(
|
||||||
|
AGPVersion.v7_3_0,
|
||||||
|
"uses deprecated IncrementalTaskInputs"
|
||||||
)
|
)
|
||||||
build("tasks", options = options) {
|
build("tasks", options = options) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
|
|||||||
+7
-1
@@ -5,8 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.native
|
package org.jetbrains.kotlin.gradle.native
|
||||||
|
|
||||||
|
import org.gradle.api.logging.configuration.WarningMode
|
||||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
||||||
|
import org.jetbrains.kotlin.gradle.suppressDeprecationWarningsOnAgpLessThan
|
||||||
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
|
import org.jetbrains.kotlin.gradle.transformProjectWithPluginsDsl
|
||||||
import org.jetbrains.kotlin.gradle.util.AGPVersion
|
import org.jetbrains.kotlin.gradle.util.AGPVersion
|
||||||
import org.jetbrains.kotlin.konan.target.HostManager
|
import org.jetbrains.kotlin.konan.target.HostManager
|
||||||
@@ -93,7 +95,11 @@ class XCFrameworkIT : BaseGradleIT() {
|
|||||||
@Test
|
@Test
|
||||||
fun `check there aren't XCFramework tasks without declaration in build script`() {
|
fun `check there aren't XCFramework tasks without declaration in build script`() {
|
||||||
with(Project("sharedAppleFramework")) {
|
with(Project("sharedAppleFramework")) {
|
||||||
build("tasks") {
|
val options = defaultBuildOptions().suppressDeprecationWarningsOnAgpLessThan(
|
||||||
|
AGPVersion.v7_3_0,
|
||||||
|
"uses deprecated IncrementalTaskInputs"
|
||||||
|
)
|
||||||
|
build("tasks", options = options) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertTasksNotRegistered(
|
assertTasksNotRegistered(
|
||||||
":shared:assembleSharedDebugXCFramework",
|
":shared:assembleSharedDebugXCFramework",
|
||||||
|
|||||||
Reference in New Issue
Block a user