ktlint-gradle icon indicating copy to clipboard operation
ktlint-gradle copied to clipboard

Automatically add ktlint repository

Open Tapchicoma opened this issue 6 years ago • 3 comments

Starting Gradle 5.1 it is possible to pin repository to specific artefact. Plugin should check Gradle version and add a repository configuration for ktlint. This should simplify plugin setup.

Docs to look into: https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/repositories/MavenArtifactRepository.html#mavenContent-org.gradle.api.Action-

Tapchicoma avatar Mar 12 '19 21:03 Tapchicoma

Chiming in to also consider the "enterprise" style use case, where all repositories must be internal.

mkobit avatar Apr 24 '19 18:04 mkobit

Yea, I've thought about this pinning as well. There are security reasons why you'd want to do this. I agree it's a noble desire, but I agree with @mkobit here.

I can't think of any good way of doing this for the "enterprise" use case which I have to support for myself as well.

JLLeitschuh avatar Apr 24 '19 19:04 JLLeitschuh

We can introduce extenstion property pinRepository with default value true. In case of "enterprise" - consumers should set it to false.

Tapchicoma avatar Apr 27 '19 20:04 Tapchicoma