also how do i convert a gradle plugin into a stand...
# gradle
s
also how do i convert a gradle plugin into a stand alone kotlin compilable package, as i get
Copy code
[macropreprocessor@macro-pc kotlin]$ kotlinc-jvm -include-runtime -d main.jar main.kt -classpath ./
main.kt:1:26: error: unresolved reference: globalVariables
import preprocessor.base.globalVariables
                         ^
main.kt:2:27: error: unresolved reference: Sync
import preprocessor.utils.Sync
                          ^
main.kt:3:32: error: unresolved reference: abort
import preprocessor.utils.core.abort
                               ^
main.kt:7:5: error: unresolved reference: globalVariables
    globalVariables.abortOnComplete = false
    ^
main.kt:8:5: error: unresolved reference: globalVariables
    globalVariables.abortAsGradle = false
    ^
main.kt:11:5: error: unresolved reference: globalVariables
    globalVariables.initGlobals(root, proj)
    ^
main.kt:12:5: error: unresolved reference: Sync
    Sync().findSourceFilesOrNull(globalVariables.projectDirectory)
    ^
main.kt:12:34: error: unresolved reference: globalVariables
    Sync().findSourceFilesOrNull(globalVariables.projectDirectory)
                                 ^
main.kt:14:9: error: unresolved reference: globalVariables
    if (globalVariables.abortOnComplete) abort()
        ^
main.kt:14:42: error: unresolved reference: abort
    if (globalVariables.abortOnComplete) abort()
                                         ^
[macropreprocessor@macro-pc kotlin]$ pwd
/home/macropreprocessor/AndroidStudioProjects/kppmaster/buildSrc/src/main/kotlin
Copy code
import preprocessor.base.globalVariables
import preprocessor.utils.Sync
import preprocessor.utils.core.abort

fun main() {
    println("starting KOTLIN_PRE_PROCESSOR")
    globalVariables.abortOnComplete = false
    globalVariables.abortAsGradle = false
    val root = "/home/macropreprocessor/AndroidStudioProjects/kppmaster"
    val proj = "/home/macropreprocessor/AndroidStudioProjects/kppmaster/app"
    globalVariables.initGlobals(root, proj)
    Sync().findSourceFilesOrNull(globalVariables.projectDirectory)
    println("KOTLIN_PRE_PROCESSOR finished")
    if (globalVariables.abortOnComplete) abort()
}
d
You want to compile your plugin without gradle? why?
If your plugin use Gradle API, you’ll have to change your compile classpath. It can be quitte hard to do it while Gradle can do it for you 🤔
s
so i can track memory leaks
using debuggers such as VisualVM
the only Gradle API it uses is GradleException