Skip to content

Commit a3ea39d

Browse files
authored
[animations] Remove .flutter-plugins reference from example app (#8002)
Removes `.flutter-plugins` reference from example by (1) deleting the `packages/animations/example/android` directory, (2) running (in the `packages/animations` directory) ``` flutter create example --platforms android -a kotlin --org "dev.flutter.packages.animations" ``` and then (3) manually made the following changes: - Added back `packages/animations/example/android/.pluginToolsConfig.yaml` (removed by command) - Updated the Gradle version from 8.7 to 8.3 (downgraded by command) - Deleted `example/analysis_options.yaml` (added by command) - Deleted `example/test/` (added by command) - Added back artifact hub - Removed template TODOs - Bumped Kotlin Gradle version to 1.9.0 - Bumped AGP version from 8.1.0 to 8.5.1. Part of flutter/flutter#157660.
1 parent 036d1bd commit a3ea39d

File tree

16 files changed

+182
-105
lines changed

16 files changed

+182
-105
lines changed

packages/animations/example/.metadata

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,27 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 0bced151e44ffa138e608c2e2dbff3309ab8bd75
8-
channel: master
7+
revision: "603104015dd692ea3403755b55d07813d5cf8965"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
17+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
18+
- platform: android
19+
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
20+
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

packages/animations/example/android/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ gradle-wrapper.jar
55
/gradlew.bat
66
/local.properties
77
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/to/reference-keystore
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,14 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
17-
}
18-
19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
226
}
237

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
288
android {
29-
namespace 'dev.flutter.packages.animations.example'
30-
compileSdk flutter.compileSdkVersion
9+
namespace = "dev.flutter.packages.animations.example"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
3112

3213
compileOptions {
3314
sourceCompatibility JavaVersion.VERSION_11
@@ -42,36 +23,21 @@ android {
4223
main.java.srcDirs += 'src/main/kotlin'
4324
}
4425

45-
4626
defaultConfig {
47-
applicationId "dev.flutter.packages.animations.example"
48-
minSdkVersion flutter.minSdkVersion
49-
targetSdkVersion 32
50-
versionCode flutterVersionCode.toInteger()
51-
versionName flutterVersionName
52-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
27+
applicationId = "dev.flutter.packages.animations.example"
28+
minSdk = flutter.minSdkVersion
29+
targetSdk = flutter.targetSdkVersion
30+
versionCode = flutter.versionCode
31+
versionName = flutter.versionName
5332
}
5433

5534
buildTypes {
5635
release {
57-
// TODO: Add your own signing config for the release build.
58-
// Signing with the debug keys for now, so `flutter run --release` works.
59-
signingConfig signingConfigs.debug
36+
signingConfig = signingConfigs.debug
6037
}
6138
}
62-
namespace 'dev.flutter.packages.animations.example'
63-
lint {
64-
disable 'InvalidPackage'
65-
}
6639
}
6740

6841
flutter {
69-
source '../..'
70-
}
71-
72-
dependencies {
73-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
74-
testImplementation 'junit:junit:4.12'
75-
androidTestImplementation 'androidx.test:runner:1.1.1'
76-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
42+
source = "../.."
7743
}

packages/animations/example/android/app/src/debug/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2-
<!-- Flutter needs it to communicate with the running application
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
34
to allow setting breakpoints, to provide hot reload, etc.
45
-->
56
<uses-permission android:name="android.permission.INTERNET"/>

packages/animations/example/android/app/src/main/AndroidManifest.xml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<application
33
android:label="example"
4+
android:name="${applicationName}"
45
android:icon="@mipmap/ic_launcher">
56
<activity
67
android:name=".MainActivity"
8+
android:exported="true"
79
android:launchMode="singleTop"
10+
android:taskAffinity=""
811
android:theme="@style/LaunchTheme"
9-
android:exported="true"
1012
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1113
android:hardwareAccelerated="true"
1214
android:windowSoftInputMode="adjustResize">
15+
<!-- Specifies an Android theme to apply to this Activity as soon as
16+
the Android process has started. This theme is visible to the user
17+
while the Flutter UI initializes. After that, this theme continues
18+
to determine the Window background behind the Flutter UI. -->
19+
<meta-data
20+
android:name="io.flutter.embedding.android.NormalTheme"
21+
android:resource="@style/NormalTheme"
22+
/>
1323
<intent-filter>
1424
<action android:name="android.intent.action.MAIN"/>
1525
<category android:name="android.intent.category.LAUNCHER"/>
@@ -21,4 +31,15 @@
2131
android:name="flutterEmbedding"
2232
android:value="2" />
2333
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
2445
</manifest>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4+
45
package dev.flutter.packages.animations.example
56

67
import io.flutter.embedding.android.FlutterActivity
78

8-
class MainActivity : FlutterActivity() {}
9+
class MainActivity : FlutterActivity()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<!-- Show a splash screen on the activity. Automatically removed when
6+
the Flutter engine draws its first frame -->
7+
<item name="android:windowBackground">@drawable/launch_background</item>
8+
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
18+
</resources>
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
45
<!-- Show a splash screen on the activity. Automatically removed when
5-
Flutter draws its first frame -->
6+
the Flutter engine draws its first frame -->
67
<item name="android:windowBackground">@drawable/launch_background</item>
78
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
818
</resources>

packages/animations/example/android/app/src/profile/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2-
<!-- Flutter needs it to communicate with the running application
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
34
to allow setting breakpoints, to provide hot reload, etc.
45
-->
56
<uses-permission android:name="android.permission.INTERNET"/>

0 commit comments

Comments
 (0)