Skip to content

Can it work as a Gradle init script [Yes!] ? #253

@patkujawa-wf

Description

@patkujawa-wf

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:

initscript {
    repositories {
        gradlePluginPortal()
        // maven {
        //     url 'https://plugins.gradle.org/m2/'
        // }
    }
    dependencies {
        classpath 'com.adarshr:gradle-test-logger-plugin:+'
    }
}

allprojects {
    apply plugin: 'com.adarshr.test-logger'
}

I've tried a few variations of repositories and using buildscript instead of initscript, but all end up with the same Plugin with id 'com.adarshr.test-logger' not found. failure.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions