Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Only include the repos in places where we need them #29700

Open
WhatsEmo opened this issue Mar 20, 2019 · 2 comments
Open

Android: Only include the repos in places where we need them #29700

WhatsEmo opened this issue Mar 20, 2019 · 2 comments
Labels
c: new feature Nothing broken; request for a new capability P3 Issues that are less important to the Flutter project platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-android Triaged by Android platform team

Comments

@WhatsEmo
Copy link

By default, Flutter generates the Android gradle scripts that most Flutter apps/plugins use. For the Flutter app generation, the gradle scripts put the follow at the top level gradle script:

allprojects {	
    repositories {	
        google()	
        jcenter()	
    }	
}

This is great practice for a top level gradle script that is managing many modules, but it’s a not so good practice for an one module app. The one module app should place this at the lower level app level gradle script. For the official Flutter script, having gold standard practices would prevent propagating this misunderstanding.

For the Flutter plugin generation, we have the following:

rootProject.allprojects {
    repositories {
        google()
        jcenter()
    }
}

It's forcing all apps that use this plugin to use those repositories and the plugin could only be used for that plugin. We should only be setting the repository only where it is needed.

References:
https://docs.gradle.org/current/userguide/multi_project_builds.html
https://guides.gradle.org/creating-multi-project-builds/#configure_from_above

@escamoteur escamoteur added team Infra upgrades, team productivity, code health, technical debt. See also team: labels. t: gradle "flutter build" and "flutter run" on Android platform-android Android applications specifically labels Sep 24, 2019
@escamoteur
Copy link
Contributor

Is this this of interest?

@jmagman jmagman added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 3, 2019
@jmagman jmagman added this to Awaiting triage in Tools - Gradle review Jan 10, 2020
@blasten
Copy link

blasten commented Jan 23, 2020

Good point. We shouldn't be setting this configuration in a plugin. @WhatsEmo Feel free to send a PR to update this file in the plugin template file.

@blasten blasten moved this from Awaiting triage to Engineer reviewed in Tools - Gradle review Jan 23, 2020
@jonahwilliams jonahwilliams added c: new feature Nothing broken; request for a new capability and removed team Infra upgrades, team productivity, code health, technical debt. See also team: labels. labels Feb 5, 2020
@jmagman jmagman added the P3 Issues that are less important to the Flutter project label Aug 18, 2020
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team triaged-android Triaged by Android platform team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: new feature Nothing broken; request for a new capability P3 Issues that are less important to the Flutter project platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-android Triaged by Android platform team
Projects
Tools - Gradle review
  
Engineer reviewed
Development

No branches or pull requests

6 participants