New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can it work as a Gradle init script [Yes!] ? #253
Comments
Another example which works until I can get this sweet plugin to work is in https://stackoverflow.com/questions/45856846/how-can-i-share-build-code-script-for-all-my-gradle-projects-not-just-subprojec
|
That's odd but there is nothing different about the way the plugin is published. Have you tried running with info or debug log level turned on to perhaps get some clue? Could you also try with a specific version such as |
Aha, it was an issue with trying to use the plugin id, which apparently isn't supported in init scripts. This seems to have worked: initscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath 'com.adarshr:gradle-test-logger-plugin:+'
}
}
allprojects {
apply plugin: com.adarshr.gradle.testlogger.TestLoggerPlugin
} |
Whoops, I guess the work isn't done. Now I get this exception over and over when I run my tests:
Perhaps something to do with being written in groovy? I can test with the normal way of using this plugin and see if that also fails similarly. |
I get the same exception when using the plugin in my project's build.gradle, so perhaps just something with my setup? |
@patkujawa-wf same here |
The exception you are seeing is mostly as a result of #241 (comment). There is nothing that can be done about that if you are using Gradle < 7 and plugin version > 3.1.0 I'm afraid. |
Is it possible to use this plugin as an init script?
I use https://github.com/ben-manes/gradle-versions-plugin#using-a-gradle-init-script for all my projects, which is very convenient and allows me to keep it out of each repo. I'd like to do the same for gradle-test-logger-plugin, but I'm running into "Plugin with id 'com.adarshr.test-logger' not found." when I mimic the instructions.
I've created a
$HOME/.gradle/init.d/gradle-test-logger-plugin.gradle
(similar to my current$HOME/.gradle/init.d/add-versions-plugin.gradle
that's working) with these contents:I've tried a few variations of
repositories
and using buildscript instead of initscript, but all end up with the samePlugin with id 'com.adarshr.test-logger' not found.
failure.The text was updated successfully, but these errors were encountered: