[Gradle] Remove ownModuleName input
^KT-64504 Verification Pending
This commit is contained in:
committed by
Space Team
parent
9fb920874c
commit
4971af293c
-3
@@ -43,7 +43,6 @@ class KotlinJvmApiTest : KGPBaseTest() {
|
||||
it.source("src/main")
|
||||
it.multiPlatformEnabled.set(false)
|
||||
it.moduleName.set("main")
|
||||
it.ownModuleName.set("main")
|
||||
it.sourceSetName.set("main")
|
||||
it.useModuleDetection.set(false)
|
||||
it.destinationDirectory.fileValue(new File(project.buildDir, "fooOutput"))
|
||||
@@ -90,7 +89,6 @@ class KotlinJvmApiTest : KGPBaseTest() {
|
||||
)
|
||||
|
||||
build(customTaskName) {
|
||||
assertOutputDoesNotContain("No value has been specified for property 'ownModuleName'")
|
||||
assertFileInProjectExists("build/$outputDirName/org/example/application/MainKt.class")
|
||||
assertFileInProjectExists("build/$outputDirName/org/example/Lib.class")
|
||||
assertFileInProjectExists("build/$outputDirName/META-INF/$customModuleName.kotlin_module")
|
||||
@@ -136,7 +134,6 @@ class KotlinJvmApiTest : KGPBaseTest() {
|
||||
it.source("src/main")
|
||||
it.multiPlatformEnabled.set(false)
|
||||
it.moduleName.set("main")
|
||||
it.ownModuleName.set("main")
|
||||
it.sourceSetName.set("main")
|
||||
it.useModuleDetection.set(false)
|
||||
it.destinationDirectory.fileValue(new File(project.buildDir, "fooOutput"))
|
||||
|
||||
+10
-4
@@ -300,8 +300,7 @@ internal open class GradleCompilerRunner(
|
||||
if (task is AbstractKotlinCompile<*>) {
|
||||
val module = IncrementalModuleEntry(
|
||||
project.path,
|
||||
@Suppress("DEPRECATION") // remove with KT-64504
|
||||
task.ownModuleName.get(),
|
||||
task.taskModuleName,
|
||||
project.layout.buildDirectory.get().asFile,
|
||||
task.buildHistoryFile.get().asFile,
|
||||
task.abiSnapshotFile.get().asFile
|
||||
@@ -336,8 +335,7 @@ internal open class GradleCompilerRunner(
|
||||
val kotlinTask = mainCompilation.compileTaskProvider.get() as? AbstractKotlinCompile<*> ?: continue
|
||||
val module = IncrementalModuleEntry(
|
||||
project.path,
|
||||
@Suppress("DEPRECATION") // remove with KT-64504
|
||||
kotlinTask.ownModuleName.get(),
|
||||
kotlinTask.taskModuleName,
|
||||
project.layout.buildDirectory.get().asFile,
|
||||
kotlinTask.buildHistoryFile.get().asFile,
|
||||
kotlinTask.abiSnapshotFile.get().asFile
|
||||
@@ -370,6 +368,14 @@ internal open class GradleCompilerRunner(
|
||||
}
|
||||
}
|
||||
|
||||
private val AbstractKotlinCompile<*>.taskModuleName
|
||||
get() = when (this) {
|
||||
is KotlinCompile -> compilerOptions.moduleName.get()
|
||||
is Kotlin2JsCompile -> compilerOptions.moduleName.get()
|
||||
is KotlinCompileCommon -> moduleName.get()
|
||||
else -> throw IllegalStateException("Unknown AbstractKotlinCompile task instance: ${this::class.qualifiedName}")
|
||||
}
|
||||
|
||||
private fun jarForJavaSourceSet(
|
||||
project: Project,
|
||||
sourceSetName: String,
|
||||
|
||||
-2
@@ -86,8 +86,6 @@ abstract class KotlinBaseApiPlugin : DefaultKotlinBasePlugin(), KotlinJvmFactory
|
||||
KotlinCompileConfig(myProject, kotlinExtension)
|
||||
)
|
||||
registeredKotlinJvmCompileTask.configure {
|
||||
@Suppress("DEPRECATION")
|
||||
it.ownModuleName.set(compilerOptions.moduleName)
|
||||
@Suppress("DEPRECATION")
|
||||
it.moduleName.set(compilerOptions.moduleName)
|
||||
}
|
||||
|
||||
-4
@@ -112,10 +112,6 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> @Inject constr
|
||||
.map { it.normalize().relativeTo(buildDirFile).invariantSeparatorsPath }.toSet()
|
||||
}
|
||||
|
||||
@Deprecated("Scheduled for removal with Kotlin 2.0", ReplaceWith("moduleName"))
|
||||
@get:Input
|
||||
abstract val ownModuleName: Property<String>
|
||||
|
||||
@get:Internal
|
||||
val startParameters = BuildReportsService.getStartParameters(project)
|
||||
|
||||
|
||||
-2
@@ -118,8 +118,6 @@ internal abstract class AbstractKotlinCompileConfig<TASK : AbstractKotlinCompile
|
||||
)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
task.ownModuleName.set(project.provider { compilationInfo.moduleName })
|
||||
task.sourceSetName.value(providers.provider { compilationInfo.compilationName })
|
||||
task.multiPlatformEnabled.value(
|
||||
providers.provider {
|
||||
|
||||
-6
@@ -104,12 +104,6 @@ internal open class BaseKotlinCompileConfig<TASK : KotlinCompile> : AbstractKotl
|
||||
task.associatedJavaCompileTaskName.value(javaTask.map { it.name })
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
task.ownModuleName.value(
|
||||
providers.provider {
|
||||
task.parentKotlinOptions.orNull?.moduleName ?: compilationInfo.moduleName
|
||||
})
|
||||
|
||||
task.nagTaskModuleNameUsage.value(true).disallowChanges()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user