Support aggregate tasks to build binaries per compilation
This commit is contained in:
+11
@@ -625,6 +625,17 @@ open class KotlinNativeTargetConfigurator(
|
||||
}
|
||||
}
|
||||
|
||||
// Create an aggregate link task for each compilation.
|
||||
target.compilations.all {
|
||||
project.tasks.create(it.binariesTaskName)
|
||||
}
|
||||
|
||||
project.whenEvaluated {
|
||||
target.binaries.forEach {
|
||||
project.tasks.getByName(it.compilation.binariesTaskName).dependsOn(it.linkTaskName)
|
||||
}
|
||||
}
|
||||
|
||||
// Create binaries for output kinds declared using the old DSL.
|
||||
project.whenEvaluated {
|
||||
target.compilations.all { compilation ->
|
||||
|
||||
-1
@@ -111,7 +111,6 @@ class Executable constructor(
|
||||
lowerCamelCaseName("run", name, compilation.target.targetName)
|
||||
}
|
||||
|
||||
// TODO: may make it lateinit (along with linkTasks)?
|
||||
val runTask: AbstractExecTask<*>
|
||||
get() = project.tasks.getByName(runTaskName) as AbstractExecTask<*>
|
||||
|
||||
|
||||
+4
-5
@@ -421,11 +421,10 @@ class KotlinNativeCompilation(
|
||||
)
|
||||
|
||||
override val compileAllTaskName: String
|
||||
get() = lowerCamelCaseName(
|
||||
target.disambiguationClassifier,
|
||||
compilationName.takeIf { it != KotlinCompilation.MAIN_COMPILATION_NAME }.orEmpty(),
|
||||
"klibrary"
|
||||
)
|
||||
get() = lowerCamelCaseName(target.disambiguationClassifier, compilationName, "klibrary")
|
||||
|
||||
val binariesTaskName: String
|
||||
get() = lowerCamelCaseName(target.disambiguationClassifier, compilationName, "binaries")
|
||||
|
||||
override fun addSourcesToCompileTask(sourceSet: KotlinSourceSet, addAsCommonSources: Boolean) {
|
||||
allSources.add(sourceSet.kotlin)
|
||||
|
||||
Reference in New Issue
Block a user