Skip to content

Commit 2e41810

Browse files
authored
[All] Expand artifact hub to all plugins (#4645)
- Adds artifact hub check to gradle command - Add tests for build.gradle and settings.gradle check - Update all example build.gradle and settings.gradle files flutter/flutter/issues/120119 Expansion of flutter/packages#4567
1 parent ce29e50 commit 2e41810

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

example/android/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ buildscript {
1111

1212
allprojects {
1313
repositories {
14+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
15+
def artifactRepoKey = 'ARTIFACT_HUB_REPOSITORY'
16+
if (System.getenv().containsKey(artifactRepoKey)) {
17+
println "Using artifact hub"
18+
maven { url System.getenv(artifactRepoKey) }
19+
}
1420
google()
1521
mavenCentral()
1622
}

example/android/settings.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,16 @@ plugins.each { name, path ->
1313
include ":$name"
1414
project(":$name").projectDir = pluginDirectory
1515
}
16+
17+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
18+
buildscript {
19+
repositories {
20+
maven {
21+
url "https://plugins.gradle.org/m2/"
22+
}
23+
}
24+
dependencies {
25+
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
26+
}
27+
}
28+
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"

0 commit comments

Comments
 (0)