From af0316ebcbfa31f93cd25f440a9618faa6e51c58 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Mon, 7 Aug 2023 11:33:26 -0700 Subject: [PATCH] [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 https://github.com/flutter/packages/pull/4567 --- webview_flutter/example/android/build.gradle | 6 ++++++ webview_flutter/example/android/settings.gradle | 13 +++++++++++++ .../example/android/build.gradle | 6 ++++++ .../example/android/settings.gradle | 13 +++++++++++++ 4 files changed, 38 insertions(+) diff --git a/webview_flutter/example/android/build.gradle b/webview_flutter/example/android/build.gradle index 0822484..6ae7ddc 100644 --- a/webview_flutter/example/android/build.gradle +++ b/webview_flutter/example/android/build.gradle @@ -11,6 +11,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() } diff --git a/webview_flutter/example/android/settings.gradle b/webview_flutter/example/android/settings.gradle index 5a2f14f..8d75433 100644 --- a/webview_flutter/example/android/settings.gradle +++ b/webview_flutter/example/android/settings.gradle @@ -13,3 +13,16 @@ plugins.each { name, path -> include ":$name" project(":$name").projectDir = pluginDirectory } + +// 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" diff --git a/webview_flutter_android/example/android/build.gradle b/webview_flutter_android/example/android/build.gradle index 566572b..f87c8c6 100644 --- a/webview_flutter_android/example/android/build.gradle +++ b/webview_flutter_android/example/android/build.gradle @@ -11,6 +11,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() } diff --git a/webview_flutter_android/example/android/settings.gradle b/webview_flutter_android/example/android/settings.gradle index 5a2f14f..8d75433 100644 --- a/webview_flutter_android/example/android/settings.gradle +++ b/webview_flutter_android/example/android/settings.gradle @@ -13,3 +13,16 @@ plugins.each { name, path -> include ":$name" project(":$name").projectDir = pluginDirectory } + +// 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"