Skip to content

Commit

Permalink
Merge pull request #45 from rive-app/maybeFramework
Browse files Browse the repository at this point in the history
Maybe framework
  • Loading branch information
mjtalbot authored May 19, 2021
2 parents b2e6939 + e99aced commit 79ae34c
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 7 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/build_frameworks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build Rive framework

on:
release:
types: [released]

jobs:
build_frameworks:
name: Create RiveRuntime.xcframework
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.RIVE_REPO_PAT }}
submodules: recursive
- name: Init submodule
run: git submodule update --init
- id: build_iphoneos
name: Build release iphoneos framework
run: sh ./scripts/buildFramework.sh -t iphoneos -c Release
- id: build_iphonesimulator
name: Build release iphonesimulator framework
run: sh ./scripts/buildFramework.sh -t iphonesimulator -c Release
- id: merge_frameworks
if: steps.build_iphoneos.conclusion == 'success' && steps.build_iphonesimulator.conclusion == 'success'
name: Merge created frameworks
run: sh ./scripts/mergeFrameworks.sh -c Release
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: RiveRuntime.xcframework
path: build/RiveRuntime.xcframework

create_podspec_file:
name: Create RiveRuntime.podspec
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.RIVE_REPO_PAT }}
submodules: recursive
- name: Read podspec.txt file
uses: pCYSl5EDgo/cat@master
id: podspec
with:
path: .github/workflows/podspec.txt
- name: Create *.podspec
run: |
cat > RiveRuntime.podspec <<-EOF
${{ steps.podspec.outputs.text }}
EOF
env:
GITHUB_AUTHOR: ${{ github.actor }}
RELEASE_VERSION: ${{ github.event.release.tag_name }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: RiveRuntime.podspec
path: RiveRuntime.podspec

upload_cocoapods:
name: Update podspec repository
runs-on: macos-latest
timeout-minutes: 10
needs: [create_podspec_file, build_frameworks]
steps:
- name: Checkout podspec repo
uses: actions/checkout@v2
with:
repository: rive-app/test-ios
token: ${{ secrets.RIVE_REPO_PAT }}
- name: Clean
run: |
rm -rf RiveRuntime.podspec
rm -rf RiveRuntime.xcframework
- name: Download framework artifact
uses: actions/download-artifact@v2
with:
name: RiveRuntime.xcframework
path: RiveRuntime.xcframework
- name: Download podspec artifact
uses: actions/download-artifact@v2
with:
name: RiveRuntime.podspec
- name: Lint pod
run: pod lib lint --allow-warnings
- name: Push pod to test-ios repo
run: |
git status
git config --local user.email '[email protected]'
git config --local user.name ${{ github.actor }}
git add .
git commit -m "Update podspec repo tag:${{ github.event.release.tag_name }}"
git push
env:
API_TOKEN_GITHUB: ${{ secrets.RIVE_REPO_PAT }}
40 changes: 40 additions & 0 deletions .github/workflows/podspec.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Pod::Spec.new do |spec|
spec.name = "RiveRuntime"
spec.version = "$RELEASE_VERSION"
spec.summary = "iOS SDK for Rive"
spec.description = "Rive iOS framework"
spec.homepage = "https://rive.app"
spec.license = { :type => "MIT", :text => <<-LICENSE
Copyright (c) 2020-2021 Rive

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
LICENSE
}
spec.authors = { "$GITHUB_AUTHOR" => "$(git config user.email)" }
spec.platform = :ios, '11.3'
spec.ios.deployment_target = '11.3'
spec.swift_version = '5.0'
spec.source = {
:git => "https://github.com/rive-app/ios-test.git",
:tag => "v#{spec.version}"
}
spec.ios.vendored_frameworks = 'RiveRuntime.xcframework'
spec.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
spec.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
end
12 changes: 7 additions & 5 deletions RiveRuntime.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@
C9C741F324FC510200EF9516 /* Rive.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Rive.mm; sourceTree = "<group>"; };
C9CE8252263B716F00F98DDB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/iOSSupport/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
C9CE825F263B7CC200F98DDB /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/iOSSupport/System/Library/Frameworks/SwiftUI.framework; sourceTree = DEVELOPER_DIR; };
C9D60DA92512B01600AAA3A6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };
C9D60DAB2512B04B00AAA3A6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
C9D60DA92512B01600AAA3A6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };
C9D60DAB2512B04B00AAA3A6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -2027,7 +2027,7 @@
C9C73EE624FC478900EF9516 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
Expand Down Expand Up @@ -2058,7 +2058,7 @@
C9C73EE724FC478900EF9516 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
Expand All @@ -2068,7 +2068,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
"HEADER_SEARCH_PATHS[arch=*]" = Rive/include;
"HEADER_SEARCH_PATHS[arch=*]" = "submodules/rive-cpp/include";
INFOPLIST_FILE = Source/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -2077,9 +2077,11 @@
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.6.5;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = rive.app.ios.runtime.RiveRuntime;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
81 changes: 81 additions & 0 deletions RiveRuntime.xcodeproj/xcshareddata/xcschemes/RiveRuntime.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9C73ED024FC478800EF9516"
BuildableName = "RiveRuntime.framework"
BlueprintName = "RiveRuntime"
ReferencedContainer = "container:RiveRuntime.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9C73ED924FC478900EF9516"
BuildableName = "RiveRuntimeTests.xctest"
BlueprintName = "RiveRuntimeTests"
ReferencedContainer = "container:RiveRuntime.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9C73ED024FC478800EF9516"
BuildableName = "RiveRuntime.framework"
BlueprintName = "RiveRuntime"
ReferencedContainer = "container:RiveRuntime.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9C73ED924FC478900EF9516"
BuildableName = "RiveRuntimeTests.xctest"
BlueprintName = "RiveRuntimeTests"
ReferencedContainer = "container:RiveRuntime.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 2 additions & 2 deletions Tests/RiveDelegatesTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class DelegatesTest: XCTestCase {
XCTAssertEqual(delegate.states.count, 0)

// lets just start, expect 1 change.
view.fireState(stateMachineName: "State Machine 1", inputName: "right")
view.fireState("State Machine 1", inputName: "right")
// TODO: looks like we got a bit of a bug here. if we do not call this advance,
// the first animation doesnt seem to get the delta applied. i think its all because of
// how the
Expand All @@ -273,7 +273,7 @@ class DelegatesTest: XCTestCase {
XCTAssertEqual(0, delegate.states.count)

// ok lets change thigns up again.
view.fireState(stateMachineName: "State Machine 1", inputName: "change")
view.fireState("State Machine 1", inputName: "change")
view.advance(delta:0.0)
view.advance(delta:0.4)
XCTAssertEqual(true, view.isPlaying)
Expand Down
32 changes: 32 additions & 0 deletions scripts/buildFramework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

CLEAR='\033[0m'
RED='\033[0;31m'

function usage() {
if [ -n "$1" ]; then
echo -e "${RED}👉 $1${CLEAR}\n";
fi
echo "Usage: $0 [-t target] [-c configuration]"
echo " -t, --target Target (iphoneos / iphonesimulator)"
echo " -c, --configuration Configuration (Debug / Release)"
echo ""
echo "Example: $0 --target iphoneos --configuration Debug"
exit 1
}

# parse params
while [[ "$#" > 0 ]]; do case $1 in
-t|--target) TARGET="$2"; shift;shift;;
-c|--configuration) CONFIGURATION="$2";shift;shift;;
*) usage "Unknown parameter passed: $1"; shift; shift;;
esac; done

# verify params
if [ -z "$TARGET" ]; then usage "Target is not set"; fi;
if [ -z "$CONFIGURATION" ]; then usage "Configuration is not set."; fi;

echo -e "Build Rive Framework"
echo -e "Configuration -> ${CONFIGURATION}, target -> ${TARGET}"

xcodebuild -project RiveRuntime.xcodeproj -scheme RiveRuntime -sdk ${TARGET} -derivedDataPath build -configuration ${CONFIGURATION} | xcpretty
Loading

0 comments on commit 79ae34c

Please sign in to comment.