Commit Graph

250 Commits

Author SHA1 Message Date
Bartek Pacia
4b23b81828 Remove support for imperative apply of Flutter Gradle Plugin (#160947)
imperative apply has been deprecated since #139690

part of #121541

Doing this will make things easier for us during the conversion of
`flutter.groovy` into Kotlin.
2025-01-07 21:51:59 +00:00
Parker Lougheed
c946a5a526 Switch to more reliable flutter.dev link destinations in the tool (#150587)
Contributes to https://github.com/flutter/website/issues/10363.
2024-06-26 23:30:39 +00:00
Bartek Pacia
a1e1dc3f6c Reland "Warn when Gradle plugins are applied using the legacy apply script method (#140103)
> This PR relands #139690 which was reverted in #140102

This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular https://github.com/flutter/flutter/issues/121541#issuecomment-1836947311
- #135392
  - and PR that add the migration guide: [#9857](https://github.com/flutter/website/pull/9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
2023-12-19 16:03:23 +00:00
auto-submit[bot]
625bc50c39 Reverts "Warn when Gradle plugins are applied using the legacy "apply script method" way" (#140102)
Reverts flutter/flutter#139690
Initiated by: hellohuanlin
This change reverts the following previous change:
Original Description:
This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular https://github.com/flutter/flutter/issues/121541#issuecomment-1836947311
- #135392
  - and PR that add the migration guide: [#9857](https://github.com/flutter/website/pull/9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
2023-12-13 23:08:25 +00:00
Bartek Pacia
4aef59befb Warn when Gradle plugins are applied using the legacy "apply script method" way (#139690)
This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular https://github.com/flutter/flutter/issues/121541#issuecomment-1836947311
- #135392
  - and PR that add the migration guide: [#9857](https://github.com/flutter/website/pull/9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
2023-12-13 20:45:56 +00:00
Bartek Pacia
51251f2e57 Refactor Flutter Gradle Plugin so it can be applied using the declarative plugins {} block (#123511)
This PR aims to resolve #121552.

Resources used:
- [Developing Plugins](https://docs.gradle.org/current/userguide/custom_plugins.html)
- [Using Gradle Plugins](https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block)
- [Composite Builds Plugin Development Sample](https://docs.gradle.org/current/samples/sample_composite_builds_plugin_development.html)

This PR also paves way for #121541, because apps will no longer have:

```groovy
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
```

hardcoded. Instead, they'll use:

```groovy
plugins {
    // ...
    id "dev.flutter.flutter-gradle-plugin" // the exact name is tentative
}
```
2023-04-19 17:56:22 +00:00
chunhtai
55502fc36a Add vmservice for android build options (#123034)
https://github.com/flutter/flutter/issues/120408
2023-04-18 18:16:09 +00:00
Reid Baker
2723266466 i123643 print java version gradle (#123644)
#123643
- Add task to projects evaluated by flutter.gradle that will print the
java version.
- Add integration test for the existence of javaVersion and the expected
format.
- Add gradle util to get the gradlew version for a specific platform
(gradlew everywhere but windows).

Why does this code need to exist? 
Figuring out what version of java is used by flutter/gradle is done in a
few different ways that are not always aligned.
See this issue https://github.com/flutter/flutter/issues/122609 ,
this issue https://github.com/flutter/flutter/issues/121501 this feature
request https://github.com/flutter/flutter/issues/106416

As examples of why assuming the java version is dangerous. 
This task is code flutter can build upon and is the version gradle is
using to build no matter how it is configured.



## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

---------

Co-authored-by: Mitchell Goodwin <58190796+MitchellGoodwin@users.noreply.github.com>
Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
Co-authored-by: Victoria Ashworth <vashworth@google.com>
Co-authored-by: Christopher Fujino <christopherfujino@gmail.com>
Co-authored-by: Jackson Gardner <jacksongardner@google.com>
Co-authored-by: Rydmike <m.rydstrom@gmail.com>
Co-authored-by: keyonghan <54558023+keyonghan@users.noreply.github.com>
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
Co-authored-by: Taha Tesser <tessertaha@gmail.com>
Co-authored-by: Ben Konyi <bkonyi@google.com>
Co-authored-by: engine-flutter-autoroll <engine-flutter-autoroll@skia.org>
Co-authored-by: hellohuanlin <41930132+hellohuanlin@users.noreply.github.com>
Co-authored-by: Danny Tuppeny <danny@tuppeny.com>
Co-authored-by: Chris Bracken <chris@bracken.jp>
Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: Michael Goderbauer <goderbauer@google.com>
Co-authored-by: Elias Yishak <42216813+eliasyishak@users.noreply.github.com>
Co-authored-by: Christopher Fujino <fujino@google.com>
2023-04-13 18:13:58 -04:00
André Sousa
d7e851749a Fix Gradle 7 warnings that are now errors in Gradle 8 (#121958)
Fix Gradle 7 warnings that are now errors in Gradle 8
2023-03-10 18:24:49 +00:00
Ian Hickson
6205c110d6 Remove "note that" in our documentation (as per style guide) (#120842)
* lerp documentation

* Remove Note, Note That from repo

* Improve BorderSide documentation.

* apply review comments
2023-02-17 22:27:33 +00:00
Vyacheslav Egorov
025ce117b7 Correctly propagate verbosity to subtasks in flutter.gradle (#117897)
* Correctly propagate verbosity to subtasks in flutter.gradle

* Add test

* Revert accidental changes

* Fix copyright year

* Fix imports
2023-01-04 09:54:21 +00:00
Camille Simon
de357647be [Android] Bump template AGP and NDK versions (#116536)
* Bump versions

* Fix gradle errors test
2022-12-20 22:51:10 +00:00
Gary Qian
6e8ebb3771 Reland "Upgrade targetSdkVersion and compileSdkVersion to 33" (#116146) 2022-12-01 07:12:47 -08:00
Gary Qian
69a542dade Apply multidex config in kotlin dsl gradle file (#114660)
* Apply multidex login in kotlin dsl gradle file

* Cleanup

* Remove plugin parameter passing

* Cleanup

* Restore dependencies block

* Analyzer

* Compiles

* Cleanup

* Cleanup
2022-11-09 01:52:08 +00:00
Adel Khial
cece4a5d19 Fix typo in flutter.gradle (#114143) 2022-10-27 22:05:03 +00:00
Gary Qian
b373be8891 Upgrade gradle for flutter tool to 7.3.0 (#114023) 2022-10-25 19:49:51 +00:00
Gary Qian
70c1f262ea Avoid creating map literal in flutter.gradle multidex check (#113845) 2022-10-21 20:08:07 +00:00
Gary Qian
864c406b5f Scramble order of operations of flutter.gradle (#111747) 2022-10-10 19:55:08 +00:00
Brett Morgan
c0f48ba6bf Fix for Issue #112983 (#112985) 2022-10-09 05:27:38 +11:00
Zachary Anderson
1587ee0123 Revert "Upgrade targetSdkVersion and compileSdkVersion to 33 (#112936)" (#113064)
This reverts commit f80411d893.
2022-10-06 13:52:31 -07:00
Gary Qian
f80411d893 Upgrade targetSdkVersion and compileSdkVersion to 33 (#112936) 2022-10-06 20:11:28 +00:00
Zachary Anderson
74b18c948a Revert "Bump android SDK to 33" (#110861) 2022-09-02 15:52:50 +00:00
Gary Qian
35c18eb13f Bump android SDK to 33 (#109583) 2022-09-02 15:30:12 +00:00
Gary Qian
beef848630 Update flutter.gradle AGP to 7.2.0 and bump default NDK version (#109211) 2022-08-15 23:57:46 +00:00
Daco Harkes
c2e58cdb18 Add quotes to Gradle NDK version error message (#109026) 2022-08-07 11:46:08 +00:00
Gary Qian
c02be8cd47 Support string compileSdkVersion for preview android SDKs (#104662) 2022-05-31 13:08:09 -07:00
Pierre-Louis
b9528c057a Remove trailing spaces in repo (#101191)
* Remove trailing spaces

* more

* empty commit
2022-04-15 14:06:30 +02:00
Tacca
c8538873c8 95533 min sdk error msgs enhancements (#99550) 2022-03-08 16:20:21 -08:00
Emmanuel Garcia
9cb60c9828 Revert "reads min/target sdk versions from localproperties" (#99191) 2022-02-28 11:41:22 -08:00
Tacca
37a1aaf8c1 reads min/target sdk versions from localproperties (#98450) 2022-02-24 12:16:15 -08:00
Emmanuel Garcia
d2b5f34bc4 Revert "Fix how Gradle resolves Android plugin" (#98050) 2022-02-08 12:30:05 -08:00
Emmanuel Garcia
965397cfde Fix how Gradle resolves Android plugin (#97823) 2022-02-07 11:05:14 -08:00
Daco Harkes
0e2f51dfd0 FFI plugins (#96225) 2022-01-26 23:44:45 +01:00
姚春锋
f802e639b2 skip 'generateLockfiles' for add-to-app project. (#91458) 2021-11-20 10:58:06 -08:00
Camille Simon
977c35307f Add warning for bumping Android SDK version to match plugins (#92451) 2021-11-09 12:58:07 -08:00
Emmanuel Garcia
37dbe030fe Bump Android Compile SDK to 31 (#92022) 2021-10-21 18:01:33 -07:00
Gary Qian
0407aa4480 Reland "Add multidex flag and automatic multidex support (#90944)" (#92049) 2021-10-19 02:20:39 -07:00
Emmanuel Garcia
d7631275fe Bump targetSdkVersion to 31 and organize static values (#91719) 2021-10-15 13:41:48 -07:00
Zachary Anderson
a9c31eca48 Revert "Add multidex flag and automatic multidex support (#90944)" (#91791)
This reverts commit 1d9edde079.
2021-10-13 23:09:50 -07:00
Gary Qian
1d9edde079 Add multidex flag and automatic multidex support (#90944) 2021-10-13 17:48:04 -07:00
Emmanuel Garcia
e7a9adeeab Remove AndroidX workarounds (#86911) 2021-07-23 17:41:04 -07:00
Emmanuel Garcia
fa5883b78e Add Gradle lockfiles and tool to generate them (#83067) 2021-05-21 13:04:03 -07:00
Jonah Williams
50ace38c32 [flutter_tools] make bundle-sksl-path a define (#81576) 2021-04-30 17:39:07 -07:00
Jonah Williams
d9638d25d7 migrate from jcenter to mavencentral (#80908) 2021-04-21 21:41:07 -07:00
Jonah Williams
c89d57f652 [flutter_tools] make flutter.gradle compatible with 7 rc1 (#79167) 2021-03-31 10:44:04 -07:00
Shi-Hao Hong
7a88eb97ea Typo fixes (#78755) 2021-03-23 09:23:43 +08:00
Gary Qian
ee41782732 [flutter_tools] Deferred components build system (#76192) 2021-03-04 18:09:02 -08:00
Jenn Magder
e94f36a7c5 Skip assemble version check in tool backend scripts (#76414) 2021-02-22 10:54:19 -08:00
Emmanuel Garcia
da90156f8c Fix plugin java class desugar (#73758) 2021-01-13 14:09:04 -08:00
Emmanuel Garcia
f172c827cb Ensure apps can build while using AGP 3.3.0 (#71964) 2020-12-09 12:58:05 -08:00