Skip to content

Commit ced1843

Browse files
committed
Update platforms
1 parent dae9bf1 commit ced1843

30 files changed

+1054
-38
lines changed

android/.gitignore

+6
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/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks

android/app/build.gradle

+12-7
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,26 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 28
29+
compileSdkVersion flutter.compileSdkVersion
3030

31-
sourceSets {
32-
main.java.srcDirs += 'src/main/kotlin'
31+
compileOptions {
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
34+
}
35+
36+
kotlinOptions {
37+
jvmTarget = '1.8'
3338
}
3439

35-
lintOptions {
36-
disable 'InvalidPackage'
40+
sourceSets {
41+
main.java.srcDirs += 'src/main/kotlin'
3742
}
3843

3944
defaultConfig {
4045
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4146
applicationId "com.example.wdb106_sample"
42-
minSdkVersion 16
43-
targetSdkVersion 28
47+
minSdkVersion flutter.minSdkVersion
48+
targetSdkVersion flutter.targetSdkVersion
4449
versionCode flutterVersionCode.toInteger()
4550
versionName flutterVersionName
4651
}

android/app/src/main/AndroidManifest.xml

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.example.wdb106_sample">
3-
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
4-
calls FlutterMain.startInitialization(this); in its onCreate method.
5-
In most cases you can leave this as-is, but you if you want to provide
6-
additional functionality it is fine to subclass or reimplement
7-
FlutterApplication and put your custom class here. -->
8-
<application
9-
android:name="io.flutter.app.FlutterApplication"
3+
<application
104
android:label="wdb106_sample"
5+
android:name="${applicationName}"
116
android:icon="@mipmap/ic_launcher">
127
<activity
138
android:name=".MainActivity"
9+
android:exported="true"
1410
android:launchMode="singleTop"
1511
android:theme="@style/LaunchTheme"
1612
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
@@ -24,15 +20,6 @@
2420
android:name="io.flutter.embedding.android.NormalTheme"
2521
android:resource="@style/NormalTheme"
2622
/>
27-
<!-- Displays an Android View that continues showing the launch screen
28-
Drawable until Flutter paints its first frame, then this splash
29-
screen fades out. A splash screen is useful to avoid any visual
30-
gap between the end of Android's launch screen and the painting of
31-
Flutter's first frame. -->
32-
<meta-data
33-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
34-
android:resource="@drawable/launch_background"
35-
/>
3623
<intent-filter>
3724
<action android:name="android.intent.action.MAIN"/>
3825
<category android:name="android.intent.category.LAUNCHER"/>
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>
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+
Flutter 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>
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<!-- Theme applied to the Android Window while the process is starting -->
4-
<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">
55
<!-- Show a splash screen on the activity. Automatically removed when
66
Flutter draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
@@ -10,9 +10,9 @@
1010
This theme determines the color of the Android Window while your
1111
Flutter UI initializes, as well as behind your Flutter UI while its
1212
running.
13-
13+
1414
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:color/white</item>
15+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
1717
</style>
1818
</resources>

android/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
buildscript {
2-
ext.kotlin_version = '1.3.50'
2+
ext.kotlin_version = '1.6.10'
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.5.0'
9+
classpath 'com.android.tools.build:gradle:4.1.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
1313

1414
allprojects {
1515
repositories {
1616
google()
17-
jcenter()
17+
mavenCentral()
1818
}
1919
}
2020

android/gradle.properties

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
org.gradle.jvmargs=-Xmx1536M
2-
android.enableR8=true
32
android.useAndroidX=true
43
android.enableJetifier=true

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

android/settings.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// Copyright 2014 The Flutter Authors. All rights reserved.
2-
// Use of this source code is governed by a BSD-style license that can be
3-
// found in the LICENSE file.
4-
51
include ':app'
62

73
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")

web/icons/Icon-maskable-192.png

5.46 KB
Loading

web/icons/Icon-maskable-512.png

20.5 KB
Loading

windows/.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
flutter/ephemeral/
2+
3+
# Visual Studio user-specific files.
4+
*.suo
5+
*.user
6+
*.userosscache
7+
*.sln.docstates
8+
9+
# Visual Studio build-related files.
10+
x64/
11+
x86/
12+
13+
# Visual Studio cache files
14+
# files ending in .cache can be ignored
15+
*.[Cc]ache
16+
# but keep track of directories ending in .cache
17+
!*.[Cc]ache/

windows/CMakeLists.txt

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
project(wdb106_sample LANGUAGES CXX)
3+
4+
set(BINARY_NAME "wdb106_sample")
5+
6+
cmake_policy(SET CMP0063 NEW)
7+
8+
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
9+
10+
# Configure build options.
11+
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
12+
if(IS_MULTICONFIG)
13+
set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
14+
CACHE STRING "" FORCE)
15+
else()
16+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
17+
set(CMAKE_BUILD_TYPE "Debug" CACHE
18+
STRING "Flutter build mode" FORCE)
19+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
20+
"Debug" "Profile" "Release")
21+
endif()
22+
endif()
23+
24+
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
25+
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
26+
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
27+
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
28+
29+
# Use Unicode for all projects.
30+
add_definitions(-DUNICODE -D_UNICODE)
31+
32+
# Compilation settings that should be applied to most targets.
33+
function(APPLY_STANDARD_SETTINGS TARGET)
34+
target_compile_features(${TARGET} PUBLIC cxx_std_17)
35+
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
36+
target_compile_options(${TARGET} PRIVATE /EHsc)
37+
target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
38+
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
39+
endfunction()
40+
41+
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
42+
43+
# Flutter library and tool build rules.
44+
add_subdirectory(${FLUTTER_MANAGED_DIR})
45+
46+
# Application build
47+
add_subdirectory("runner")
48+
49+
# Generated plugin build rules, which manage building the plugins and adding
50+
# them to the application.
51+
include(flutter/generated_plugins.cmake)
52+
53+
54+
# === Installation ===
55+
# Support files are copied into place next to the executable, so that it can
56+
# run in place. This is done instead of making a separate bundle (as on Linux)
57+
# so that building and running from within Visual Studio will work.
58+
set(BUILD_BUNDLE_DIR "$<TARGET_FILE_DIR:${BINARY_NAME}>")
59+
# Make the "install" step default, as it's required to run.
60+
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
61+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
62+
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
63+
endif()
64+
65+
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
66+
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
67+
68+
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
69+
COMPONENT Runtime)
70+
71+
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
72+
COMPONENT Runtime)
73+
74+
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
75+
COMPONENT Runtime)
76+
77+
if(PLUGIN_BUNDLED_LIBRARIES)
78+
install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
79+
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
80+
COMPONENT Runtime)
81+
endif()
82+
83+
# Fully re-copy the assets directory on each build to avoid having stale files
84+
# from a previous install.
85+
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
86+
install(CODE "
87+
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
88+
" COMPONENT Runtime)
89+
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
90+
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
91+
92+
# Install the AOT library on non-Debug builds only.
93+
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
94+
CONFIGURATIONS Profile;Release
95+
COMPONENT Runtime)

