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 e8022f0 commit 71c97d0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
10 changes: 8 additions & 2 deletions 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 Expand Up @@ -39,9 +45,9 @@ gradle.projectsEvaluated {

// Workaround for several warnings when building
// that the above turns into errors, coming from
// org.checkerframework.checker.nullness.qual and
// org.checkerframework.checker.nullness.qual and
// com.google.errorprone.annotations:
//
//
// warning: Cannot find annotation method 'value()' in type
// 'EnsuresNonNull': class file for
// org.checkerframework.checker.nullness.qual.EnsuresNonNull not found
Expand Down
13 changes: 13 additions & 0 deletions 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 71c97d0

Please sign in to comment.