Skip to content

Commit 6cb2a32

Browse files
authored
[All] Expand artifact hub to all plugins (flutter#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#4567
1 parent fa86f8a commit 6cb2a32

File tree

84 files changed

+1089
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1089
-8
lines changed

packages/animations/example/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ buildscript {
1313

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

packages/animations/example/android/settings.gradle

+13
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"

packages/camera/camera/example/android/build.gradle

+6
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
}

packages/camera/camera/example/android/settings.gradle

+13
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"

packages/camera/camera_android/example/android/build.gradle

+6
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
}

packages/camera/camera_android/example/android/settings.gradle

+13
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"

packages/dynamic_layouts/example/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ buildscript {
1313

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

packages/dynamic_layouts/example/android/settings.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
99
def flutterSdkPath = properties.getProperty("flutter.sdk")
1010
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
1111
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12+
13+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
14+
buildscript {
15+
repositories {
16+
maven {
17+
url "https://plugins.gradle.org/m2/"
18+
}
19+
}
20+
dependencies {
21+
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
22+
}
23+
}
24+
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"

packages/espresso/example/android/build.gradle

+6
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
}

packages/espresso/example/android/settings.gradle

+13
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"

packages/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ buildscript {
1212

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

packages/extension_google_sign_in_as_googleapis_auth/example/android/settings.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
99
def flutterSdkPath = properties.getProperty("flutter.sdk")
1010
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
1111
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12+
13+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
14+
buildscript {
15+
repositories {
16+
maven {
17+
url "https://plugins.gradle.org/m2/"
18+
}
19+
}
20+
dependencies {
21+
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
22+
}
23+
}
24+
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"

packages/file_selector/file_selector/example/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ buildscript {
1313

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

packages/file_selector/file_selector/example/android/settings.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
99
def flutterSdkPath = properties.getProperty("flutter.sdk")
1010
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
1111
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12+
13+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
14+
buildscript {
15+
repositories {
16+
maven {
17+
url "https://plugins.gradle.org/m2/"
18+
}
19+
}
20+
dependencies {
21+
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
22+
}
23+
}
24+
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"

packages/file_selector/file_selector_android/example/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ buildscript {
1313

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

packages/file_selector/file_selector_android/example/android/settings.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
99
def flutterSdkPath = properties.getProperty("flutter.sdk")
1010
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
1111
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12+
13+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
14+
buildscript {
15+
repositories {
16+
maven {
17+
url "https://plugins.gradle.org/m2/"
18+
}
19+
}
20+
dependencies {
21+
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
22+
}
23+
}
24+
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"

packages/flutter_adaptive_scaffold/example/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ buildscript {
1313

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

packages/flutter_adaptive_scaffold/example/android/settings.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
99
def flutterSdkPath = properties.getProperty("flutter.sdk")
1010
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
1111
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12+
13+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
14+
buildscript {
15+
repositories {
16+
maven {
17+
url "https://plugins.gradle.org/m2/"
18+
}
19+
}
20+
dependencies {
21+
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
22+
}
23+
}
24+
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"

packages/flutter_markdown/example/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ buildscript {
1313

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

packages/flutter_markdown/example/android/settings.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
99
def flutterSdkPath = properties.getProperty("flutter.sdk")
1010
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
1111
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12+
13+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
14+
buildscript {
15+
repositories {
16+
maven {
17+
url "https://plugins.gradle.org/m2/"
18+
}
19+
}
20+
dependencies {
21+
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
22+
}
23+
}
24+
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"

packages/flutter_plugin_android_lifecycle/example/android/build.gradle

+6
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
}

packages/flutter_plugin_android_lifecycle/example/android/settings.gradle

+13
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"

packages/go_router/example/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ buildscript {
1313

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

packages/go_router/example/android/settings.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
99
def flutterSdkPath = properties.getProperty("flutter.sdk")
1010
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
1111
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12+
13+
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
14+
buildscript {
15+
repositories {
16+
maven {
17+
url "https://plugins.gradle.org/m2/"
18+
}
19+
}
20+
dependencies {
21+
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
22+
}
23+
}
24+
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"

packages/google_maps_flutter/google_maps_flutter/example/android/build.gradle

+6
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
}

packages/google_maps_flutter/google_maps_flutter/example/android/settings.gradle

+13
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)