mirror of
https://github.com/rive-app/rive-flutter.git
synced 2026-03-13 08:32:10 +08:00
Rive flutter/release 0.14.0 dev.1 (#10178) 4b77d3dea0
* chore(flutter): remove old build scrips * chore(flutter): fix analyzer warnings * chore(flutter): update rive_native 0.0.4 * docs(flutter): update readme to point to legacy code List virtualization hit testing 3 (#10157) 8b7aa84704 * feat: propagate hit tests up in the component tree to detect if they are hitting a clipped area Fix bug with Artboard ScaleType in Lists (#10159) 8251f1b259 Fixes a bug when databinding scale type to Artboards used in Lists due to the created Artboard not knowing what it's parent's main layout axis was. We need to pass it down as soon as the artboard is created. List fixes 2 (#10153) 8749deb70a When virtualizing lists, there were some issues with instanced artboards not rendering correctly until the following frame. This fixes that issue, as addresses similar 1 frame delayed layout updates particularly when using nested artboards fix: only shape text with modifiers if the shapes are not empty (#10147) 95bf14f49b fix: include missing header for randomization (#10126) 099266fec8 fix: change keys to rcp to avoid memory issues (#10146) 11042e5b4c change keys to rcp to avoid memory issues List virtualization fixes (#10143) bf3b33a30a First round of fixes for List Virtualization/Carousel Fix layout flicker when adding a new artboard using virtualization Fix hit detection Fix scroll snapping not working properly in Carousel mode Fix z-index issue with Carousel when items wrapped around from end to start. Fix a transform issue found by @JcToon Nnnn data biinding artboard fixes (#10139) e54d2ba962 * update overrides when artboard changes * add nested artboard as hit component even if it does not have state machines to support data binding * when adding a new item to a list, use the previous view model from the list as source if it exists feature: scripting require (#10133) 496fa2b490 * fix: working on dependent imports * feature: add full problem report to wasm * feature: runtime require * feature: scripting require * chore: remove string_view * chore: assert instead of runtime error * chore: fix warning on windows * chore: fix memory leak * chore: fix unused var * chore: more windows warnings * chore: fix dart code_core tests * fix: missing bool in FFI setScriptSource List Virtualization & Scroll Carousel (#9965) d973e8c253 Add support for List virtualization as well as a parameter to the ScrollConstraint to support infinite scrolling (Carousel). There are important caveats with Virtualization enabled: The List instances enough artboards to fit into their parent's bounds and when not rendered, they are pooled and reused as necessary. Lists can be non-uniform meaning they can consist of more than 1 Artboard (ViewModel) type Does not currently work when its parent is set to wrap because more complex computations may result when wrapping In order to use Carousel, virtualization must also be enabled Infinite scroll only works in a single direction, not both at the same time feat(apple): add support for data binding list properties (#9936) d2997eeef4 feat: nested artboards -> components (#10082) 7379bdd49f * publishable mixin * only show components in nested artboard list * updates * icons… * icons * change increment to boolean * remove lib component keys in ext * remove icons * flag * remove `didPublish` property * get this library * fix ups * test fixes * flag inspcetor icons * move publishable to custom enums * tool icon fix * extra flags * use resolver to check if nestable * panel sizes * regen keys * panel width core default value Co-authored-by: Gordon <pggordonhayes@gmail.com>
This commit is contained in:
15
.github/workflows/tests.yaml
vendored
15
.github/workflows/tests.yaml
vendored
@@ -29,20 +29,5 @@ jobs:
|
||||
flutter channel stable
|
||||
flutter doctor
|
||||
|
||||
- name: Build rive_common shared library
|
||||
run: |
|
||||
flutter pub get
|
||||
VERSION=$(dart pub deps -s list | grep rive_common | sed 's/[^0-9.]*//g')
|
||||
echo "Rive Common Version: $VERSION"
|
||||
pushd ~/.pub-cache/hosted/pub.dev/rive_common-$VERSION
|
||||
./update_dependencies.sh force
|
||||
pushd shared_lib
|
||||
./build_shared.sh
|
||||
RIVE_TEXT_DYLIB=$PWD/build/bin/debug/librive_text.dylib
|
||||
popd
|
||||
popd
|
||||
mkdir -p shared_lib/build/bin/debug/
|
||||
cp $RIVE_TEXT_DYLIB shared_lib/build/bin/debug/
|
||||
|
||||
- name: Run tests
|
||||
run: flutter test
|
||||
|
||||
@@ -1 +1 @@
|
||||
b21adb45646d34fd7ea1850e5802ce63afc937aa
|
||||
4b77d3dea084fddf89c63efcdeb03c33fa533ee9
|
||||
|
||||
@@ -6,6 +6,8 @@ This has resulted in significant changes to the underlying API.
|
||||
|
||||
Please see the [migration guide](https://rive.app/docs/runtimes/flutter/migration-guide), [Rive Flutter documentation](https://rive.app/docs/runtimes/flutter/flutter), and the updated example app for more information.
|
||||
|
||||
The core runtime code is now in [rive_native](https://pub.dev/packages/rive_native). This release uses `v0.0.4` of that package.
|
||||
|
||||
### What's New in 0.14.0
|
||||
|
||||
This release of Rive Flutter adds:
|
||||
|
||||
28
README.md
28
README.md
@@ -26,12 +26,14 @@ This library allows you to fully control Rive files in your Flutter apps and gam
|
||||
- [Testing](#testing)
|
||||
- [Contributing](#contributing)
|
||||
- [Issues](#issues)
|
||||
- [Rive Flutter Legacy Runtime](#rive-flutter-legacy-runtime)
|
||||
|
||||
## Overview of Rive
|
||||
|
||||
[Rive](https://rive.app) combines an interactive design tool, a new stateful graphics format, a lightweight multi-platform runtime, and a blazing-fast vector renderer. This end-to-end pipeline guarantees that what you build in the Rive Editor is exactly what ships in your apps, games, and websites.
|
||||
|
||||
For more information, check out the following resources:
|
||||
|
||||
- [Homepage](https://rive.app/)
|
||||
- [General Docs](https://rive.app/docs/)
|
||||
- [Flutter Docs](https://rive.app/docs/runtimes/flutter/flutter)
|
||||
@@ -67,6 +69,7 @@ final riveFile = (await File.asset(
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
- `Factory.rive` for the Rive renderer
|
||||
- `Factoy.flutter` for the Flutter renderer
|
||||
|
||||
@@ -77,22 +80,24 @@ For more information and additional consideration, see [Specifying a Renderer](h
|
||||
Starting in Flutter v3.10, [Impeller](https://docs.flutter.dev/perf/impeller) has replaced [Skia](https://skia.org/) to become the default renderer for apps on the iOS platform and may continue to be the default on future platforms over time. As such, there is a possibility of rendering and performance discrepencies when using the Rive Flutter runtime with platforms that use the Impeller renderer that may not have surfaced before. If you encounter any visual or performance errors at runtime compared to expected behavior in the Rive editor, we recommend trying the following steps to triage:
|
||||
|
||||
1. Try running the Flutter app with the `--no-enable-impeller` flag to use the Skia renderer. If the visual discrepancy does not show when using Skia, it may be a rendering bug on Impeller. However, before raising a bug with the Flutter team, try the second point below👇
|
||||
|
||||
```bash
|
||||
flutter run --no-enable-impeller
|
||||
```
|
||||
|
||||
2. Try running the Flutter app on the latest master channel. It is possible that visual bugs may be resolved on the latest Flutter commits, but not yet released in the beta or stable channel.
|
||||
3. If you are still seeing visual discrepancies with just the Impeller renderer on the latest master branch, we recommend raising a detailed issue to the [Flutter Github repo](https://github.com/flutter/flutter) with a reproducible example, and other relevant details that can help the team debug any possible issues that may be present.
|
||||
|
||||
## Supported platforms
|
||||
|
||||
| Platform | Flutter Renderer | Rive Renderer |
|
||||
|----------|------------------|---------------|
|
||||
| iOS | ✅ | ✅ |
|
||||
| Android | ✅ | ✅ |
|
||||
| macOS | ✅ | ✅ |
|
||||
| Windows | ✅ | ✅ |
|
||||
| Linux | ❌ | ❌ |
|
||||
| Web | ✅ | ✅ |
|
||||
| -------- | ---------------- | ------------- |
|
||||
| iOS | ✅ | ✅ |
|
||||
| Android | ✅ | ✅ |
|
||||
| macOS | ✅ | ✅ |
|
||||
| Windows | ✅ | ✅ |
|
||||
| Linux | ❌ | ❌ |
|
||||
| Web | ✅ | ✅ |
|
||||
|
||||
Be sure to read the [platform specific considerations](platform_considerations.md) for the Rive Flutter package.
|
||||
|
||||
@@ -131,7 +136,6 @@ dart run rive_native:setup --verbose --clean --build --platform macos
|
||||
|
||||
Shared libraries are included in the download/build process. If you encounter issues using `rive_native` in your tests, please reach out to us for assistance.
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
We love contributions and all are welcome! 💙
|
||||
@@ -140,3 +144,11 @@ We love contributions and all are welcome! 💙
|
||||
|
||||
- Reach out to us on our [Community](https://community.rive.app/feed)
|
||||
- File an issue on the [Rive Flutter repository](https://github.com/rive-app/rive-flutter/issues)
|
||||
|
||||
## Rive Flutter Legacy Runtime
|
||||
|
||||
You can find the old runtime code here: https://github.com/rive-app/rive-flutter-legacy
|
||||
|
||||
The last published Pub release for this code is `rive: 0.13.20`.
|
||||
|
||||
The majority of the new runtime code now lives in the [rive_native package](https://pub.dev/packages/rive_native).
|
||||
|
||||
@@ -44,11 +44,12 @@ class _ExampleBasicState extends State<ExampleDataBinding> {
|
||||
viewModelInstance = controller!.dataBind(DataBind.auto());
|
||||
_selectRandomToken();
|
||||
// Print the view model instance properties
|
||||
print(viewModelInstance.properties);
|
||||
debugPrint(viewModelInstance.properties.toString());
|
||||
// Get the rewards view model
|
||||
coinItemVM = viewModelInstance.viewModel('Coin')!;
|
||||
gemItemVM = viewModelInstance.viewModel('Gem')!;
|
||||
print(coinItemVM); // Print the view model instance properties
|
||||
debugPrint(
|
||||
coinItemVM.toString()); // Print the view model instance properties
|
||||
|
||||
coinValue = coinItemVM.number('Item_Value')!;
|
||||
gemValue = gemItemVM.number('Item_Value')!;
|
||||
@@ -70,11 +71,11 @@ class _ExampleBasicState extends State<ExampleDataBinding> {
|
||||
}
|
||||
|
||||
void _onCoinValueChange(double value) {
|
||||
print('New coin value: $value');
|
||||
debugPrint('New coin value: $value');
|
||||
}
|
||||
|
||||
void _onGemValueChange(double value) {
|
||||
print('New gem value: $value');
|
||||
debugPrint('New gem value: $value');
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -31,12 +31,12 @@ class _ExampleRiveWidgetBuilderState extends State<ExampleRiveWidgetBuilder> {
|
||||
dataBind: DataBind.auto(),
|
||||
// Optional `onFailed` callback to handle loading errors
|
||||
onFailed: (error, stackTrace) {
|
||||
print(error);
|
||||
print(stackTrace);
|
||||
debugPrint(error.toString());
|
||||
debugPrint(stackTrace.toString());
|
||||
},
|
||||
// Optional `onLoaded` callback to access the loaded state
|
||||
onLoaded: (state) {
|
||||
print('Rive loaded');
|
||||
debugPrint('Rive loaded');
|
||||
},
|
||||
// Optionally specify the controller to create
|
||||
// controller: (file) => RiveWidgetController(file),
|
||||
|
||||
@@ -42,10 +42,10 @@ class _ExampleTextRunsState extends State<ExampleTextRuns> {
|
||||
// You can access nested text runs by providing an optional path
|
||||
final initialText =
|
||||
_controller?.artboard.getText('button_text', path: null);
|
||||
print('Initial text: $initialText');
|
||||
debugPrint('Initial text: $initialText');
|
||||
_controller?.artboard.setText('button_text', 'Hello, world!');
|
||||
final updatedText = _controller?.artboard.getText('button_text');
|
||||
print('Updated text: $updatedText');
|
||||
debugPrint('Updated text: $updatedText');
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ignore_for_file: deprecated_member_use
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rive_example/examples/databinding_images.dart';
|
||||
import 'package:rive_example/examples/examples.dart';
|
||||
|
||||
@@ -20,7 +20,7 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||
rive_native: 9930efc341917c512f451cfe1522d8addf54d569
|
||||
rive_native: 8a1f7b191cd1cfb55301e8d5028880e4ae788d56
|
||||
url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
|
||||
|
||||
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
|
||||
|
||||
@@ -12,6 +12,7 @@ export 'package:rive_native/rive_native.dart'
|
||||
InternalViewModelInstanceString,
|
||||
InternalViewModelInstance,
|
||||
InternalViewModelInstanceViewModel,
|
||||
InternalViewModelInstanceArtboard,
|
||||
InternalDataBind;
|
||||
|
||||
export 'src/errors.dart';
|
||||
|
||||
@@ -1,319 +0,0 @@
|
||||
local dependency = require('dependency')
|
||||
|
||||
harfbuzz = dependency.github('harfbuzz/harfbuzz', '858570b1d9912a1b746ab39fbe62a646c4f7a5b1')
|
||||
sheenbidi = dependency.github('Tehreer/SheenBidi', 'v2.6')
|
||||
|
||||
workspace('rive_text')
|
||||
configurations({ 'debug', 'release' })
|
||||
|
||||
source = os.isdir('../../packages/runtime') and '../../packages/runtime' or 'macos/rive-cpp'
|
||||
|
||||
project('rive_sheenbidi')
|
||||
do
|
||||
kind('StaticLib')
|
||||
language('C')
|
||||
toolset('clang')
|
||||
targetdir('shared_lib/build/bin/%{cfg.buildcfg}/')
|
||||
objdir('shared_lib/build/obj/%{cfg.buildcfg}/')
|
||||
|
||||
includedirs({ sheenbidi .. '/Headers' })
|
||||
|
||||
filter({ 'options:arch=wasm' })
|
||||
do
|
||||
targetdir('wasm/build/bin/%{cfg.buildcfg}/')
|
||||
objdir('wasm/build/obj/%{cfg.buildcfg}/')
|
||||
end
|
||||
|
||||
filter('configurations:debug')
|
||||
do
|
||||
files({
|
||||
sheenbidi .. '/Source/BidiChain.c',
|
||||
sheenbidi .. '/Source/BidiTypeLookup.c',
|
||||
sheenbidi .. '/Source/BracketQueue.c',
|
||||
sheenbidi .. '/Source/GeneralCategoryLookup.c',
|
||||
sheenbidi .. '/Source/IsolatingRun.c',
|
||||
sheenbidi .. '/Source/LevelRun.c',
|
||||
sheenbidi .. '/Source/PairingLookup.c',
|
||||
sheenbidi .. '/Source/RunQueue.c',
|
||||
sheenbidi .. '/Source/SBAlgorithm.c',
|
||||
sheenbidi .. '/Source/SBBase.c',
|
||||
sheenbidi .. '/Source/SBCodepointSequence.c',
|
||||
sheenbidi .. '/Source/SBLine.c',
|
||||
sheenbidi .. '/Source/SBLog.c',
|
||||
sheenbidi .. '/Source/SBMirrorLocator.c',
|
||||
sheenbidi .. '/Source/SBParagraph.c',
|
||||
sheenbidi .. '/Source/SBScriptLocator.c',
|
||||
sheenbidi .. '/Source/ScriptLookup.c',
|
||||
sheenbidi .. '/Source/ScriptStack.c',
|
||||
sheenbidi .. '/Source/StatusStack.c',
|
||||
})
|
||||
end
|
||||
filter('configurations:release')
|
||||
do
|
||||
files({ sheenbidi .. '/Source/SheenBidi.c' })
|
||||
end
|
||||
|
||||
buildoptions({ '-Wall', '-ansi', '-pedantic', '-DANSI_DECLARATORS' })
|
||||
|
||||
buildoptions({
|
||||
'-Wno-c++17-extensions',
|
||||
'-fno-exceptions',
|
||||
'-fno-rtti',
|
||||
'-fno-unwind-tables',
|
||||
'-Wno-deprecated-builtins',
|
||||
})
|
||||
|
||||
filter({ 'options:arch=wasm' })
|
||||
do
|
||||
buildoptions({
|
||||
'-s STRICT=1',
|
||||
'-s DISABLE_EXCEPTION_CATCHING=1',
|
||||
'-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0',
|
||||
'--no-entry',
|
||||
})
|
||||
end
|
||||
|
||||
filter('configurations:debug')
|
||||
do
|
||||
defines({ 'DEBUG' })
|
||||
symbols('On')
|
||||
end
|
||||
|
||||
filter('configurations:release')
|
||||
do
|
||||
defines({ 'RELEASE', 'NDEBUG', 'SB_CONFIG_UNITY' })
|
||||
optimize('On')
|
||||
buildoptions({ '-Oz', '-g0', '-flto' })
|
||||
|
||||
linkoptions({ '-Oz', '-g0', '-flto' })
|
||||
end
|
||||
filter({ 'system:macosx', 'options:arch=arm64' })
|
||||
do
|
||||
buildoptions({ '-target arm64-apple-macos11' })
|
||||
linkoptions({ '-target arm64-apple-macos11' })
|
||||
end
|
||||
filter({ 'system:macosx', 'options:arch=x86_64' })
|
||||
do
|
||||
buildoptions({ '-target x86_64-apple-macos10.12' })
|
||||
linkoptions({ '-target x86_64-apple-macos10.12' })
|
||||
end
|
||||
end
|
||||
|
||||
project('rive_text')
|
||||
do
|
||||
kind('SharedLib')
|
||||
language('C++')
|
||||
cppdialect('C++17')
|
||||
toolset('clang')
|
||||
targetdir('shared_lib/build/bin/%{cfg.buildcfg}')
|
||||
objdir('shared_lib/build/obj/%{cfg.buildcfg}')
|
||||
|
||||
dependson({ 'rive_sheenbidi' })
|
||||
|
||||
defines({
|
||||
'WITH_RIVE_TEXT',
|
||||
'WITH_RIVE_AUDIO',
|
||||
'HAVE_OT',
|
||||
'HB_NO_FALLBACK_SHAPE',
|
||||
'HB_NO_WIN1256',
|
||||
'HB_NO_EXTERN_HELPERS',
|
||||
'HB_DISABLE_DEPRECATED',
|
||||
'HB_NO_COLOR',
|
||||
'HB_NO_BITMAP',
|
||||
'HB_NO_BUFFER_SERIALIZE',
|
||||
'HB_NO_SETLOCALE',
|
||||
'HB_NO_VERTICAL',
|
||||
'HB_NO_LAYOUT_COLLECT_GLYPHS',
|
||||
'HB_NO_LAYOUT_RARELY_USED',
|
||||
'HB_NO_LAYOUT_UNUSED',
|
||||
'HB_NO_OT_FONT_GLYPH_NAMES',
|
||||
})
|
||||
|
||||
includedirs({
|
||||
source .. '/include',
|
||||
source .. '/skia/renderer/include',
|
||||
harfbuzz .. '/src/',
|
||||
sheenbidi .. '/Headers',
|
||||
})
|
||||
|
||||
files({
|
||||
source .. '/src/renderer.cpp',
|
||||
source .. '/src/math/mat2d.cpp',
|
||||
source .. '/src/math/vec2d.cpp',
|
||||
source .. '/src/math/raw_path.cpp',
|
||||
source .. '/src/text/font_hb.cpp',
|
||||
source .. '/src/text/line_breaker.cpp',
|
||||
harfbuzz .. '/src/hb-aat-layout.cc',
|
||||
harfbuzz .. '/src/hb-aat-map.cc',
|
||||
harfbuzz .. '/src/hb-blob.cc',
|
||||
harfbuzz .. '/src/hb-buffer-serialize.cc',
|
||||
harfbuzz .. '/src/hb-buffer-verify.cc',
|
||||
harfbuzz .. '/src/hb-buffer.cc',
|
||||
harfbuzz .. '/src/hb-common.cc',
|
||||
harfbuzz .. '/src/hb-draw.cc',
|
||||
harfbuzz .. '/src/hb-face.cc',
|
||||
harfbuzz .. '/src/hb-font.cc',
|
||||
harfbuzz .. '/src/hb-map.cc',
|
||||
harfbuzz .. '/src/hb-number.cc',
|
||||
harfbuzz .. '/src/hb-ot-cff1-table.cc',
|
||||
harfbuzz .. '/src/hb-ot-cff2-table.cc',
|
||||
harfbuzz .. '/src/hb-ot-color.cc',
|
||||
harfbuzz .. '/src/hb-ot-face.cc',
|
||||
harfbuzz .. '/src/hb-ot-font.cc',
|
||||
harfbuzz .. '/src/hb-ot-layout.cc',
|
||||
harfbuzz .. '/src/hb-ot-map.cc',
|
||||
harfbuzz .. '/src/hb-ot-math.cc',
|
||||
harfbuzz .. '/src/hb-ot-meta.cc',
|
||||
harfbuzz .. '/src/hb-ot-metrics.cc',
|
||||
harfbuzz .. '/src/hb-ot-name.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-arabic.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-default.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-hangul.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-hebrew.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-indic-table.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-indic.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-khmer.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-myanmar.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-syllabic.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-thai.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-use.cc',
|
||||
harfbuzz .. '/src/hb-ot-shaper-vowel-constraints.cc',
|
||||
harfbuzz .. '/src/hb-ot-shape-fallback.cc',
|
||||
harfbuzz .. '/src/hb-ot-shape-normalize.cc',
|
||||
harfbuzz .. '/src/hb-ot-shape.cc',
|
||||
harfbuzz .. '/src/hb-ot-tag.cc',
|
||||
harfbuzz .. '/src/hb-ot-var.cc',
|
||||
harfbuzz .. '/src/hb-set.cc',
|
||||
harfbuzz .. '/src/hb-shape-plan.cc',
|
||||
harfbuzz .. '/src/hb-shape.cc',
|
||||
harfbuzz .. '/src/hb-shaper.cc',
|
||||
harfbuzz .. '/src/hb-static.cc',
|
||||
harfbuzz .. '/src/hb-subset-cff-common.cc',
|
||||
harfbuzz .. '/src/hb-subset-cff1.cc',
|
||||
harfbuzz .. '/src/hb-subset-cff2.cc',
|
||||
harfbuzz .. '/src/hb-subset-input.cc',
|
||||
harfbuzz .. '/src/hb-subset-plan.cc',
|
||||
harfbuzz .. '/src/hb-subset-repacker.cc',
|
||||
harfbuzz .. '/src/hb-subset.cc',
|
||||
harfbuzz .. '/src/hb-ucd.cc',
|
||||
harfbuzz .. '/src/hb-unicode.cc',
|
||||
harfbuzz .. '/src/hb-style.h',
|
||||
harfbuzz .. '/src/hb-style.cc',
|
||||
})
|
||||
|
||||
links({ 'rive_sheenbidi' })
|
||||
|
||||
buildoptions({
|
||||
'-Wno-c++17-extensions',
|
||||
'-fno-exceptions',
|
||||
'-fno-rtti',
|
||||
'-fno-unwind-tables',
|
||||
'-Wno-deprecated-builtins',
|
||||
'-DANSI_DECLARATORS',
|
||||
})
|
||||
|
||||
filter({ 'not options:arch=wasm' })
|
||||
do
|
||||
files({ 'macos/rive_text/rive_text.cpp' })
|
||||
end
|
||||
|
||||
filter({ 'options:arch=wasm' })
|
||||
do
|
||||
targetdir('wasm/build/bin/%{cfg.buildcfg}/')
|
||||
objdir('wasm/build/obj/%{cfg.buildcfg}/')
|
||||
kind('ConsoleApp')
|
||||
files({ 'wasm/rive_text_bindings.cpp' })
|
||||
buildoptions({
|
||||
'-s STRICT=1',
|
||||
'-s DISABLE_EXCEPTION_CATCHING=1',
|
||||
'-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0',
|
||||
'--no-entry',
|
||||
})
|
||||
linkoptions({
|
||||
'--closure 1',
|
||||
'--closure-args="--externs ./wasm/js/externs.js"',
|
||||
'--bind',
|
||||
'-s FORCE_FILESYSTEM=0',
|
||||
'-s MODULARIZE=1',
|
||||
'-s NO_EXIT_RUNTIME=1',
|
||||
'-s STRICT=1',
|
||||
'-s ALLOW_MEMORY_GROWTH=1',
|
||||
'-s DISABLE_EXCEPTION_CATCHING=1',
|
||||
'-s WASM=1',
|
||||
'-s USE_ES6_IMPORT_META=0',
|
||||
'-s EXPORT_NAME="RiveText"',
|
||||
'-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0',
|
||||
'--no-entry',
|
||||
'--pre-js ./wasm/js/rive_text.js',
|
||||
})
|
||||
end
|
||||
|
||||
linkoptions({
|
||||
'-Wno-c++17-extensions',
|
||||
'-fno-exceptions',
|
||||
'-fno-rtti',
|
||||
'-fno-unwind-tables',
|
||||
})
|
||||
|
||||
filter({ 'options:arch=wasm', 'options:single_file' })
|
||||
do
|
||||
linkoptions({
|
||||
'-o %{cfg.targetdir}/rive_text_single.js',
|
||||
'-s SINGLE_FILE=1',
|
||||
})
|
||||
end
|
||||
|
||||
filter({ 'options:arch=wasm', 'options:not single_file' })
|
||||
do
|
||||
linkoptions({ '-o %{cfg.targetdir}/rive_text.js' })
|
||||
end
|
||||
|
||||
filter('configurations:debug')
|
||||
do
|
||||
defines({ 'DEBUG' })
|
||||
symbols('On')
|
||||
end
|
||||
|
||||
filter({ 'configurations:debug', 'options:arch=wasm' })
|
||||
do
|
||||
linkoptions({ '-s ASSERTIONS=1' })
|
||||
end
|
||||
|
||||
filter('configurations:release')
|
||||
do
|
||||
defines({ 'RELEASE' })
|
||||
defines({ 'NDEBUG' })
|
||||
optimize('On')
|
||||
|
||||
buildoptions({ '-Oz', '-g0', '-flto' })
|
||||
|
||||
linkoptions({ '-Oz', '-g0', '-flto' })
|
||||
end
|
||||
|
||||
filter({ 'configurations:release', 'options:arch=wasm' })
|
||||
do
|
||||
linkoptions({ '-s ASSERTIONS=0' })
|
||||
end
|
||||
|
||||
filter({ 'system:macosx', 'options:arch=arm64' })
|
||||
do
|
||||
buildoptions({ '-target arm64-apple-macos11' })
|
||||
linkoptions({ '-target arm64-apple-macos11' })
|
||||
end
|
||||
filter({ 'system:macosx', 'options:arch=x86_64' })
|
||||
do
|
||||
buildoptions({ '-target x86_64-apple-macos10.12' })
|
||||
linkoptions({ '-target x86_64-apple-macos10.12' })
|
||||
end
|
||||
end
|
||||
|
||||
newoption({
|
||||
trigger = 'single_file',
|
||||
description = 'Set when the wasm should be packed in with the js code.',
|
||||
})
|
||||
|
||||
newoption({
|
||||
trigger = 'arch',
|
||||
description = 'Architectures we can target',
|
||||
allowed = { { 'x86_64' }, { 'arm64' }, { 'wasm' } },
|
||||
})
|
||||
@@ -9,7 +9,7 @@ topics:
|
||||
- effects
|
||||
- design
|
||||
- games
|
||||
|
||||
|
||||
environment:
|
||||
sdk: ">=3.5.0 <4.0.0"
|
||||
flutter: ">=3.3.0"
|
||||
@@ -19,8 +19,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter_web_plugins:
|
||||
sdk: flutter
|
||||
rive_native:
|
||||
path: ../rive_native
|
||||
rive_native: 0.0.4
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# silence push/pop
|
||||
pushd() {
|
||||
command pushd "$@" >/dev/null
|
||||
}
|
||||
|
||||
popd() {
|
||||
command popd "$@" >/dev/null
|
||||
}
|
||||
|
||||
FORCE=false
|
||||
for var in "$@"; do
|
||||
if [[ $var = "force" ]]; then
|
||||
FORCE=true
|
||||
fi
|
||||
done
|
||||
|
||||
function installRiveCpp {
|
||||
if [ $FORCE == "true" ] || [ ! -d rive-cpp ]; then
|
||||
rm -fR rive-cpp
|
||||
if [ -d ../../runtime ]; then
|
||||
echo "Getting rive-cpp from current repo."
|
||||
export INSTALL_TO=$PWD
|
||||
mkdir -p rive-cpp
|
||||
pushd ../../runtime
|
||||
|
||||
function copyRepoFile {
|
||||
mkdir -p $(dirname $INSTALL_TO/rive-cpp/$1)
|
||||
cp $1 $INSTALL_TO/rive-cpp/$1
|
||||
echo -en "\r\033[K$1"
|
||||
}
|
||||
export -f copyRepoFile
|
||||
git ls-files | xargs -n1 bash -c 'copyRepoFile "$@"' _
|
||||
echo -en "\r\033[K"
|
||||
popd
|
||||
else
|
||||
echo "Cloning rive-cpp."
|
||||
git clone https://github.com/rive-app/rive-cpp
|
||||
fi
|
||||
# TODO: Fix this so we build the rive.podspec file based on paths determined
|
||||
# here (for harfbuzz and sheenbidi)
|
||||
#
|
||||
# install dependencies from rive-cpp
|
||||
# pushd rive-cpp/dependencies/macosx
|
||||
# source config_directories.sh
|
||||
# popd
|
||||
# pushd rive-cpp
|
||||
# ./build.sh
|
||||
# popd
|
||||
fi
|
||||
|
||||
# For now just manually install the deps.
|
||||
if [ $FORCE == "true" ] || [ ! -d harfbuzz ]; then
|
||||
rm -fR harfbuzz
|
||||
echo "Cloning Harfbuzz."
|
||||
git clone https://github.com/harfbuzz/harfbuzz
|
||||
pushd harfbuzz
|
||||
git checkout "6.0.0" .
|
||||
popd
|
||||
fi
|
||||
if [ $FORCE == "true" ] || [ ! -d SheenBidi ]; then
|
||||
rm -fR SheenBidi
|
||||
echo "Cloning SheenBidi."
|
||||
git clone https://github.com/Tehreer/SheenBidi.git
|
||||
pushd SheenBidi
|
||||
git checkout v2.6 .
|
||||
popd
|
||||
fi
|
||||
}
|
||||
|
||||
pushd macos
|
||||
installRiveCpp
|
||||
popd
|
||||
|
||||
pushd ios
|
||||
installRiveCpp
|
||||
popd
|
||||
Reference in New Issue
Block a user