From 63f34c403ab828a84efb728558f57d59e803db49 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Fri, 18 Oct 2024 09:53:31 +1100 Subject: [PATCH] Update `animations` for flutter beta --- animations/step_01/android/gradle.properties | 2 +- animations/step_01/linux/CMakeLists.txt | 23 +++++++++++++--- animations/step_01/linux/{runner => }/main.cc | 0 .../linux/{runner => }/my_application.cc | 6 ----- .../linux/{runner => }/my_application.h | 0 .../step_01/linux/runner/CMakeLists.txt | 26 ------------------- animations/step_01/web/index.html | 2 +- animations/step_02/android/gradle.properties | 2 +- animations/step_02/linux/CMakeLists.txt | 23 +++++++++++++--- animations/step_02/web/index.html | 2 +- animations/step_03/android/gradle.properties | 2 +- animations/step_03/linux/CMakeLists.txt | 23 +++++++++++++--- animations/step_03/web/index.html | 2 +- animations/step_04/android/gradle.properties | 2 +- animations/step_04/linux/CMakeLists.txt | 23 +++++++++++++--- animations/step_04/web/index.html | 2 +- animations/step_05/android/gradle.properties | 2 +- animations/step_05/linux/CMakeLists.txt | 23 +++++++++++++--- animations/step_05/web/index.html | 2 +- 19 files changed, 110 insertions(+), 57 deletions(-) rename animations/step_01/linux/{runner => }/main.cc (100%) rename animations/step_01/linux/{runner => }/my_application.cc (93%) rename animations/step_01/linux/{runner => }/my_application.h (100%) delete mode 100644 animations/step_01/linux/runner/CMakeLists.txt diff --git a/animations/step_01/android/gradle.properties b/animations/step_01/android/gradle.properties index f018a61817..2597170821 100644 --- a/animations/step_01/android/gradle.properties +++ b/animations/step_01/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/animations/step_01/linux/CMakeLists.txt b/animations/step_01/linux/CMakeLists.txt index 7caf822271..658be85ac5 100644 --- a/animations/step_01/linux/CMakeLists.txt +++ b/animations/step_01/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -54,8 +54,25 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/animations/step_01/linux/runner/main.cc b/animations/step_01/linux/main.cc similarity index 100% rename from animations/step_01/linux/runner/main.cc rename to animations/step_01/linux/main.cc diff --git a/animations/step_01/linux/runner/my_application.cc b/animations/step_01/linux/my_application.cc similarity index 93% rename from animations/step_01/linux/runner/my_application.cc rename to animations/step_01/linux/my_application.cc index 0040d7e46c..d6ea0e3c5f 100644 --- a/animations/step_01/linux/runner/my_application.cc +++ b/animations/step_01/linux/my_application.cc @@ -117,12 +117,6 @@ static void my_application_class_init(MyApplicationClass* klass) { static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { - // Set the program name to the application ID, which helps various systems - // like GTK and desktop environments map this running application to its - // corresponding .desktop file. This ensures better integration by allowing - // the application to be recognized beyond its binary name. - g_set_prgname(APPLICATION_ID); - return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, "flags", G_APPLICATION_NON_UNIQUE, diff --git a/animations/step_01/linux/runner/my_application.h b/animations/step_01/linux/my_application.h similarity index 100% rename from animations/step_01/linux/runner/my_application.h rename to animations/step_01/linux/my_application.h diff --git a/animations/step_01/linux/runner/CMakeLists.txt b/animations/step_01/linux/runner/CMakeLists.txt deleted file mode 100644 index e97dabc702..0000000000 --- a/animations/step_01/linux/runner/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the application ID. -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) - -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/animations/step_01/web/index.html b/animations/step_01/web/index.html index ec05768c59..89656d9a06 100644 --- a/animations/step_01/web/index.html +++ b/animations/step_01/web/index.html @@ -21,7 +21,7 @@ - + diff --git a/animations/step_02/android/gradle.properties b/animations/step_02/android/gradle.properties index f018a61817..2597170821 100644 --- a/animations/step_02/android/gradle.properties +++ b/animations/step_02/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/animations/step_02/linux/CMakeLists.txt b/animations/step_02/linux/CMakeLists.txt index 7caf822271..658be85ac5 100644 --- a/animations/step_02/linux/CMakeLists.txt +++ b/animations/step_02/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -54,8 +54,25 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/animations/step_02/web/index.html b/animations/step_02/web/index.html index ec05768c59..89656d9a06 100644 --- a/animations/step_02/web/index.html +++ b/animations/step_02/web/index.html @@ -21,7 +21,7 @@ - + diff --git a/animations/step_03/android/gradle.properties b/animations/step_03/android/gradle.properties index f018a61817..2597170821 100644 --- a/animations/step_03/android/gradle.properties +++ b/animations/step_03/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/animations/step_03/linux/CMakeLists.txt b/animations/step_03/linux/CMakeLists.txt index 7caf822271..658be85ac5 100644 --- a/animations/step_03/linux/CMakeLists.txt +++ b/animations/step_03/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -54,8 +54,25 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/animations/step_03/web/index.html b/animations/step_03/web/index.html index ec05768c59..89656d9a06 100644 --- a/animations/step_03/web/index.html +++ b/animations/step_03/web/index.html @@ -21,7 +21,7 @@ - + diff --git a/animations/step_04/android/gradle.properties b/animations/step_04/android/gradle.properties index f018a61817..2597170821 100644 --- a/animations/step_04/android/gradle.properties +++ b/animations/step_04/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/animations/step_04/linux/CMakeLists.txt b/animations/step_04/linux/CMakeLists.txt index 7caf822271..658be85ac5 100644 --- a/animations/step_04/linux/CMakeLists.txt +++ b/animations/step_04/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -54,8 +54,25 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/animations/step_04/web/index.html b/animations/step_04/web/index.html index ec05768c59..89656d9a06 100644 --- a/animations/step_04/web/index.html +++ b/animations/step_04/web/index.html @@ -21,7 +21,7 @@ - + diff --git a/animations/step_05/android/gradle.properties b/animations/step_05/android/gradle.properties index f018a61817..2597170821 100644 --- a/animations/step_05/android/gradle.properties +++ b/animations/step_05/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/animations/step_05/linux/CMakeLists.txt b/animations/step_05/linux/CMakeLists.txt index 7caf822271..658be85ac5 100644 --- a/animations/step_05/linux/CMakeLists.txt +++ b/animations/step_05/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -54,8 +54,25 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/animations/step_05/web/index.html b/animations/step_05/web/index.html index ec05768c59..89656d9a06 100644 --- a/animations/step_05/web/index.html +++ b/animations/step_05/web/index.html @@ -21,7 +21,7 @@ - +