mirror of
https://github.com/flutter/packages.git
synced 2025-06-30 06:37:17 +08:00
[Tooling] Add google owned cache for dependencies as an option in ci (#4567)
Proof of concept of a package using artifact hub. Artifact hub is a google owned and managed cache of google/maven dependencies. Using this cache should decrease the number of flakes related to downloading dependencies along with future benefits of licence analysis and security alerts. Read more at go/artifact-hub#maven flutter/flutter/issues/120119 Nest steps: Enable a new env variable on CI servers. https://flutter-review.googlesource.com/c/recipes/+/48260 cl/551888350 Merge this PR. Apply this change to all packages Add enforcement as part of the gradle check. Developers have a new dependency for buildscript but it is publicly available, so I added a next changelog.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
buildscript {
|
||||
// This version should intentionally be a 1.7.* version and lower than the
|
||||
// This version should intentionally be a 1.7.* version and lower than the
|
||||
// version of kotlin-bom defined in packages/camera/camera_android_camerax/android/build.gradle.
|
||||
// This tests that the kotlin version resolution continues to work.
|
||||
// This tests that the kotlin version resolution continues to work.
|
||||
ext.kotlin_version = '1.7.10'
|
||||
repositories {
|
||||
google()
|
||||
@ -16,6 +16,12 @@ buildscript {
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
|
||||
def artifactRepoKey = 'ARTIFACT_HUB_REPOSITORY'
|
||||
if (System.getenv().containsKey(artifactRepoKey)) {
|
||||
println "Using artifact hub"
|
||||
maven { url System.getenv(artifactRepoKey) }
|
||||
}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
|
||||
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {
|
||||
url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
|
||||
}
|
||||
}
|
||||
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"
|
||||
|
Reference in New Issue
Block a user