• Bartek Pacia's avatar
    FlutterExtension: make fields non-static (#141463) · dbf5f04b
    Bartek Pacia authored
    There's no issue for this PR. I can create one if requested.
    
    ## Summary
    
    This PR makes public fields of `FlutterExtension` non-static. The aim is to make migrating from Gradle Groovy DSL to Gradle Kotlin DSL easier for Flutter developers, because...
    
    ### Without this PR
    
    **android/app/build.gradle.kts**
    
    ```kotlin
    plugins {
        id "com.android.application"
        id "dev.flutter.flutter-gradle-plugin"
    }
    
    android {
        namespace = "io.flutter.examples.hello_world"
        compileSdk = FlutterExtension.compileSdkVersion
    
        defaultConfig {
            applicationId = "io.flutter.examples.hello_world"
            minSdk = FlutterExtension.minSdkVersion
            targetSdk = FlutterExtension.targetSdkVersion
            // ...
        }
    }
    // ...
    ```
    
    Groovy and Java allow accessing static fields of a class through its instance, but Kotlin is being more "correct" and disallows that.
    
    ### With this PR
    
    Thanks to this PR, the user won't have to replace `flutter` with FlutterExtension in some places, thus decreasing possible confusion.
    
    ```kotlin
    plugins {
        id "com.android.application"
        id "dev.flutter.flutter-gradle-plugin"
    }
    
    android {
        namespace = "io.flutter.examples.hello_world"
        compileSdk = flutter.compileSdkVersion
    
        defaultConfig {
            applicationId = "io.flutter.examples.hello_world"
            minSdk = flutter.minSdkVersion
            targetSdk = flutter.targetSdkVersion
            // ...
        }
    }
    // ...
    ```
    dbf5f04b
Name
Last commit
Last update
..
flutter Loading commit data...
flutter_driver Loading commit data...
flutter_goldens Loading commit data...
flutter_localizations Loading commit data...
flutter_test Loading commit data...
flutter_tools Loading commit data...
flutter_web_plugins Loading commit data...
fuchsia_remote_debug_protocol Loading commit data...
integration_test Loading commit data...
analysis_options.yaml Loading commit data...