Skip to content

Commit

Permalink
[All] Expand artifact hub to all plugins (#4645)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
reidbaker authored Aug 7, 2023
1 parent d9c070e commit af0316e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webview_flutter/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
13 changes: 13 additions & 0 deletions webview_flutter/example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 6 additions & 0 deletions webview_flutter_android/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
13 changes: 13 additions & 0 deletions webview_flutter_android/example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit af0316e

Please sign in to comment.