Skip to content
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

插件:classpath "com.github.xiaojinzi123.Component:component-plugin:<version>" 如何使用 toml 进行管理? #143

Open
jiaoya opened this issue Aug 12, 2024 · 1 comment
Labels

Comments

@jiaoya
Copy link

jiaoya commented Aug 12, 2024

gardle升级后,使用新的依赖管理:libs.versions.toml,就不能支持classpath与apply plugin:管理插件了,那这插件要如何进行引入呢?就是使用:plugins {
alias(libs.plugins.component.plugin)
}

@jiaoya
Copy link
Author

jiaoya commented Aug 12, 2024

步骤如下:
libs.versions.toml中的插件声明:
[versions]
componentCompiler = "1.9.6"
[plugins]
component-plugin = { id = "com.xiaojinzi.component.plugin", version.ref = "componentCompiler" }

第一:确定你的插件仓库地址:比如这个component.plugin的地址是 https://jitpack.io
第二:在settings.gradle的pluginManagement中导入仓库:maven {
allowInsecureProtocol = true
url 'https://jitpack.io'
}
第三:在settings.gradle的pluginManagement中,引入插件,入下:
// 没有发布到gradlePlugin插件仓库,所以需要手动指定
resolutionStrategy {
eachPlugin {
if (requested.id.id == "com.xiaojinzi.component.plugin") {
useModule("com.github.xiaojinzi123.Component:component-plugin:${requested.version}")
}
}
}
第四:手动同步下

@xiaojinzi123 xiaojinzi123 changed the title 插件:classpath "com.github.xiaojinzi123.Component:component-plugin:<version>" 如何使用 toml进行管理? 插件:classpath "com.github.xiaojinzi123.Component:component-plugin:<version>" 如何使用 toml 进行管理? Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants