0

我有:

plugins {
    id 'java'
    id 'net.bytebuddy.byte-buddy-gradle-plugin' version "$byteBuddyVersion"
}

byteBuddy {
    transformation {
        plugin = io.github.leoframework.testing.Logger.class
    }
}

Logger.java是项目的一部分,在 Byte Buddy 插件中。我需要在我的构建脚本中引用哪个文件/类来调用插件。编译后需要加载类文件Logger.java

4

1 回答 1

1

If it's part of the current project, it is not that trivial, unfortunately. Gradle is executed in its own JVM process that is run before the compilation what makes this somewhat a chicken and egg problem.

To overcome this, you'd need to compile the classes first, then define a subproject that depend on these classes dynamically and then execute the plugin from this subproject once the dependent classes are available.

于 2020-10-10T21:08:17.010 回答