Fix @OutputFile annotation on a String property outputFile.
This commit is contained in:
+3
-3
@@ -296,8 +296,8 @@ internal class Kotlin2JsSourceSetProcessor(
|
|||||||
val appliedPlugins = subpluginEnvironment.addSubpluginOptions(
|
val appliedPlugins = subpluginEnvironment.addSubpluginOptions(
|
||||||
project, kotlinTask, kotlinTask, null, null, sourceSet)
|
project, kotlinTask, kotlinTask, null, null, sourceSet)
|
||||||
|
|
||||||
kotlinTask.kotlinOptions.outputFile = File(kotlinTask.outputFile).absolutePath
|
kotlinTask.kotlinOptions.outputFile = kotlinTask.outputFile.absolutePath
|
||||||
val outputDir = File(kotlinTask.outputFile).parentFile
|
val outputDir = kotlinTask.outputFile.parentFile
|
||||||
|
|
||||||
if (FileUtil.isAncestor(outputDir, project.rootDir, false))
|
if (FileUtil.isAncestor(outputDir, project.rootDir, false))
|
||||||
throw InvalidUserDataException(
|
throw InvalidUserDataException(
|
||||||
@@ -323,7 +323,7 @@ internal class Kotlin2JsSourceSetProcessor(
|
|||||||
val task = project.tasks.create(taskName, Delete::class.java)
|
val task = project.tasks.create(taskName, Delete::class.java)
|
||||||
task.onlyIf { kotlinTask.kotlinOptions.sourceMap }
|
task.onlyIf { kotlinTask.kotlinOptions.sourceMap }
|
||||||
task.delete(object : Closure<String>(this) {
|
task.delete(object : Closure<String>(this) {
|
||||||
override fun call(): String? = (kotlinTask.property("outputFile") as String) + ".map"
|
override fun call(): String? = (kotlinTask.property("outputFile") as File).canonicalPath + ".map"
|
||||||
})
|
})
|
||||||
project.tasks.findByName("clean")?.dependsOn(taskName)
|
project.tasks.findByName("clean")?.dependsOn(taskName)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-5
@@ -445,8 +445,8 @@ open class Kotlin2JsCompile() : AbstractKotlinCompile<K2JSCompilerArguments>(),
|
|||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@get:OutputFile
|
@get:OutputFile
|
||||||
val outputFile: String
|
val outputFile: File
|
||||||
get() = kotlinOptions.outputFile ?: defaultOutputFile.canonicalPath
|
get() = kotlinOptions.outputFile?.let(::File) ?: defaultOutputFile
|
||||||
|
|
||||||
override fun findKotlinCompilerClasspath(project: Project): List<File> =
|
override fun findKotlinCompilerClasspath(project: Project): List<File> =
|
||||||
findKotlinJsCompilerClasspath(project)
|
findKotlinJsCompilerClasspath(project)
|
||||||
@@ -458,7 +458,7 @@ open class Kotlin2JsCompile() : AbstractKotlinCompile<K2JSCompilerArguments>(),
|
|||||||
args.apply { fillDefaultValues() }
|
args.apply { fillDefaultValues() }
|
||||||
super.setupCompilerArgs(args, defaultsOnly)
|
super.setupCompilerArgs(args, defaultsOnly)
|
||||||
|
|
||||||
args.outputFile = outputFile
|
args.outputFile = outputFile.canonicalPath
|
||||||
|
|
||||||
if (defaultsOnly) return
|
if (defaultsOnly) return
|
||||||
|
|
||||||
@@ -472,8 +472,7 @@ open class Kotlin2JsCompile() : AbstractKotlinCompile<K2JSCompilerArguments>(),
|
|||||||
internal val friendDependency
|
internal val friendDependency
|
||||||
get() = friendTaskName
|
get() = friendTaskName
|
||||||
?.let { project.getTasksByName(it, false).singleOrNull() as? Kotlin2JsCompile }
|
?.let { project.getTasksByName(it, false).singleOrNull() as? Kotlin2JsCompile }
|
||||||
?.outputFile
|
?.outputFile?.parentFile
|
||||||
?.let { File(it).parentFile }
|
|
||||||
?.let { if (LibraryUtils.isKotlinJavascriptLibrary(it)) it else null }
|
?.let { if (LibraryUtils.isKotlinJavascriptLibrary(it)) it else null }
|
||||||
?.absolutePath
|
?.absolutePath
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user