From 6efb1977765588ef2f62adb5f5890ea6e922deda Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 21 Nov 2022 22:20:22 +0100 Subject: [PATCH] [flutter] Change package name to esotericsoftware_spine_flutter --- spine-flutter/CHANGELOG.md | 6 ++ .../example/lib/animation_state_events.dart | 2 +- spine-flutter/example/lib/dress_up.dart | 2 +- spine-flutter/example/lib/ik_following.dart | 2 +- spine-flutter/example/lib/main.dart | 2 +- .../example/lib/pause_play_animation.dart | 2 +- .../example/lib/simple_animation.dart | 2 +- spine-flutter/example/lib/skins.dart | 2 +- .../linux/flutter/generated_plugins.cmake | 2 +- spine-flutter/example/macos/Podfile | 2 +- spine-flutter/example/macos/Podfile.lock | 14 ++-- spine-flutter/example/pubspec.lock | 14 ++-- spine-flutter/example/pubspec.yaml | 77 +------------------ .../windows/flutter/generated_plugins.cmake | 2 +- ...=> esotericsoftware_spine_flutter.podspec} | 4 +- spine-flutter/lib/init.dart | 2 +- spine-flutter/lib/init_web.dart | 4 +- spine-flutter/linux/CMakeLists.txt | 6 +- ...=> esotericsoftware_spine_flutter.podspec} | 6 +- spine-flutter/pubspec.yaml | 2 +- spine-flutter/src/CMakeLists.txt | 12 +-- spine-flutter/windows/CMakeLists.txt | 6 +- 22 files changed, 54 insertions(+), 119 deletions(-) rename spine-flutter/ios/{spine_flutter.podspec => esotericsoftware_spine_flutter.podspec} (88%) rename spine-flutter/macos/{spine_flutter.podspec => esotericsoftware_spine_flutter.podspec} (85%) diff --git a/spine-flutter/CHANGELOG.md b/spine-flutter/CHANGELOG.md index ddbe9bc60..d10036dd9 100644 --- a/spine-flutter/CHANGELOG.md +++ b/spine-flutter/CHANGELOG.md @@ -1,2 +1,8 @@ +# 0.0.3 +* Lower macOS deployment target to 10.11 + +# 0.0.2 +* Fix package name in build system `spine_flutter` > `esotericsoftware_spine_flutter`. + # 0.0.1 Initial test release. \ No newline at end of file diff --git a/spine-flutter/example/lib/animation_state_events.dart b/spine-flutter/example/lib/animation_state_events.dart index cc5933adc..cfc56bdb8 100644 --- a/spine-flutter/example/lib/animation_state_events.dart +++ b/spine-flutter/example/lib/animation_state_events.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spine_flutter/spine_flutter.dart'; +import 'package:esotericsoftware_spine_flutter/spine_flutter.dart'; class AnimationStateEvents extends StatelessWidget { const AnimationStateEvents({Key? key}) : super(key: key); diff --git a/spine-flutter/example/lib/dress_up.dart b/spine-flutter/example/lib/dress_up.dart index c075c2a85..c44235ea7 100644 --- a/spine-flutter/example/lib/dress_up.dart +++ b/spine-flutter/example/lib/dress_up.dart @@ -3,7 +3,7 @@ import 'dart:ui' as ui; import 'package:flutter/material.dart'; import 'package:flutter/painting.dart' as painting; -import 'package:spine_flutter/spine_flutter.dart'; +import 'package:esotericsoftware_spine_flutter/spine_flutter.dart'; import 'package:raw_image_provider/raw_image_provider.dart'; class DressUp extends StatefulWidget { diff --git a/spine-flutter/example/lib/ik_following.dart b/spine-flutter/example/lib/ik_following.dart index 61dc7ff7f..1f948a9bb 100644 --- a/spine-flutter/example/lib/ik_following.dart +++ b/spine-flutter/example/lib/ik_following.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spine_flutter/spine_flutter.dart'; +import 'package:esotericsoftware_spine_flutter/spine_flutter.dart'; class IkFollowing extends StatefulWidget { const IkFollowing({Key? key}) : super(key: key); diff --git a/spine-flutter/example/lib/main.dart b/spine-flutter/example/lib/main.dart index b7488fe2f..f4e085be9 100644 --- a/spine-flutter/example/lib/main.dart +++ b/spine-flutter/example/lib/main.dart @@ -6,7 +6,7 @@ import 'pause_play_animation.dart'; import 'skins.dart'; import 'dress_up.dart'; import 'ik_following.dart'; -import 'package:spine_flutter/spine_flutter.dart'; +import 'package:esotericsoftware_spine_flutter/spine_flutter.dart'; class ExampleSelector extends StatelessWidget { const ExampleSelector({super.key}); diff --git a/spine-flutter/example/lib/pause_play_animation.dart b/spine-flutter/example/lib/pause_play_animation.dart index bf735f2af..8c5df0770 100644 --- a/spine-flutter/example/lib/pause_play_animation.dart +++ b/spine-flutter/example/lib/pause_play_animation.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spine_flutter/spine_flutter.dart'; +import 'package:esotericsoftware_spine_flutter/spine_flutter.dart'; class PlayPauseAnimation extends StatefulWidget { const PlayPauseAnimation({Key? key}) : super(key: key); diff --git a/spine-flutter/example/lib/simple_animation.dart b/spine-flutter/example/lib/simple_animation.dart index ff813806e..d8c8e4f45 100644 --- a/spine-flutter/example/lib/simple_animation.dart +++ b/spine-flutter/example/lib/simple_animation.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spine_flutter/spine_flutter.dart'; +import 'package:esotericsoftware_spine_flutter/spine_flutter.dart'; class SimpleAnimation extends StatelessWidget { const SimpleAnimation({Key? key}) : super(key: key); diff --git a/spine-flutter/example/lib/skins.dart b/spine-flutter/example/lib/skins.dart index 9792c699a..a9ae55522 100644 --- a/spine-flutter/example/lib/skins.dart +++ b/spine-flutter/example/lib/skins.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:spine_flutter/spine_flutter.dart'; +import 'package:esotericsoftware_spine_flutter/spine_flutter.dart'; class Skins extends StatefulWidget { const Skins({Key? key}) : super(key: key); diff --git a/spine-flutter/example/linux/flutter/generated_plugins.cmake b/spine-flutter/example/linux/flutter/generated_plugins.cmake index 55f28b8cb..acd6747ac 100644 --- a/spine-flutter/example/linux/flutter/generated_plugins.cmake +++ b/spine-flutter/example/linux/flutter/generated_plugins.cmake @@ -6,7 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST - spine_flutter + esotericsoftware_spine_flutter ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/spine-flutter/example/macos/Podfile b/spine-flutter/example/macos/Podfile index fe733905d..dade8dfad 100644 --- a/spine-flutter/example/macos/Podfile +++ b/spine-flutter/example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.13' +platform :osx, '10.11' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/spine-flutter/example/macos/Podfile.lock b/spine-flutter/example/macos/Podfile.lock index 898575f38..3ec87e5f0 100644 --- a/spine-flutter/example/macos/Podfile.lock +++ b/spine-flutter/example/macos/Podfile.lock @@ -1,22 +1,22 @@ PODS: - - FlutterMacOS (1.0.0) - - spine_flutter (0.0.1): + - esotericsoftware_spine_flutter (0.0.1): - FlutterMacOS + - FlutterMacOS (1.0.0) DEPENDENCIES: + - esotericsoftware_spine_flutter (from `Flutter/ephemeral/.symlinks/plugins/esotericsoftware_spine_flutter/macos`) - FlutterMacOS (from `Flutter/ephemeral`) - - spine_flutter (from `Flutter/ephemeral/.symlinks/plugins/spine_flutter/macos`) EXTERNAL SOURCES: + esotericsoftware_spine_flutter: + :path: Flutter/ephemeral/.symlinks/plugins/esotericsoftware_spine_flutter/macos FlutterMacOS: :path: Flutter/ephemeral - spine_flutter: - :path: Flutter/ephemeral/.symlinks/plugins/spine_flutter/macos SPEC CHECKSUMS: + esotericsoftware_spine_flutter: 9222ab83a8f5635976f03740fa1eb809809f2b4a FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 - spine_flutter: 931c60737aba4b37f80892ebc67d3acf53932912 -PODFILE CHECKSUM: a884f6dd3f7494f3892ee6c81feea3a3abbf9153 +PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c COCOAPODS: 1.11.3 diff --git a/spine-flutter/example/pubspec.lock b/spine-flutter/example/pubspec.lock index 0e9b6f9f3..a24662f3b 100644 --- a/spine-flutter/example/pubspec.lock +++ b/spine-flutter/example/pubspec.lock @@ -36,6 +36,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.5" + esotericsoftware_spine_flutter: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "0.0.2" ffi: dependency: transitive description: @@ -137,13 +144,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.9.0" - spine_flutter: - dependency: "direct main" - description: - path: ".." - relative: true - source: path - version: "0.0.1" string_scanner: dependency: transitive description: diff --git a/spine-flutter/example/pubspec.yaml b/spine-flutter/example/pubspec.yaml index d3ef97567..8cc37f1c3 100644 --- a/spine-flutter/example/pubspec.yaml +++ b/spine-flutter/example/pubspec.yaml @@ -1,95 +1,24 @@ name: spine_flutter_example description: Demonstrates how to use the spine_flutter plugin. - -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +publish_to: 'none' version: 1.0.0+1 environment: sdk: ">=2.17.6 <3.0.0" -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter - spine_flutter: - # When depending on this package from a real application you should use: - # spine_flutter: ^x.y.z - # See https://dart.dev/tools/pub/dependencies#version-constraints - # The example app is bundled with the plugin so we use a path dependency on - # the parent directory to use the current plugin's version. + esotericsoftware_spine_flutter: path: ../ - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 - raw_image_provider: ^0.2.0 dev_dependencies: - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.0 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - - # To add assets to your application, add an assets section, like this: assets: - - assets/ - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + - assets/ \ No newline at end of file diff --git a/spine-flutter/example/windows/flutter/generated_plugins.cmake b/spine-flutter/example/windows/flutter/generated_plugins.cmake index dca11f385..8e0b3a1ca 100644 --- a/spine-flutter/example/windows/flutter/generated_plugins.cmake +++ b/spine-flutter/example/windows/flutter/generated_plugins.cmake @@ -6,7 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST - spine_flutter + esotericsoftware_spine_flutter ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/spine-flutter/ios/spine_flutter.podspec b/spine-flutter/ios/esotericsoftware_spine_flutter.podspec similarity index 88% rename from spine-flutter/ios/spine_flutter.podspec rename to spine-flutter/ios/esotericsoftware_spine_flutter.podspec index 7c725addc..079d8436a 100644 --- a/spine-flutter/ios/spine_flutter.podspec +++ b/spine-flutter/ios/esotericsoftware_spine_flutter.podspec @@ -1,9 +1,9 @@ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint spine_flutter.podspec` to validate before publishing. +# Run `pod lib lint esotericsoftware_spine_flutter.podspec` to validate before publishing. # Pod::Spec.new do |s| - s.name = 'spine_flutter' + s.name = 'esotericsoftware_spine_flutter' s.version = '0.0.1' s.summary = 'A new Flutter FFI plugin project.' s.description = <<-DESC diff --git a/spine-flutter/lib/init.dart b/spine-flutter/lib/init.dart index 93fc9fa7a..71845dde7 100644 --- a/spine-flutter/lib/init.dart +++ b/spine-flutter/lib/init.dart @@ -2,7 +2,7 @@ import 'dart:io'; import 'dart:ffi'; import 'package:ffi/ffi.dart'; -const String _libName = 'spine_flutter'; +const String _libName = 'esotericsoftware_spine_flutter'; final DynamicLibrary _dylib = () { if (Platform.isMacOS || Platform.isIOS) { return DynamicLibrary.open('$_libName.framework/$_libName'); diff --git a/spine-flutter/lib/init_web.dart b/spine-flutter/lib/init_web.dart index ff6e89750..1de0e9937 100644 --- a/spine-flutter/lib/init_web.dart +++ b/spine-flutter/lib/init_web.dart @@ -61,8 +61,8 @@ Future initSpineFlutterFFI() async { registerOpaqueType(); registerOpaqueType(); - await js.importLibrary('assets/packages/spine_flutter/lib/assets/libspine_flutter.js'); - Uint8List wasmBinaries = (await rootBundle.load('packages/spine_flutter/lib/assets/libspine_flutter.wasm')).buffer.asUint8List(); + await js.importLibrary('assets/packages/esotericsoftware_spine_flutter/lib/assets/libspine_flutter.js'); + Uint8List wasmBinaries = (await rootBundle.load('packages/esotericsoftware_spine_flutter/lib/assets/libspine_flutter.wasm')).buffer.asUint8List(); _module = await EmscriptenModule.compile(wasmBinaries, 'libspine_flutter'); } Module? m = _module; diff --git a/spine-flutter/linux/CMakeLists.txt b/spine-flutter/linux/CMakeLists.txt index b42273991..4954c0e74 100644 --- a/spine-flutter/linux/CMakeLists.txt +++ b/spine-flutter/linux/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.10) # Project-level configuration. -set(PROJECT_NAME "spine_flutter") +set(PROJECT_NAME "esotericsoftware_spine_flutter") project(${PROJECT_NAME} LANGUAGES CXX) # Invoke the build for native code shared with the other target platforms. @@ -14,9 +14,9 @@ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DI # List of absolute paths to libraries that should be bundled with the plugin. # This list could contain prebuilt libraries, or libraries created by an # external build triggered from this build file. -set(spine_flutter_bundled_libraries +set(esotericsoftware_spine_flutter_bundled_libraries # Defined in ../src/CMakeLists.txt. # This can be changed to accomodate different builds. - $ + $ PARENT_SCOPE ) diff --git a/spine-flutter/macos/spine_flutter.podspec b/spine-flutter/macos/esotericsoftware_spine_flutter.podspec similarity index 85% rename from spine-flutter/macos/spine_flutter.podspec rename to spine-flutter/macos/esotericsoftware_spine_flutter.podspec index 216ad5770..7224454dd 100644 --- a/spine-flutter/macos/spine_flutter.podspec +++ b/spine-flutter/macos/esotericsoftware_spine_flutter.podspec @@ -1,9 +1,9 @@ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint spine_flutter.podspec` to validate before publishing. +# Run `pod lib lint esotericsoftware_spine_flutter.podspec` to validate before publishing. # Pod::Spec.new do |s| - s.name = 'spine_flutter' + s.name = 'esotericsoftware_spine_flutter' s.version = '0.0.1' s.summary = 'A new Flutter FFI plugin project.' s.description = <<-DESC @@ -22,7 +22,7 @@ A new Flutter FFI plugin project. s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"' + __dir__ + '/Classes/spine-cpp/include"' } s.dependency 'FlutterMacOS' - s.platform = :osx, '10.13' + s.platform = :osx, '10.11' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.swift_version = '5.0' end diff --git a/spine-flutter/pubspec.yaml b/spine-flutter/pubspec.yaml index 3fd00a31f..059244e3b 100644 --- a/spine-flutter/pubspec.yaml +++ b/spine-flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: esotericsoftware_spine_flutter description: The official Spine Flutter Runtime to load, display and interact with Spine animations. -version: 0.0.1 +version: 0.0.3 homepage: https://esotericsoftware.com repository: https://github.com/esotericsoftware/spine-runtimes issue_tracker: https://github.com/esotericsoftware/spine-runtimes/issues diff --git a/spine-flutter/src/CMakeLists.txt b/spine-flutter/src/CMakeLists.txt index d6e5384e2..0cef7147f 100644 --- a/spine-flutter/src/CMakeLists.txt +++ b/spine-flutter/src/CMakeLists.txt @@ -3,19 +3,19 @@ # the plugin to fail to compile for some customers of the plugin. cmake_minimum_required(VERSION 3.10) -project(spine_flutter_library VERSION 0.0.1) +project(esotericsoftware_spine_flutter_library VERSION 0.0.1) file(GLOB SPINE_SOURCES "spine-cpp/src/**/*.cpp") -add_library(spine_flutter SHARED +add_library(esotericsoftware_spine_flutter SHARED "spine_flutter.cpp" ${SPINE_SOURCES} ) -set_target_properties(spine_flutter PROPERTIES +set_target_properties(esotericsoftware_spine_flutter PROPERTIES PUBLIC_HEADER spine_flutter.h - OUTPUT_NAME "spine_flutter" + OUTPUT_NAME "esotericsoftware_spine_flutter" ) -target_include_directories(spine_flutter PUBLIC spine-cpp/include) -target_compile_definitions(spine_flutter PUBLIC DART_SHARED_LIB) +target_include_directories(esotericsoftware_spine_flutter PUBLIC spine-cpp/include) +target_compile_definitions(esotericsoftware_spine_flutter PUBLIC DART_SHARED_LIB) diff --git a/spine-flutter/windows/CMakeLists.txt b/spine-flutter/windows/CMakeLists.txt index cd235bb5c..26d29cd67 100644 --- a/spine-flutter/windows/CMakeLists.txt +++ b/spine-flutter/windows/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.14) # Project-level configuration. -set(PROJECT_NAME "spine_flutter") +set(PROJECT_NAME "esotericsoftware_spine_flutter") project(${PROJECT_NAME} LANGUAGES CXX) # Invoke the build for native code shared with the other target platforms. @@ -15,9 +15,9 @@ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DI # List of absolute paths to libraries that should be bundled with the plugin. # This list could contain prebuilt libraries, or libraries created by an # external build triggered from this build file. -set(spine_flutter_bundled_libraries +set(esotericsoftware_spine_flutter_bundled_libraries # Defined in ../src/CMakeLists.txt. # This can be changed to accomodate different builds. - $ + $ PARENT_SCOPE )