是的,Artifactory插件的最新版本(5.8.1)支持AGP 7.0.0配置缓存。为确保Artifactory插件能够正确与AGP 7.0.0配合使用,您需要将构建脚本中的以下代码段添加到项目的build.gradle文件中。
build.gradle:
buildscript {
dependencies {
classpath("com.android.tools.build:gradle:7.0.0")
classpath("org.jfrog.buildinfo:build-info-extractor-gradle:5.8.1")
}
}
plugins {
id("com.android.application")
id("org.jfrog.artifactory") version "5.8.1"
}
repositories {
jcenter()
}
artifactory {
contextUrl = "https://your.artifactory.com"
publish {
repository {
repoKey = "your-repo-key"
username = "your-username"
password = "your-password"
}
}
}
android {
compileSdkVersion = 30
buildToolsVersion = "30.0.3"
defaultConfig {
applicationId = "com.example.myapplication"
minSdkVersion = 22
targetSdkVersion = 30
versionCode = 1
versionName = "1.0"
}
buildFeatures {
dataBinding = true
viewBinding = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation("androidx.appcompat:appcompat:1.3.1")
implementation("com.google.android.material:material:1.4.0")
}
这段代码包括:
classpath("com.android.tools.build:gradle:7.0.0")
,将Gradle插件升级为7.0.0版本,以与Android Gradle插件(AGP)7.0.