[gradle][plugin] debug build option is introduced.
there're two optons:
1. add enableDebug option in the build.gradle:
konanArtifacts {
CsvParser {
enableDebug true
...
}
}
2. specify in command line with project properties -PenableDebug=true
This commit is contained in:
committed by
vvlevchenko
parent
91e34017c3
commit
a3568bc41c
+8
@@ -116,6 +116,8 @@ open class KonanCompileTask: KonanTargetableTask() {
|
||||
@Input var linkerOpts = mutableListOf<String>()
|
||||
internal set
|
||||
|
||||
@Input var enableDebug = project.properties.containsKey("enableDebug") && project.properties["enableDebug"].toString().toBoolean()
|
||||
internal set
|
||||
@Input var noStdLib = false
|
||||
internal set
|
||||
@Input var noMain = false
|
||||
@@ -149,6 +151,7 @@ open class KonanCompileTask: KonanTargetableTask() {
|
||||
addArgIfNotNull("-language-version", languageVersion)
|
||||
addArgIfNotNull("-api-version", apiVersion)
|
||||
|
||||
addKey("-g", enableDebug)
|
||||
addKey("-nostdlib", noStdLib)
|
||||
addKey("-nomain", noMain)
|
||||
addKey("-opt", enableOptimization)
|
||||
@@ -209,6 +212,7 @@ open class KonanCompileConfig(
|
||||
anotherTask.apiVersion?.let { apiVersion(it) }
|
||||
anotherTask.produce.let { produce(it) }
|
||||
|
||||
enableDebug(anotherTask.enableDebug)
|
||||
if (anotherTask.noStdLib) noStdLib()
|
||||
if (anotherTask.noMain) noMain()
|
||||
if (anotherTask.enableOptimization) enableOptimization()
|
||||
@@ -291,6 +295,10 @@ open class KonanCompileConfig(
|
||||
apiVersion = version
|
||||
}
|
||||
|
||||
fun enableDebug(flag: Boolean) = with(compilationTask) {
|
||||
enableDebug = flag
|
||||
}
|
||||
|
||||
fun noStdLib() = with(compilationTask) {
|
||||
noStdLib = true
|
||||
}
|
||||
|
||||
+1
@@ -148,6 +148,7 @@ internal fun dumpProperties(task: Task) {
|
||||
println("libraries : ${task.libraries}")
|
||||
println("nativeLibraries : ${task.nativeLibraries}")
|
||||
println("linkerOpts : ${task.linkerOpts}")
|
||||
println("enableDebug : ${task.enableDebug}")
|
||||
println("noStdLib : ${task.noStdLib}")
|
||||
println("noMain : ${task.noMain}")
|
||||
println("enableOptimization : ${task.enableOptimization}")
|
||||
|
||||
Reference in New Issue
Block a user