소스 검색

[flutter] Include spine-cpp sources in package

Mario Zechner 2 년 전
부모
커밋
86ecf4927f
4개의 변경된 파일12개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 1
      spine-flutter/.pubignore
  2. 5 5
      spine-flutter/compile-wasm.sh
  3. BIN
      spine-flutter/lib/assets/libspine_flutter.wasm
  4. 3 0
      spine-flutter/pubspec.yaml

+ 4 - 1
spine-flutter/.pubignore

@@ -1 +1,4 @@
-example/
+example/
+!src/spine-cpp
+!ios/Classes/spine-cpp
+!macos/Classes/spine-cpp

+ 5 - 5
spine-flutter/src/compile-wasm.sh → spine-flutter/compile-wasm.sh

@@ -1,13 +1,13 @@
 #!/bin/sh
 #!/bin/sh
 dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 pushd $dir > /dev/null
 pushd $dir > /dev/null
-mkdir -p ../lib/assets/
+mkdir -p lib/assets/
 # Need to use -O2, as -O3 applies the Closure compiler to native function names.
 # Need to use -O2, as -O3 applies the Closure compiler to native function names.
 # The entries for exported functions in Module.asm will be scrambled so
 # The entries for exported functions in Module.asm will be scrambled so
 # EmscriptenModule._fromJs() is unable to parse them and link them with original
 # EmscriptenModule._fromJs() is unable to parse them and link them with original
 # names set on the module, e.g. Module._spine_get_major_version.
 # names set on the module, e.g. Module._spine_get_major_version.
 emcc \
 emcc \
-	-Ispine-cpp/include \
+	-Isrc/spine-cpp/include \
 	-O2 --closure 1 -fno-rtti -fno-exceptions -lc++abi -lc++ \
 	-O2 --closure 1 -fno-rtti -fno-exceptions -lc++abi -lc++ \
 	-s STRICT=1 \
 	-s STRICT=1 \
 	-s LLD_REPORT_UNDEFINED \
 	-s LLD_REPORT_UNDEFINED \
@@ -19,7 +19,7 @@ emcc \
 	-s EXPORTED_FUNCTIONS='["_malloc", "_free"]' \
 	-s EXPORTED_FUNCTIONS='["_malloc", "_free"]' \
 	--no-entry \
 	--no-entry \
 	-s EXPORT_NAME=libspine_flutter \
 	-s EXPORT_NAME=libspine_flutter \
-	spine_flutter.cpp `find spine-cpp/src -type f` \
-	-o ../lib/assets/libspine_flutter.js
-	ls -lah ../lib/assets
+	src/spine_flutter.cpp `find src/spine-cpp/src -type f` \
+	-o lib/assets/libspine_flutter.js
+	ls -lah lib/assets
 popd
 popd

BIN
spine-flutter/lib/assets/libspine_flutter.wasm


+ 3 - 0
spine-flutter/pubspec.yaml

@@ -3,6 +3,8 @@ description: The official Spine Flutter Runtime to load, display and interact wi
 version: 0.0.1
 version: 0.0.1
 homepage: https://esotericsoftware.com
 homepage: https://esotericsoftware.com
 repository: https://github.com/esotericsoftware/spine-runtimes
 repository: https://github.com/esotericsoftware/spine-runtimes
+issue_tracker: https://github.com/esotericsoftware/spine-runtimes/issues
+documentation: https://esotericsoftware.com/spine-flutter
 
 
 environment:
 environment:
   sdk: ">=2.17.6 <3.0.0"
   sdk: ">=2.17.6 <3.0.0"
@@ -38,6 +40,7 @@ flutter:
         ffiPlugin: true
         ffiPlugin: true
       windows:
       windows:
         ffiPlugin: true
         ffiPlugin: true
+      web:
 
 
   assets:
   assets:
     - lib/assets/libspine_flutter.js
     - lib/assets/libspine_flutter.js