Comments (7)
Well, it does work with build.gradle.kts files.
I am creating the Plugins object currently. This is what I find very, very helpful:
import org.gradle.kotlin.dsl.kotlin
import org.gradle.plugin.use.PluginDependencySpec
object Plugins {
const val dokka: String = "org.jetbrains.dokka"
const val shadow: String = "com.github.johnrengelman.shadow"
const val buildSrcVersions: String = "de.fayard.buildSrcVersions"
const val kotlinxSerialization: String = "kotlinx-serialization"
const val download: String = "de.undercouch.download"
}
inline val org.gradle.plugin.use.PluginDependenciesSpec.kotlinJvm: PluginDependencySpec
get() = kotlin("jvm")
inline val org.gradle.plugin.use.PluginDependenciesSpec.kotlinStdLibJdk8: PluginDependencySpec
get() = kotlin("stdlib-jdk8")
inline val org.gradle.plugin.use.PluginDependenciesSpec.kotlinMultiplatform: PluginDependencySpec
get() = kotlin("multiplatform")
inline val org.gradle.plugin.use.PluginDependenciesSpec.kotlinxSerialization: PluginDependencySpec
get() = id(Plugins.kotlinxSerialization)
inline val org.gradle.plugin.use.PluginDependenciesSpec.shadow: PluginDependencySpec
get() = id(Plugins.shadow)
inline val org.gradle.plugin.use.PluginDependenciesSpec.launch4j: PluginDependencySpec
get() = id(Plugins.launch4j)
inline val org.gradle.plugin.use.PluginDependenciesSpec.download: PluginDependencySpec
get() = id(Plugins.download)
You get the idea?
I use the string constants with "apply" and the extension methods within a "plugins" block
from refreshversions.
@jschneider can you try to create manually the Plugins
object in the buildSrc and see if that works? Ideally both in a bruild.gradle
and build.gradle.kts
file
I remember that Gradle was really restrictive on what can be done in the plugins { ... }
block, because they want to be able to parse it in a static matter in order to provide IDE support
from refreshversions.
@jschneider
Any reason to not include the version like this?
inline val org.gradle.plugin.use.PluginDependenciesSpec.kotlinJvm: PluginDependencySpec
get() = kotlin("jvm").version(Versions.org_jetbrains_kotlin_jvm_gradle_plugin)
from refreshversions.
Good point. Thanks! Will give it a try.
from refreshversions.
@jschneider As a first step, I added an accessor for the plugin itself, so that it's easy to update its version.
If you want to see if it can be generalized, look here
from refreshversions.
One think about the version: The version can only be set once for a plugin (e.g. in the top level build.gradle.kts with apply false).
from refreshversions.
@jschneider I have no plans to have the plug-in generate a Plugins.kt
file. Seems too hard to do correctly in all cases. Writing it manually like in your example is the best solution imho
from refreshversions.
Related Issues (20)
- Support - Declaring a version catalog HOT 2
- JAVA_17 HOT 2
- gradle/libs.versions.toml gets generated under buildSrc directory HOT 1
- Add dependency to build.gradle can not success gradle sync
- `[plugins]` section in `libs.versions.toml` is moved to the top by `refreshVersions` HOT 2
- Dead link in README HOT 1
- Clarification when using AndroidX.compose.bom HOT 3
- Bug: property 'defaultVersionCatalogFile$refreshVersions_core' specifies file '${projectRoot}/gradle/libs.versions.toml' which doesn't exist HOT 2
- org.glassfish.jaxb:jaxb-runtime is used but marked as unused HOT 5
- Dependencies in the classpath configuration in the buildscript block of build.gradle are marked unused HOT 18
- Is it possible to retrieve the version through plugin? HOT 1
- Version alignement issue HOT 9
- refreshVersions plugin causes classpath issues when applied with wire plugin HOT 6
- Property settings not initialized yet! Has it been used after reset or before init? HOT 9
- Support refreshing versions for plugin jar artifacts HOT 2
- refreshVersionsMigrate does not work with some dependencies that has dot(.) in their name.
- Sample for KSP
- Comparison method violates its general contract! HOT 1
- [Regression] NPM dependency with group not detected(!?). E.g. npm("@fontsource/inter", "_") HOT 2
- Make constants in Libs.kt configurable/longer/...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from refreshversions.