windows/flutter/CMakeLists.txt

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
4+
5+
# Configuration provided via flutter tool.
6+
include(${EPHEMERAL_DIR}/generated_config.cmake)
7+
8+
# TODO: Move the rest of this into files in ephemeral. See
9+
# https://github.com/flutter/flutter/issues/57146.
10+
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
11+
12+
# === Flutter Library ===
13+
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
14+
15+
# Published to parent scope for install step.
16+
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
17+
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
18+
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
19+
set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
20+
21+
list(APPEND FLUTTER_LIBRARY_HEADERS
22+
"flutter_export.h"
23+
"flutter_windows.h"
24+
"flutter_messenger.h"
25+
"flutter_plugin_registrar.h"
26+
"flutter_texture_registrar.h"
27+
)
28+
list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
29+
add_library(flutter INTERFACE)
30+
target_include_directories(flutter INTERFACE
31+
"${EPHEMERAL_DIR}"
32+
)
33+
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
34+
add_dependencies(flutter flutter_assemble)
35+
36+
# === Wrapper ===
37+
list(APPEND CPP_WRAPPER_SOURCES_CORE
38+
"core_implementations.cc"
39+
"standard_codec.cc"
40+
)
41+
list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
42+
list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
43+
"plugin_registrar.cc"
44+
)
45+
list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
46+
list(APPEND CPP_WRAPPER_SOURCES_APP
47+
"flutter_engine.cc"
48+
"flutter_view_controller.cc"
49+
)
50+
list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
51+
52+
# Wrapper sources needed for a plugin.
53+
add_library(flutter_wrapper_plugin STATIC
54+
${CPP_WRAPPER_SOURCES_CORE}
55+
${CPP_WRAPPER_SOURCES_PLUGIN}
56+
)
57+
apply_standard_settings(flutter_wrapper_plugin)
58+
set_target_properties(flutter_wrapper_plugin PROPERTIES
59+
POSITION_INDEPENDENT_CODE ON)
60+
set_target_properties(flutter_wrapper_plugin PROPERTIES
61+
CXX_VISIBILITY_PRESET hidden)
62+
target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
63+
target_include_directories(flutter_wrapper_plugin PUBLIC
64+
"${WRAPPER_ROOT}/include"
65+
)
66+
add_dependencies(flutter_wrapper_plugin flutter_assemble)
67+
68+
# Wrapper sources needed for the runner.
69+
add_library(flutter_wrapper_app STATIC
70+
${CPP_WRAPPER_SOURCES_CORE}
71+
${CPP_WRAPPER_SOURCES_APP}
72+
)
73+
apply_standard_settings(flutter_wrapper_app)
74+
target_link_libraries(flutter_wrapper_app PUBLIC flutter)
75+
target_include_directories(flutter_wrapper_app PUBLIC
76+
"${WRAPPER_ROOT}/include"
77+
)
78+
add_dependencies(flutter_wrapper_app flutter_assemble)
79+
80+
# === Flutter tool backend ===
81+
# _phony_ is a non-existent file to force this command to run every time,
82+
# since currently there's no way to get a full input/output list from the
83+
# flutter tool.
84+
set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
85+
set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
86+
add_custom_command(
87+
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
88+
${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
89+
${CPP_WRAPPER_SOURCES_APP}
90+
${PHONY_OUTPUT}
91+
COMMAND ${CMAKE_COMMAND} -E env
92+
${FLUTTER_TOOL_ENVIRONMENT}
93+
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
94+
windows-x64 $<CONFIG>
95+
VERBATIM
96+
)
97+
add_custom_target(flutter_assemble DEPENDS
98+
"${FLUTTER_LIBRARY}"
99+
${FLUTTER_LIBRARY_HEADERS}
100+
${CPP_WRAPPER_SOURCES_CORE}
101+
${CPP_WRAPPER_SOURCES_PLUGIN}
102+
${CPP_WRAPPER_SOURCES_APP}
103+
)

0 commit comments

Comments
 (0)