flutter/examples/hello_world/android
Bartek Pacia ec82f0d895
Flutter Gradle Plugin: add versionName and versionCode to FlutterExtension (#146044)
This PR is a follow-up of a previous PR of mine:
https://github.com/flutter/flutter/pull/141417. It was unfinished, i.e.
I only implemented it and used it in `examples/hello_world`. No "flutter
create" templates were modified.

This change is theoretically breaking, but in practice, I am pretty sure
nobody uses this. It was not accounced anywhere, the only app using it
is `examples/hello_world`. I did not do that (that=update docs and
templates) because I wanted a solution that is idiomatic in both Gradle
and Kotlin, and only now I found time to do this.

### Without this change

```groovy
defaultConfig {
    applicationId = "io.flutter.examples.hello_world"
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode()
    versionName = flutter.versionName()
}
```

### With this change

```groovy
defaultConfig {
    applicationId = "io.flutter.examples.hello_world"
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode
    versionName = flutter.versionName
}
```

Idiomatic getter - yay! It's consistent between assignment of all four
props.

### Issue

fixes https://github.com/flutter/flutter/issues/146067

## 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] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

---------

Co-authored-by: Reid Baker <reidbaker@google.com>
2024-04-01 18:09:13 +02:00
..
app Flutter Gradle Plugin: add versionName and versionCode to FlutterExtension (#146044) 2024-04-01 18:09:13 +02:00
gradle/wrapper Refactor "app plugin loader" Gradle Plugin so it can be applied using the declarative plugins {} block (#127897) 2023-09-22 16:31:48 +00:00
build.gradle.kts Format all kotlin according to ktlint (#143390) 2024-02-14 17:58:18 +00:00
buildscript-gradle.lockfile Reland "Add support for Gradle Kotlin DSL (#140744)" (#142752) 2024-02-02 20:19:42 +00:00
gradle.properties Restore log dumps for gradle OOM crashes, and set a value for MaxMetaspaceSize (#143085) 2024-02-07 19:25:39 +00:00
project-app.lockfile Reland "Update gradle lockfiles template (#140115)" (#143081) 2024-02-08 16:22:15 +00:00
settings.gradle.kts Format all kotlin according to ktlint (#143390) 2024-02-14 17:58:18 +00:00