1 Star 0 Fork 0

codeceo/Uniplugin-hello-as

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
settings.gradle 2.80 KB
Copy Edit Raw Blame History
codeceo authored 2024-11-25 17:42 +08:00 . excel
//该pluginManagement{}块只能出现在settings.gradle(.kts)文件中,它必须是文件或初始化脚本中的第一个块:
//pluginManagement主要用于管理插件的版本和仓库,
pluginManagement {//对每个项目和全局的配置。只能在setting.gradle中配置
//pluginManagement块中的repositories用于指定Gradle插件的仓库地址,这些插件仓库通常包含了Gradle插件的发布版本。通过在pluginManagement中配置仓库地址,可以让Gradle知道从哪里获取特定插件的版本。
repositories {
google()
mavenCentral()
jcenter()
gradlePluginPortal()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
plugins { //插件配置 版本的声明 再build.gradle中引用
//id 'com.example.plugin1' version '1.0.0'
//id 'com.example.plugin2' version '2.0.0'
id 'com.android.application' version '7.3.0'
id 'com.android.library' version '7.3.0'
id 'org.jetbrains.kotlin.android' version "1.9.0"
}
resolutionStrategy {//插件策略配置
eachPlugin {
// if (requested.id.id == 'com.example.plugin1') {
// useVersion '1.0.0'
// }
// if (requested.id.id == 'com.example.plugin2') {
// useVersion '2.0.0'
// }
}
}
}
// 指定Gradle需要的用来搜索或下载【依赖dependency】的代码库
dependencyResolutionManagement {
//RepositoriesMode.PREFER_PROJECT : 解析依赖库时 , 优先使用本地仓库 , 本地仓库没有该依赖 , 则使用远程仓库 ;
//RepositoriesMode.FAIL_ON_PROJECT_REPOS : 解析依赖库时 , 强行使用远程仓库 , 不管本地仓库有没有该依赖库 ;
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
//而dependencyResolutionManagement块中的repositories用于管理项目的依赖仓库,这些依赖仓库包含了项目所需的各种依赖库(如第三方库、工具库等)的发布版本。通过在dependencyResolutionManagement中配置仓库地址,可以让Gradle知道从哪里获取项目所需的各种依赖库的版本。
//因此,简而言之,pluginManagement中的repositories用于管理Gradle插件的仓库地址,而dependencyResolutionManagement中的repositories用于管理项目依赖库的仓库地址。
repositories {
google()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://plugins.gradle.org/m2/" }
flatDir {
dirs './app/libs','./sdk/libs'
}
}
}
include ':app'
include ':uniplugin_module'
include ':uniplugin_component'
include ':uniplugin_richalert'
include ':uts-toast'
include ':sdk'
include ':export_excel'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/codeceo_net/uniplugin-hello-as.git
git@gitee.com:codeceo_net/uniplugin-hello-as.git
codeceo_net
uniplugin-hello-as
Uniplugin-hello-as
master

Search