@sentry/wizard 3.39.0 → 3.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +3 -3
- package/dist/e2e-tests/tests/flutter.test.d.ts +1 -0
- package/dist/e2e-tests/tests/flutter.test.js +190 -0
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -0
- package/dist/e2e-tests/utils/index.d.ts +11 -0
- package/dist/e2e-tests/utils/index.js +36 -1
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.d.ts +1 -0
- package/dist/lib/Constants.js +5 -0
- package/dist/lib/Constants.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/apple/apple-wizard.js +1 -1
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/xcode-manager.d.ts +4 -4
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.d.ts +17 -0
- package/dist/src/flutter/code-tools.js +263 -0
- package/dist/src/flutter/code-tools.js.map +1 -0
- package/dist/src/flutter/flutter-wizard.d.ts +2 -0
- package/dist/src/flutter/flutter-wizard.js +171 -0
- package/dist/src/flutter/flutter-wizard.js.map +1 -0
- package/dist/src/flutter/templates.d.ts +9 -0
- package/dist/src/flutter/templates.js +40 -0
- package/dist/src/flutter/templates.js.map +1 -0
- package/dist/src/run.d.ts +1 -1
- package/dist/src/run.js +39 -32
- package/dist/src/run.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +1 -1
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/test/flutter/code-tools.test.d.ts +1 -0
- package/dist/test/flutter/code-tools.test.js +84 -0
- package/dist/test/flutter/code-tools.test.js.map +1 -0
- package/dist/test/flutter/templates.test.d.ts +1 -0
- package/dist/test/flutter/templates.test.js +41 -0
- package/dist/test/flutter/templates.test.js.map +1 -0
- package/e2e-tests/README.md +5 -1
- package/e2e-tests/test-applications/flutter-test-app/.metadata +45 -0
- package/e2e-tests/test-applications/flutter-test-app/README.md +16 -0
- package/e2e-tests/test-applications/flutter-test-app/analysis_options.yaml +28 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/build.gradle +44 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/debug/AndroidManifest.xml +7 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/AndroidManifest.xml +45 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/kotlin/com/example/flutter_magic/MainActivity.kt +5 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable/launch_background.xml +12 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values/styles.xml +18 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values-night/styles.xml +18 -0
- package/e2e-tests/test-applications/flutter-test-app/android/app/src/profile/AndroidManifest.xml +7 -0
- package/e2e-tests/test-applications/flutter-test-app/android/build.gradle +18 -0
- package/e2e-tests/test-applications/flutter-test-app/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/e2e-tests/test-applications/flutter-test-app/android/gradle.properties +3 -0
- package/e2e-tests/test-applications/flutter-test-app/android/settings.gradle +25 -0
- package/e2e-tests/test-applications/flutter-test-app/lib/main.dart +125 -0
- package/e2e-tests/test-applications/flutter-test-app/linux/CMakeLists.txt +145 -0
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/CMakeLists.txt +88 -0
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.cc +11 -0
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.h +15 -0
- package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugins.cmake +23 -0
- package/e2e-tests/test-applications/flutter-test-app/linux/main.cc +6 -0
- package/e2e-tests/test-applications/flutter-test-app/linux/my_application.cc +124 -0
- package/e2e-tests/test-applications/flutter-test-app/linux/my_application.h +18 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Debug.xcconfig +2 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Release.xcconfig +2 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/GeneratedPluginRegistrant.swift +10 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Podfile +43 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/AppDelegate.swift +9 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Base.lproj/MainMenu.xib +343 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/AppInfo.xcconfig +14 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Debug.xcconfig +2 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Release.xcconfig +2 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Warnings.xcconfig +13 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/DebugProfile.entitlements +12 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Info.plist +32 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/MainFlutterWindow.swift +15 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Release.entitlements +8 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.pbxproj +705 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +98 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/contents.xcworkspacedata +7 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/e2e-tests/test-applications/flutter-test-app/macos/RunnerTests/RunnerTests.swift +12 -0
- package/e2e-tests/test-applications/flutter-test-app/pubspec.lock +213 -0
- package/e2e-tests/test-applications/flutter-test-app/pubspec.yaml +89 -0
- package/e2e-tests/test-applications/flutter-test-app/test/widget_test.dart +30 -0
- package/e2e-tests/test-applications/flutter-test-app/web/favicon.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-192.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-192.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-512.png +0 -0
- package/e2e-tests/test-applications/flutter-test-app/web/index.html +38 -0
- package/e2e-tests/test-applications/flutter-test-app/web/manifest.json +35 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/CMakeLists.txt +108 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/CMakeLists.txt +109 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.cc +11 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.h +15 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugins.cmake +23 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/CMakeLists.txt +40 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/Runner.rc +121 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.cpp +71 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.h +33 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/main.cpp +43 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/resource.h +16 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/resources/app_icon.ico +0 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/runner.exe.manifest +14 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.cpp +65 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.h +19 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.cpp +288 -0
- package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.h +102 -0
- package/e2e-tests/tests/flutter.test.ts +127 -0
- package/e2e-tests/utils/index.ts +33 -0
- package/lib/Constants.ts +5 -0
- package/package.json +1 -1
- package/src/apple/apple-wizard.ts +1 -1
- package/src/apple/xcode-manager.ts +5 -5
- package/src/flutter/code-tools.ts +284 -0
- package/src/flutter/flutter-wizard.ts +164 -0
- package/src/flutter/templates.ts +90 -0
- package/src/run.ts +7 -0
- package/src/utils/clack-utils.ts +4 -2
- package/test/flutter/code-tools.test.ts +212 -0
- package/test/flutter/templates.test.ts +100 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# This file controls Flutter-level build steps. It should not be edited.
|
|
2
|
+
cmake_minimum_required(VERSION 3.10)
|
|
3
|
+
|
|
4
|
+
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
|
5
|
+
|
|
6
|
+
# Configuration provided via flutter tool.
|
|
7
|
+
include(${EPHEMERAL_DIR}/generated_config.cmake)
|
|
8
|
+
|
|
9
|
+
# TODO: Move the rest of this into files in ephemeral. See
|
|
10
|
+
# https://github.com/flutter/flutter/issues/57146.
|
|
11
|
+
|
|
12
|
+
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
|
|
13
|
+
# which isn't available in 3.10.
|
|
14
|
+
function(list_prepend LIST_NAME PREFIX)
|
|
15
|
+
set(NEW_LIST "")
|
|
16
|
+
foreach(element ${${LIST_NAME}})
|
|
17
|
+
list(APPEND NEW_LIST "${PREFIX}${element}")
|
|
18
|
+
endforeach(element)
|
|
19
|
+
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
|
|
20
|
+
endfunction()
|
|
21
|
+
|
|
22
|
+
# === Flutter Library ===
|
|
23
|
+
# System-level dependencies.
|
|
24
|
+
find_package(PkgConfig REQUIRED)
|
|
25
|
+
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
|
26
|
+
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
|
27
|
+
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
|
28
|
+
|
|
29
|
+
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
|
|
30
|
+
|
|
31
|
+
# Published to parent scope for install step.
|
|
32
|
+
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
|
33
|
+
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
|
34
|
+
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
|
35
|
+
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
|
|
36
|
+
|
|
37
|
+
list(APPEND FLUTTER_LIBRARY_HEADERS
|
|
38
|
+
"fl_basic_message_channel.h"
|
|
39
|
+
"fl_binary_codec.h"
|
|
40
|
+
"fl_binary_messenger.h"
|
|
41
|
+
"fl_dart_project.h"
|
|
42
|
+
"fl_engine.h"
|
|
43
|
+
"fl_json_message_codec.h"
|
|
44
|
+
"fl_json_method_codec.h"
|
|
45
|
+
"fl_message_codec.h"
|
|
46
|
+
"fl_method_call.h"
|
|
47
|
+
"fl_method_channel.h"
|
|
48
|
+
"fl_method_codec.h"
|
|
49
|
+
"fl_method_response.h"
|
|
50
|
+
"fl_plugin_registrar.h"
|
|
51
|
+
"fl_plugin_registry.h"
|
|
52
|
+
"fl_standard_message_codec.h"
|
|
53
|
+
"fl_standard_method_codec.h"
|
|
54
|
+
"fl_string_codec.h"
|
|
55
|
+
"fl_value.h"
|
|
56
|
+
"fl_view.h"
|
|
57
|
+
"flutter_linux.h"
|
|
58
|
+
)
|
|
59
|
+
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
|
|
60
|
+
add_library(flutter INTERFACE)
|
|
61
|
+
target_include_directories(flutter INTERFACE
|
|
62
|
+
"${EPHEMERAL_DIR}"
|
|
63
|
+
)
|
|
64
|
+
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
|
|
65
|
+
target_link_libraries(flutter INTERFACE
|
|
66
|
+
PkgConfig::GTK
|
|
67
|
+
PkgConfig::GLIB
|
|
68
|
+
PkgConfig::GIO
|
|
69
|
+
)
|
|
70
|
+
add_dependencies(flutter flutter_assemble)
|
|
71
|
+
|
|
72
|
+
# === Flutter tool backend ===
|
|
73
|
+
# _phony_ is a non-existent file to force this command to run every time,
|
|
74
|
+
# since currently there's no way to get a full input/output list from the
|
|
75
|
+
# flutter tool.
|
|
76
|
+
add_custom_command(
|
|
77
|
+
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
|
|
78
|
+
${CMAKE_CURRENT_BINARY_DIR}/_phony_
|
|
79
|
+
COMMAND ${CMAKE_COMMAND} -E env
|
|
80
|
+
${FLUTTER_TOOL_ENVIRONMENT}
|
|
81
|
+
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
|
|
82
|
+
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
|
|
83
|
+
VERBATIM
|
|
84
|
+
)
|
|
85
|
+
add_custom_target(flutter_assemble DEPENDS
|
|
86
|
+
"${FLUTTER_LIBRARY}"
|
|
87
|
+
${FLUTTER_LIBRARY_HEADERS}
|
|
88
|
+
)
|
package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.h
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Generated file. Do not edit.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// clang-format off
|
|
6
|
+
|
|
7
|
+
#ifndef GENERATED_PLUGIN_REGISTRANT_
|
|
8
|
+
#define GENERATED_PLUGIN_REGISTRANT_
|
|
9
|
+
|
|
10
|
+
#include <flutter_linux/flutter_linux.h>
|
|
11
|
+
|
|
12
|
+
// Registers Flutter plugins.
|
|
13
|
+
void fl_register_plugins(FlPluginRegistry* registry);
|
|
14
|
+
|
|
15
|
+
#endif // GENERATED_PLUGIN_REGISTRANT_
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Generated file, do not edit.
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
list(APPEND FLUTTER_PLUGIN_LIST
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
set(PLUGIN_BUNDLED_LIBRARIES)
|
|
12
|
+
|
|
13
|
+
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
|
14
|
+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
|
|
15
|
+
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
|
|
16
|
+
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
|
17
|
+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
|
18
|
+
endforeach(plugin)
|
|
19
|
+
|
|
20
|
+
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
|
21
|
+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
|
|
22
|
+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
|
23
|
+
endforeach(ffi_plugin)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#include "my_application.h"
|
|
2
|
+
|
|
3
|
+
#include <flutter_linux/flutter_linux.h>
|
|
4
|
+
#ifdef GDK_WINDOWING_X11
|
|
5
|
+
#include <gdk/gdkx.h>
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#include "flutter/generated_plugin_registrant.h"
|
|
9
|
+
|
|
10
|
+
struct _MyApplication {
|
|
11
|
+
GtkApplication parent_instance;
|
|
12
|
+
char** dart_entrypoint_arguments;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
|
|
16
|
+
|
|
17
|
+
// Implements GApplication::activate.
|
|
18
|
+
static void my_application_activate(GApplication* application) {
|
|
19
|
+
MyApplication* self = MY_APPLICATION(application);
|
|
20
|
+
GtkWindow* window =
|
|
21
|
+
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
|
|
22
|
+
|
|
23
|
+
// Use a header bar when running in GNOME as this is the common style used
|
|
24
|
+
// by applications and is the setup most users will be using (e.g. Ubuntu
|
|
25
|
+
// desktop).
|
|
26
|
+
// If running on X and not using GNOME then just use a traditional title bar
|
|
27
|
+
// in case the window manager does more exotic layout, e.g. tiling.
|
|
28
|
+
// If running on Wayland assume the header bar will work (may need changing
|
|
29
|
+
// if future cases occur).
|
|
30
|
+
gboolean use_header_bar = TRUE;
|
|
31
|
+
#ifdef GDK_WINDOWING_X11
|
|
32
|
+
GdkScreen* screen = gtk_window_get_screen(window);
|
|
33
|
+
if (GDK_IS_X11_SCREEN(screen)) {
|
|
34
|
+
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
|
|
35
|
+
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
|
|
36
|
+
use_header_bar = FALSE;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
#endif
|
|
40
|
+
if (use_header_bar) {
|
|
41
|
+
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
|
|
42
|
+
gtk_widget_show(GTK_WIDGET(header_bar));
|
|
43
|
+
gtk_header_bar_set_title(header_bar, "flutter_magic");
|
|
44
|
+
gtk_header_bar_set_show_close_button(header_bar, TRUE);
|
|
45
|
+
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
|
|
46
|
+
} else {
|
|
47
|
+
gtk_window_set_title(window, "flutter_magic");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
gtk_window_set_default_size(window, 1280, 720);
|
|
51
|
+
gtk_widget_show(GTK_WIDGET(window));
|
|
52
|
+
|
|
53
|
+
g_autoptr(FlDartProject) project = fl_dart_project_new();
|
|
54
|
+
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
|
|
55
|
+
|
|
56
|
+
FlView* view = fl_view_new(project);
|
|
57
|
+
gtk_widget_show(GTK_WIDGET(view));
|
|
58
|
+
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
|
|
59
|
+
|
|
60
|
+
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
|
|
61
|
+
|
|
62
|
+
gtk_widget_grab_focus(GTK_WIDGET(view));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Implements GApplication::local_command_line.
|
|
66
|
+
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
|
|
67
|
+
MyApplication* self = MY_APPLICATION(application);
|
|
68
|
+
// Strip out the first argument as it is the binary name.
|
|
69
|
+
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
|
|
70
|
+
|
|
71
|
+
g_autoptr(GError) error = nullptr;
|
|
72
|
+
if (!g_application_register(application, nullptr, &error)) {
|
|
73
|
+
g_warning("Failed to register: %s", error->message);
|
|
74
|
+
*exit_status = 1;
|
|
75
|
+
return TRUE;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
g_application_activate(application);
|
|
79
|
+
*exit_status = 0;
|
|
80
|
+
|
|
81
|
+
return TRUE;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Implements GApplication::startup.
|
|
85
|
+
static void my_application_startup(GApplication* application) {
|
|
86
|
+
//MyApplication* self = MY_APPLICATION(object);
|
|
87
|
+
|
|
88
|
+
// Perform any actions required at application startup.
|
|
89
|
+
|
|
90
|
+
G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Implements GApplication::shutdown.
|
|
94
|
+
static void my_application_shutdown(GApplication* application) {
|
|
95
|
+
//MyApplication* self = MY_APPLICATION(object);
|
|
96
|
+
|
|
97
|
+
// Perform any actions required at application shutdown.
|
|
98
|
+
|
|
99
|
+
G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Implements GObject::dispose.
|
|
103
|
+
static void my_application_dispose(GObject* object) {
|
|
104
|
+
MyApplication* self = MY_APPLICATION(object);
|
|
105
|
+
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
|
|
106
|
+
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static void my_application_class_init(MyApplicationClass* klass) {
|
|
110
|
+
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
|
|
111
|
+
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
|
|
112
|
+
G_APPLICATION_CLASS(klass)->startup = my_application_startup;
|
|
113
|
+
G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
|
|
114
|
+
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static void my_application_init(MyApplication* self) {}
|
|
118
|
+
|
|
119
|
+
MyApplication* my_application_new() {
|
|
120
|
+
return MY_APPLICATION(g_object_new(my_application_get_type(),
|
|
121
|
+
"application-id", APPLICATION_ID,
|
|
122
|
+
"flags", G_APPLICATION_NON_UNIQUE,
|
|
123
|
+
nullptr));
|
|
124
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#ifndef FLUTTER_MY_APPLICATION_H_
|
|
2
|
+
#define FLUTTER_MY_APPLICATION_H_
|
|
3
|
+
|
|
4
|
+
#include <gtk/gtk.h>
|
|
5
|
+
|
|
6
|
+
G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
|
|
7
|
+
GtkApplication)
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* my_application_new:
|
|
11
|
+
*
|
|
12
|
+
* Creates a new Flutter-based application.
|
|
13
|
+
*
|
|
14
|
+
* Returns: a new #MyApplication.
|
|
15
|
+
*/
|
|
16
|
+
MyApplication* my_application_new();
|
|
17
|
+
|
|
18
|
+
#endif // FLUTTER_MY_APPLICATION_H_
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
platform :osx, '10.14'
|
|
2
|
+
|
|
3
|
+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
|
4
|
+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
|
5
|
+
|
|
6
|
+
project 'Runner', {
|
|
7
|
+
'Debug' => :debug,
|
|
8
|
+
'Profile' => :release,
|
|
9
|
+
'Release' => :release,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
def flutter_root
|
|
13
|
+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
|
|
14
|
+
unless File.exist?(generated_xcode_build_settings_path)
|
|
15
|
+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
File.foreach(generated_xcode_build_settings_path) do |line|
|
|
19
|
+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
|
20
|
+
return matches[1].strip if matches
|
|
21
|
+
end
|
|
22
|
+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
|
26
|
+
|
|
27
|
+
flutter_macos_podfile_setup
|
|
28
|
+
|
|
29
|
+
target 'Runner' do
|
|
30
|
+
use_frameworks!
|
|
31
|
+
use_modular_headers!
|
|
32
|
+
|
|
33
|
+
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
|
|
34
|
+
target 'RunnerTests' do
|
|
35
|
+
inherit! :search_paths
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
post_install do |installer|
|
|
40
|
+
installer.pods_project.targets.each do |target|
|
|
41
|
+
flutter_additional_macos_build_settings(target)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"size" : "16x16",
|
|
5
|
+
"idiom" : "mac",
|
|
6
|
+
"filename" : "app_icon_16.png",
|
|
7
|
+
"scale" : "1x"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"size" : "16x16",
|
|
11
|
+
"idiom" : "mac",
|
|
12
|
+
"filename" : "app_icon_32.png",
|
|
13
|
+
"scale" : "2x"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"size" : "32x32",
|
|
17
|
+
"idiom" : "mac",
|
|
18
|
+
"filename" : "app_icon_32.png",
|
|
19
|
+
"scale" : "1x"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"size" : "32x32",
|
|
23
|
+
"idiom" : "mac",
|
|
24
|
+
"filename" : "app_icon_64.png",
|
|
25
|
+
"scale" : "2x"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"size" : "128x128",
|
|
29
|
+
"idiom" : "mac",
|
|
30
|
+
"filename" : "app_icon_128.png",
|
|
31
|
+
"scale" : "1x"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"size" : "128x128",
|
|
35
|
+
"idiom" : "mac",
|
|
36
|
+
"filename" : "app_icon_256.png",
|
|
37
|
+
"scale" : "2x"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"size" : "256x256",
|
|
41
|
+
"idiom" : "mac",
|
|
42
|
+
"filename" : "app_icon_256.png",
|
|
43
|
+
"scale" : "1x"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"size" : "256x256",
|
|
47
|
+
"idiom" : "mac",
|
|
48
|
+
"filename" : "app_icon_512.png",
|
|
49
|
+
"scale" : "2x"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"size" : "512x512",
|
|
53
|
+
"idiom" : "mac",
|
|
54
|
+
"filename" : "app_icon_512.png",
|
|
55
|
+
"scale" : "1x"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"size" : "512x512",
|
|
59
|
+
"idiom" : "mac",
|
|
60
|
+
"filename" : "app_icon_1024.png",
|
|
61
|
+
"scale" : "2x"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"info" : {
|
|
65
|
+
"version" : 1,
|
|
66
|
+
"author" : "xcode"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|