From 57086995d6fa6fe492c55019a0a0268b6f3f30b6 Mon Sep 17 00:00:00 2001 From: mjtalbot Date: Thu, 7 Jul 2022 12:54:17 +0000 Subject: [PATCH] =?UTF-8?q?adding=20all=20the=20updates=20to=20make=20ios?= =?UTF-8?q?=20build=20from=20the=20mono=20repo,=20and=20push=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … downstream just tagging you all for visibility will pepper a few comments in here and hit merge.... Diffs= 90e1d4cf7 renamed release script to releaase & removed unused scripts 418044ebf updates to renderer build defines a1af986be adding all the updates to make ios build from the mono repo, and push downstream --- .../{build_frameworks.yml => release.yml} | 108 ++++++++++++--- .github/workflows/test_build_pod.yml | 97 ------------- .github/workflows/tests.yml | 68 +++++++++- .rive_head | 2 +- CONTRIBUTING.md | 12 +- RiveRuntime.xcodeproj/project.pbxproj | 8 +- scripts/build.rive.sh | 128 ++++++++++++++++++ scripts/build.sh | 15 ++ scripts/build.skia.sh | 50 +++++++ scripts/build_dependencies.sh | 40 ------ scripts/configure.sh | 103 -------------- submodules/rive-cpp | 2 +- 12 files changed, 351 insertions(+), 282 deletions(-) rename .github/workflows/{build_frameworks.yml => release.yml} (63%) delete mode 100644 .github/workflows/test_build_pod.yml create mode 100755 scripts/build.rive.sh create mode 100755 scripts/build.sh create mode 100755 scripts/build.skia.sh delete mode 100755 scripts/build_dependencies.sh delete mode 100755 scripts/configure.sh diff --git a/.github/workflows/build_frameworks.yml b/.github/workflows/release.yml similarity index 63% rename from .github/workflows/build_frameworks.yml rename to .github/workflows/release.yml index ca322d26..99f8f335 100644 --- a/.github/workflows/build_frameworks.yml +++ b/.github/workflows/release.yml @@ -2,15 +2,61 @@ name: Create a Release on: workflow_dispatch: - pull_request: - types: [closed] - branches: - - main + inputs: + major: + description: 'Major' + type: boolean + default: false + minor: + description: 'Minor' + type: boolean + default: false jobs: + build-skia: + strategy: + matrix: + arch: ["x86" , "x64", "arm", "arm64", "iossim_arm64"] + + runs-on: macos-12 + permissions: + id-token: write + contents: read + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: us-west-2 + role-to-assume: ${{ secrets.ACTIONS_ROLE }} + - name: Checkout Code + uses: actions/checkout@v3 + with: + submodules: true + token: ${{ secrets.PAT_GITHUB }} + + - name: Update Java + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '16' + + - name: Installing pre-requisites + run: | + set -x + # Install some dependencies & premake5 + brew install ninja + wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-macosx.tar.gz + tar -xf premake-5.0.0-beta1-macosx.tar.gz + mkdir bin + cp premake5 bin/premake5 + sudo chmod a+x premake5 + sudo mv premake5 /usr/local/bin + - name: Build skia files + run: ./scripts/build.skia.sh -a ${{ matrix.arch }} + determine_version: name: Determine the next build version - if: github.event.pull_request.merged == true + needs: build-skia runs-on: ubuntu-latest outputs: version: ${{ steps.echo_version.outputs.version }} @@ -25,27 +71,37 @@ jobs: run: npm run release -- --ci --release-version | tail -n 1 > RELEASE_VERSION working-directory: ./.github/release env: - GITHUB_TOKEN: ${{ secrets.RIVE_REPO_PAT }} + GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} - id: echo_version run: echo "::set-output name=version::$(cat ./.github/release/RELEASE_VERSION)" build_framework: name: Create RiveRuntime.xcframework - if: github.event.pull_request.merged == true runs-on: macos-12 needs: [determine_version] outputs: checksum: ${{steps.get_checksum.outputs.checksum}} steps: - - name: Checkout - uses: actions/checkout@v2 - with: - token: ${{ secrets.RIVE_REPO_PAT }} - submodules: recursive - - name: Init submodule - run: git submodule update --init - - name: Configure Skia - run: sh ./scripts/configure.sh + - name: Checkout Code + uses: actions/checkout@v3 + with: + submodules: true + token: ${{ secrets.PAT_GITHUB }} + - name: Copy build files + run: ./scripts/copy.build.files.sh + - name: Installing pre-requisites + run: | + set -x + # Install some dependencies & premake5 + brew install ninja + wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-macosx.tar.gz + tar -xf premake-5.0.0-beta1-macosx.tar.gz + mkdir bin + cp premake5 bin/premake5 + sudo chmod a+x premake5 + sudo mv premake5 /usr/local/bin + - name: Build everything (using the cache, we should make an archive of course) + run: ./scripts/build.sh all - name: Update Marketing versions run: agvtool new-marketing-version ${{ needs.determine_version.outputs.version }} - name: Upload versionFiles @@ -88,12 +144,11 @@ jobs: do_release: name: Do the actual release - if: github.event.pull_request.merged == true runs-on: ubuntu-latest needs: [determine_version, build_framework] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install dependencies @@ -145,11 +200,24 @@ jobs: with: name: RiveRuntime.xcframework.zip path: archive/ - - name: Bump version number, update changelog, push and tag + - if : ${{ inputs.major == true }} + name: Major Release - Bump version number, update changelog, push and tag + run: npm run release -- major --ci + working-directory: ./.github/release + env: + GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} + - if : ${{inputs.major == false && inputs.minor == true}} + name: Minor release - Bump version number, update changelog, push and tag + run: npm run release -- minor --ci + working-directory: ./.github/release + env: + GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} + - if : ${{inputs.major == false && inputs.minor == false}} + name: Build release - Bump version number, update changelog, push and tag run: npm run release -- --ci working-directory: ./.github/release env: - GITHUB_TOKEN: ${{ secrets.RIVE_REPO_PAT }} + GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} publish_cocoapods: name: Publish framework to cocoapods diff --git a/.github/workflows/test_build_pod.yml b/.github/workflows/test_build_pod.yml deleted file mode 100644 index 31391781..00000000 --- a/.github/workflows/test_build_pod.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Build test pod - -on: workflow_dispatch - -jobs: - create_podspec_file: - name: Create RiveRuntime.podspec - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - 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: 0.0.1 - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: RiveRuntime.podspec - path: RiveRuntime.podspec - - build_framework: - name: Create RiveRuntime.xcframework - runs-on: macos-12 - 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/build_framework.sh -t iphoneos -c Release - - id: build_iphonesimulator - name: Build release iphonesimulator framework - run: sh ./scripts/build_framework.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/merge_framework.sh -c Release - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: RiveRuntime.xcframework - path: archive/RiveRuntime.xcframework - - - build_pod: - name: Update podspec repository - runs-on: macos-12 - timeout-minutes: 10 - needs: [create_podspec_file, build_framework] - 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 'hello@rive.app' - git config --local user.name ${{ github.actor }} - git add . - git commit -m "Update podspec repo tag:${{ env.RELEASE_VERSION }}" - git push - git tag v${{ env.RELEASE_VERSION }} - git push origin v${{ env.RELEASE_VERSION }} - env: - API_TOKEN_GITHUB: ${{ secrets.RIVE_REPO_PAT }} - RELEASE_VERSION: 0.0.1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f199306..142c8be3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,18 +2,74 @@ name: Run Rive tests on: push: + branches: + - main jobs: + build-skia: + strategy: + matrix: + arch: ["x86" , "x64", "arm", "arm64", "iossim_arm64"] + + runs-on: macos-12 + permissions: + id-token: write + contents: read + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: us-west-2 + role-to-assume: ${{ secrets.ACTIONS_ROLE }} + - name: Checkout Code + uses: actions/checkout@v3 + with: + submodules: true + token: ${{ secrets.PAT_GITHUB }} + + - name: Update Java + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '16' + + - name: Installing pre-requisites + run: | + set -x + # Install some dependencies & premake5 + brew install ninja + wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-macosx.tar.gz + tar -xf premake-5.0.0-beta1-macosx.tar.gz + mkdir bin + cp premake5 bin/premake5 + sudo chmod a+x premake5 + sudo mv premake5 /usr/local/bin + - name: Build skia files + run: ./scripts/build.skia.sh -a ${{ matrix.arch }} + run_tests: name: Run Rive tests + needs: build-skia runs-on: macos-12 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: - token: ${{ secrets.RIVE_REPO_PAT }} - submodules: recursive - - name: Get Skia Headers - run: sh ./scripts/configure.sh + token: ${{ secrets.PAT_GITHUB }} + submodules: true + - name: Installing pre-requisites + run: | + set -x + # Install some dependencies & premake5 + brew install ninja + wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta1/premake-5.0.0-beta1-macosx.tar.gz + tar -xf premake-5.0.0-beta1-macosx.tar.gz + mkdir bin + cp premake5 bin/premake5 + sudo chmod a+x premake5 + sudo mv premake5 /usr/local/bin + - name: Build everything (using the cache, we should make an archive of course) + run: ./scripts/build.sh ios_sim debug - name: Testing iOS app - run: sh ./scripts/test.sh + run: ./scripts/test.sh + \ No newline at end of file diff --git a/.rive_head b/.rive_head index fcf4cc5f..84cc7af1 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -94444dbd24884c250a3c00f19ece386ee5ac93e5 +90e1d4cf7e5ec3d3286d2234c2fd1f1125e10efa diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0584eb58..94e3ea7e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,22 +11,14 @@ Check out the repository, making sure to include the submodules. It is important `git clone --recurse-submodules git@github.com:rive-app/rive-ios.git` The package relies on skia, as well as rive-cpp in order to be built. To shorten the build cycle, we rely on compiled libraries for skia, rive & rive-skia-renderer. -The `./scripts/configure.sh` script will download or build appropriate libraries, be sure to run configure when making changes to our rive-cpp submodule. +The `./scripts/build.sh all` script will download or build appropriate libraries, be sure to run configure when making changes to our rive-cpp submodule. ### Uploading caches If you are contributing and you have access to Rives' aws environment, make you sure install `aws-cli` and configure it with your credentials. If you run into permission issues here `aws sts get-caller-identity` can help make sure that your local developer environment is setup to talk to AWS correctly. See https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html -Note: on Mac, I just did 'brew install awscli' - -Set the `RIVE_UPLOAD_IOS_ARCHIVE` env variable to `TRUE` - -`RIVE_UPLOAD_IOS_ARCHIVE=TRUE ./scripts/configure.sh` - -and it will upload caches when feasible. To force a rebuild, add `rebuild` as an argument... - -`RIVE_UPLOAD_IOS_ARCHIVE=TRUE ./scripts/configure.sh rebuild` +Note: on a Mac with brew, you can simply run 'brew install awscli' Note: the 'dependencies' directory is just a cache of what the configure.sh script downloads. It can be removed if you suspect is is out of date, and then just rerun the script (./scripts/configure.sh) diff --git a/RiveRuntime.xcodeproj/project.pbxproj b/RiveRuntime.xcodeproj/project.pbxproj index 242be20d..45dcefdc 100644 --- a/RiveRuntime.xcodeproj/project.pbxproj +++ b/RiveRuntime.xcodeproj/project.pbxproj @@ -625,7 +625,7 @@ dependencies/includes/skia/include/effects, dependencies/includes/skia/include/gpu, dependencies/includes/skia/include/config, - "dependencies/includes/rive-cpp/include", + dependencies/includes/rive/include, dependencies/includes/renderer/include, ); INFOPLIST_FILE = Source/Info.plist; @@ -686,7 +686,7 @@ dependencies/includes/skia/include/effects, dependencies/includes/skia/include/gpu, dependencies/includes/skia/include/config, - "dependencies/includes/rive-cpp/include", + dependencies/includes/rive/include, dependencies/includes/renderer/include, ); INFOPLIST_FILE = Source/Info.plist; @@ -733,7 +733,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - "HEADER_SEARCH_PATHS[arch=*]" = "submodules/rive-cpp/include"; + "HEADER_SEARCH_PATHS[arch=*]" = "dependencies/includes/rive/include"; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -754,7 +754,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; - "HEADER_SEARCH_PATHS[arch=*]" = "submodules/rive-cpp/include"; + "HEADER_SEARCH_PATHS[arch=*]" = "dependencies/includes/rive/include"; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/scripts/build.rive.sh b/scripts/build.rive.sh new file mode 100755 index 00000000..f799a1aa --- /dev/null +++ b/scripts/build.rive.sh @@ -0,0 +1,128 @@ +#!/bin/bash + +set -ex +# split in two so build.skia can be done by multiple workers. +# assumes all skia's have been built + +path=`readlink -f "${BASH_SOURCE:-$0}"` +DEV_SCRIPT_DIR=`dirname $path` + +if git remote -v | grep ios; +then + export RIVE_RUNTIME_DIR="$DEV_SCRIPT_DIR/../submodules/rive-cpp" +else + export RIVE_RUNTIME_DIR="$DEV_SCRIPT_DIR/../../runtime" +fi + +make_dependency_directories(){ + rm -fr $DEV_SCRIPT_DIR/../dependencies + + mkdir -p $DEV_SCRIPT_DIR/../dependencies + mkdir -p $DEV_SCRIPT_DIR/../dependencies/debug + mkdir -p $DEV_SCRIPT_DIR/../dependencies/release + mkdir -p $DEV_SCRIPT_DIR/../dependencies/includes + mkdir -p $DEV_SCRIPT_DIR/../dependencies/includes/skia + mkdir -p $DEV_SCRIPT_DIR/../dependencies/includes/renderer + mkdir -p $DEV_SCRIPT_DIR/../dependencies/includes/rive +} + +build_renderer() { + # NOTE: we do not currently use debug, so lets not build debug + pushd $RIVE_RUNTIME_DIR/skia/renderer + ./build.sh -p ios clean + ./build.sh -p ios $1 + popd + cp -r $RIVE_RUNTIME_DIR/build/ios/bin/$1/librive.a $DEV_SCRIPT_DIR/../dependencies/$1/librive.a + cp -r $RIVE_RUNTIME_DIR/skia/renderer/build/ios/bin/$1/librive_skia_renderer.a $DEV_SCRIPT_DIR/../dependencies/$1/librive_skia_renderer.a + + cp -r $RIVE_RUNTIME_DIR/skia/renderer/include $DEV_SCRIPT_DIR/../dependencies/includes/renderer + cp -r $RIVE_RUNTIME_DIR/include $DEV_SCRIPT_DIR/../dependencies/includes/rive +} + +build_renderer_sim() { + # NOTE: we do not currently use debug, so lets not build debug + pushd $RIVE_RUNTIME_DIR/skia/renderer + ./build.sh -p ios_sim clean + ./build.sh -p ios_sim $1 + popd + + cp -r $RIVE_RUNTIME_DIR/build/ios_sim/bin/$1/librive.a $DEV_SCRIPT_DIR/../dependencies/$1/librive_sim.a + cp -r $RIVE_RUNTIME_DIR/skia/renderer/build/ios_sim/bin/$1/librive_skia_renderer.a $DEV_SCRIPT_DIR/../dependencies/$1/librive_skia_renderer_sim.a + + cp -r $RIVE_RUNTIME_DIR/skia/renderer/include $DEV_SCRIPT_DIR/../dependencies/includes/renderer + cp -r $RIVE_RUNTIME_DIR/include $DEV_SCRIPT_DIR/../dependencies/includes/rive +} + +finalize_skia() { + # COMBINE SKIA + # make fat library, note that the ios64 library is already fat with arm64 and arm64e so we don't specify arch there. + + pwd + pushd $RIVE_RUNTIME_DIR/skia/dependencies/skia + xcrun -sdk iphoneos lipo -create -arch armv7 out/arm/libskia.a out/arm64/libskia.a -output out/libskia_ios.a + xcrun -sdk iphoneos lipo -create -arch x86_64 out/x64/libskia.a -arch i386 out/x86/libskia.a out/iossim_arm64/libskia.a -output out/libskia_ios_sim.a + popd + + # copy skia outputs from ld'in skia! + cp -r $RIVE_RUNTIME_DIR/skia/dependencies/skia/out/libskia_ios.a $DEV_SCRIPT_DIR/../dependencies + cp -r $RIVE_RUNTIME_DIR/skia/dependencies/skia/out/libskia_ios_sim.a $DEV_SCRIPT_DIR/../dependencies + # note we purposefully put the skia include folder into dependencies/includes/skia, skia includes headers from include/core/name.h + cp -r $RIVE_RUNTIME_DIR/skia/dependencies/skia/include $DEV_SCRIPT_DIR/../dependencies/includes/skia +} + + +usage () { + echo "USAGE: $0 " + exit 1 +} + +if (( $# < 1 )) +then + usage +fi + +case $1 in + all) + make_dependency_directories + finalize_skia + build_renderer debug + build_renderer release + build_renderer_sim debug + build_renderer_sim release + ;; + ios) + if (( $# < 2 )) + then + usage + fi + case $2 in + release | debug) + make_dependency_directories + finalize_skia + build_renderer $2 + ;; + *) + usage + ;; + esac + ;; + ios_sim) + if (( $# < 2 )) + then + usage + fi + case $2 in + release | debug) + make_dependency_directories + finalize_skia + build_renderer_sim $2 + ;; + *) + usage + ;; + esac + ;; + *) + usage + ;; +esac \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 00000000..d10ac7fc --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +path=`readlink -f "${BASH_SOURCE:-$0}"` +DEV_SCRIPT_DIR=`dirname $path` + +# hmm this'll be problematic, our caches overwrite each other, not a problem for the remotes +$DEV_SCRIPT_DIR/build.skia.sh -a x86 +$DEV_SCRIPT_DIR/build.skia.sh -a x86 +$DEV_SCRIPT_DIR/build.skia.sh -a x64 +$DEV_SCRIPT_DIR/build.skia.sh -a arm +$DEV_SCRIPT_DIR/build.skia.sh -a arm64 +$DEV_SCRIPT_DIR/build.skia.sh -a iossim_arm64 + +$DEV_SCRIPT_DIR/build.rive.sh $@ \ No newline at end of file diff --git a/scripts/build.skia.sh b/scripts/build.skia.sh new file mode 100755 index 00000000..b8b31c75 --- /dev/null +++ b/scripts/build.skia.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -ex + +ARCH_X86=x86 +ARCH_X64=x64 +ARCH_ARM=arm +ARCH_ARM64=arm64 +ARCH_SIM_ARM64=iossim_arm64 + +usage() { + printf "Usage: %s -a arch\n" "$0" + printf "\t-a Specify an architecture (i.e. '%s', '%s', '%s', '%s', '%s')\n" $ARCH_X86 $ARCH_X64 $ARCH_ARM $ARCH_ARM64 $ARCH_SIM_ARM64 + exit 1 # Exit script after printing help +} + +while getopts "a:cd" opt; do + case "$opt" in + a) ARCH_NAME="$OPTARG" ;; + \?) usage ;; # Print usage in case parameter is non-existent + esac +done + +if [ -z "$ARCH_NAME" ]; then + echo "No architecture specified" + usage +fi + +path=`readlink -f "${BASH_SOURCE:-$0}"` +DEV_SCRIPT_DIR=`dirname $path` + +export SKIA_REPO="https://github.com/rive-app/skia" +export SKIA_BRANCH="rive" +export COMPILE_TARGET="ios_$EXPECTED_NDK_VERSION_$ARCH_NAME" +export CACHE_NAME="rive_skia_ios" +export MAKE_SKIA_FILE="make_skia_ios.sh" +export SKIA_DIR_NAME="skia" +# we can have multiple at the same time... +export ARCHIVE_CONTENTS_NAME="archive_contents_$ARCH_NAME" + +if git remote -v | grep ios; +then + export RIVE_RUNTIME_DIR="$DEV_SCRIPT_DIR/../submodules/rive-cpp" +else + export RIVE_RUNTIME_DIR="$DEV_SCRIPT_DIR/../../runtime" +fi + +# Build skia +pushd "$RIVE_RUNTIME_DIR"/skia/dependencies +./make_skia_ios.sh $ARCH_NAME +popd \ No newline at end of file diff --git a/scripts/build_dependencies.sh b/scripts/build_dependencies.sh deleted file mode 100755 index 090af3bc..00000000 --- a/scripts/build_dependencies.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -set -e - -pushd submodules/rive-cpp -pushd skia/dependencies -./make_skia.sh -popd -pushd skia/renderer -./build.sh -p ios clean -./build.sh -p ios debug -./build.sh -p ios release -popd -popd - -rm -fr dependencies -mkdir dependencies -mkdir dependencies/debug -mkdir dependencies/release -mkdir dependencies/includes -mkdir dependencies/includes/skia -mkdir dependencies/includes/renderer -mkdir dependencies/includes/rive-cpp - -cp -r submodules/rive-cpp/build/ios/bin/debug/librive.a dependencies/debug/librive.a -cp -r submodules/rive-cpp/build/ios/bin/release/librive.a dependencies/release/librive.a -cp -r submodules/rive-cpp/build/ios_sim/bin/debug/librive.a dependencies/debug/librive_sim.a -cp -r submodules/rive-cpp/build/ios_sim/bin/release/librive.a dependencies/release/librive_sim.a - -cp -r submodules/rive-cpp/skia/renderer/build/ios/bin/debug/librive_skia_renderer.a dependencies/debug/librive_skia_renderer.a -cp -r submodules/rive-cpp/skia/renderer/build/ios/bin/release/librive_skia_renderer.a dependencies/release/librive_skia_renderer.a -cp -r submodules/rive-cpp/skia/renderer/build/ios_sim/bin/debug/librive_skia_renderer.a dependencies/debug/librive_skia_renderer_sim.a -cp -r submodules/rive-cpp/skia/renderer/build/ios_sim/bin/release/librive_skia_renderer.a dependencies/release/librive_skia_renderer_sim.a - -cp -r submodules/rive-cpp/skia/dependencies/skia_rive_optimized/out/libskia_ios.a dependencies -cp -r submodules/rive-cpp/skia/dependencies/skia_rive_optimized/out/libskia_ios_sim.a dependencies - -# note we purposefully put the skia include folder into dependencies/includes/skia, skia includes headers from include/core/name.h -cp -r submodules/rive-cpp/skia/dependencies/skia_rive_optimized/include dependencies/includes/skia -cp -r submodules/rive-cpp/skia/renderer/include dependencies/includes/renderer -cp -r submodules/rive-cpp/include dependencies/includes/rive-cpp \ No newline at end of file diff --git a/scripts/configure.sh b/scripts/configure.sh deleted file mode 100755 index f52d645c..00000000 --- a/scripts/configure.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -set -e - -# https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommitted-changes -require_clean_work_tree () { - # Update the index - git update-index -q --ignore-submodules --refresh - err=0 - - # Disallow unstaged changes in the working tree - if ! git diff-files --quiet --ignore-submodules -- - then - echo >&2 "cannot $1: you have unstaged changes." - git diff-files --name-status -r --ignore-submodules -- >&2 - err=1 - fi - - # Disallow uncommitted changes in the index - if ! git diff-index --cached --quiet HEAD --ignore-submodules -- - then - echo >&2 "cannot $1: your index contains uncommitted changes." - git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2 - err=1 - fi - - if [ $err = 1 ] - then - echo >&2 "Please commit or stash them." - echo "FALSE" - else - echo "TRUE" - fi - -} - -# get rive-cpp commit hash, as key for pre built archives. -pushd submodules/rive-cpp -RIVE_CPP_CLEAN="$(require_clean_work_tree "get dependencies for $COMMIT_HASH")" -COMMIT_HASH=$(git rev-parse HEAD) -popd - -COMMIT_HASH_FILE=dependencies/rive-cpp-commit-hash -CACHED_COMMIT_HASH=$(cat $COMMIT_HASH_FILE) || true -TAR_FILE_NAME="i386_x86_64_arm64_armv7.tar.gz" -KEY="$COMMIT_HASH/$TAR_FILE_NAME" -ARCHIVE_URL="https://cdn.2dimensions.com/archives/$KEY" - -mkdir -p dependencies -mkdir -p cache - -build() { - ./scripts/build_dependencies.sh -} - -cached_build() { - echo "Running cached build, checking $ARCHIVE_URL" - if curl --output /dev/null --head --silent --fail $ARCHIVE_URL && [ "$1" != "rebuild" ] - then - echo "$ARCHIVE_URL exists, downloading..." - curl --output cache/$TAR_FILE_NAME $ARCHIVE_URL - rm -rf dependencies/* - tar -xf cache/$TAR_FILE_NAME -C dependencies/ - else - echo "$ARCHIVE_URL does not exist, building locally..." - - build - - echo $COMMIT_HASH > $COMMIT_HASH_FILE - - # cd into dependencies and add everything to the archive cache/i386_x86_64_arm64_armv7.tar.gz - tar -C dependencies -cf cache/$TAR_FILE_NAME . - - # if we're configured to upload the archive back into our cache, lets do it! - if [ "$RIVE_UPLOAD_IOS_ARCHIVE" == "TRUE" ] - then - echo "Configured to upload caches, uploading!" - aws s3 cp cache/$TAR_FILE_NAME s3://2d-public/archives/$KEY - fi - fi -} - -update_dependencies () { - if [ "$RIVE_CPP_CLEAN" == "TRUE" ] - then - cached_build $1 - else - echo "Rive-cpp has changes, cannot use cached builds" - build - fi -} - -check_dependencies () { - if [ "$COMMIT_HASH" == "$CACHED_COMMIT_HASH" ] && [ "$RIVE_CPP_CLEAN" == "TRUE" ] && [ "$1" != "rebuild" ] - then - echo "Cache is up to date & rive_cpp is clean. no need to do anything" - else - update_dependencies $1 - fi -} - -check_dependencies $1 - - diff --git a/submodules/rive-cpp b/submodules/rive-cpp index 57cd7bc6..f7efb5ff 160000 --- a/submodules/rive-cpp +++ b/submodules/rive-cpp @@ -1 +1 @@ -Subproject commit 57cd7bc634be0b40a147d3a1ab748b3939ad9ce0 +Subproject commit f7efb5ffc93682f730e7ae587f276121641be477