Generate KotlinMultiplatformCommonOptions and <...>OptionsBase.

This commit is contained in:
Sergey Igushkin
2017-10-09 15:47:37 +03:00
parent 8cdef4139e
commit e06d60174d
3 changed files with 97 additions and 0 deletions
@@ -122,6 +122,25 @@ fun generateKotlinGradleOptions(withPrinterToFile: (targetFile: File, Printer.()
k2JsDceArgumentsFqName,
commonOptions + jsDceOptions)
}
// generate multiplatform common interface and implementation
val multiplatformCommonInterfaceFqName = FqName("org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformCommonOptions")
val multiplatformCommonOptions = gradleOptions<K2MetadataCompilerArguments>()
withPrinterToFile(File(srcDir, multiplatformCommonInterfaceFqName)) {
generateInterface(multiplatformCommonInterfaceFqName,
multiplatformCommonOptions,
parentType = commonCompilerInterfaceFqName)
}
val k2metadataCompilerArgumentsFqName = FqName(K2MetadataCompilerArguments::class.qualifiedName!!)
val multiplatformCommonImplFqName = FqName(multiplatformCommonInterfaceFqName.asString() + "Base")
withPrinterToFile(File(srcDir, multiplatformCommonImplFqName)) {
generateImpl(multiplatformCommonImplFqName,
multiplatformCommonInterfaceFqName,
k2metadataCompilerArgumentsFqName,
commonOptions + commonCompilerOptions + multiplatformCommonOptions)
}
}
fun main(args: Array<String>) {