Fixing resolve for format_7

This commit is contained in:
Luigi Rosso
2021-03-05 16:54:23 -08:00
parent 84a063a47c
commit 8244e70151
13 changed files with 43 additions and 55 deletions

View File

@ -54,7 +54,7 @@
/* Begin PBXFileReference section */
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* rive_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "rive_example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@ -105,7 +105,7 @@
33CC10EE2044A3C60003C045 /* Products */ = {
isa = PBXGroup;
children = (
33CC10ED2044A3C60003C045 /* rive_example.app */,
33CC10ED2044A3C60003C045 /* example.app */,
);
name = Products;
sourceTree = "<group>";
@ -172,7 +172,7 @@
);
name = Runner;
productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* rive_example.app */;
productReference = 33CC10ED2044A3C60003C045 /* example.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@ -183,7 +183,7 @@
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "The Flutter Authors";
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
CreatedOnToolsVersion = 9.2;
@ -202,7 +202,7 @@
};
};
buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 8.0";
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
@ -268,7 +268,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh\ntouch Flutter/ephemeral/tripwire\n";
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
/* End PBXShellScriptBuildPhase section */
@ -361,10 +361,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@ -491,10 +487,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@ -515,10 +507,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",

View File

@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "rive_example.app"
BuildableName = "example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@ -27,23 +27,11 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00380F9121DF178D00097171"
BuildableName = "RunnerUITests.xctest"
BlueprintName = "RunnerUITests"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "rive_example.app"
BuildableName = "example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@ -66,7 +54,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "rive_example.app"
BuildableName = "example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@ -75,7 +63,7 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
@ -85,7 +73,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "rive_example.app"
BuildableName = "example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>

View File

@ -5,10 +5,10 @@
// 'flutter create' template.
// The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = rive_example
PRODUCT_NAME = example
// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.example.riveExample
PRODUCT_BUNDLE_IDENTIFIER = com.example.example
// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2020 com.example. All rights reserved.
PRODUCT_COPYRIGHT = Copyright © 2021 com.example. All rights reserved.

View File

@ -44,7 +44,7 @@ abstract class CoreContext {
// ignore: one_member_abstracts
abstract class ImportStackObject {
void resolve();
bool resolve();
}
/// Stack to help the RiveFile locate latest ImportStackObject created of a
@ -59,17 +59,27 @@ class ImportStack {
return null;
}
void makeLatest(int coreType, ImportStackObject importObject) {
bool makeLatest(int coreType, ImportStackObject importObject) {
var latest = _latests[coreType];
if (latest != null) {
if (!latest.resolve()) {
return false;
}
}
if (importObject != null) {
_latests[coreType] = importObject;
} else {
_latests.remove(coreType);
}
return true;
}
void resolve() {
bool resolve() {
for (final object in _latests.values) {
object.resolve();
if (!object.resolve()) {
return false;
}
}
return true;
}
}

View File

@ -18,7 +18,7 @@ class ArtboardImporter extends ImportStackObject {
void addStateMachine(StateMachine animation) => addAnimation(animation);
@override
void resolve() {
bool resolve() {
for (final object in artboard.objects.skip(1)) {
if (object is Component && object.parentId == null) {
object.parent = artboard;
@ -34,5 +34,6 @@ class ArtboardImporter extends ImportStackObject {
object.onAdded();
}
artboard.clean();
return true;
}
}

View File

@ -13,5 +13,5 @@ class KeyedObjectImporter extends ImportStackObject {
}
@override
void resolve() {}
bool resolve() => true;
}

View File

@ -16,5 +16,5 @@ class KeyedPropertyImporter extends ImportStackObject {
}
@override
void resolve() {}
bool resolve() => true;
}

View File

@ -12,5 +12,5 @@ class LayerStateImporter extends ImportStackObject {
}
@override
void resolve() {}
bool resolve() => true;
}

View File

@ -16,9 +16,10 @@ class LinearAnimationImporter extends ImportStackObject {
}
@override
void resolve() {
bool resolve() {
for (final keyedObject in keyedObjects) {
keyedObject?.objectId ??= linearAnimation.artboard.id;
}
return true;
}
}

View File

@ -12,6 +12,5 @@ class StateMachineImporter extends ImportStackObject {
}
@override
void resolve() {
}
bool resolve() => true;
}

View File

@ -16,7 +16,7 @@ class StateMachineLayerImporter extends ImportStackObject {
}
@override
void resolve() {
bool resolve() {
for (final state in importedStates) {
for (final transition in state.transitions) {
// At import time the stateToId is an index relative to the entire layer
@ -34,5 +34,6 @@ class StateMachineLayerImporter extends ImportStackObject {
// transition.stateTo = importedStates[transition.stateToId];
}
}
return true;
}
}

View File

@ -11,5 +11,5 @@ class StateTransitionImporter extends ImportStackObject {
}
@override
void resolve() {}
bool resolve() => true;
}

View File

@ -118,7 +118,9 @@ class RiveFile {
break;
}
importStack.makeLatest(stackType, stackObject);
if (!importStack.makeLatest(stackType, stackObject)) {
return false;
}
if (object?.import(importStack) ?? true) {
switch (object.coreType) {
@ -132,9 +134,7 @@ class RiveFile {
}
}
}
importStack.resolve();
return true;
return importStack.resolve();
}
}