Skip to content

Commit

Permalink
Make root package private (#2594)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Aug 28, 2024
1 parent 00ea5da commit a811666
Show file tree
Hide file tree
Showing 23 changed files with 264 additions and 495 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/android-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- uses: actions/setup-node@v3
with:
cache: 'yarn'
cache-dependency-path: package/yarn.lock

- name: Set up JDK 11
uses: actions/setup-java@v1
Expand All @@ -40,30 +41,29 @@ jobs:
- name: Set ANDROID_NDK
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV

- name: Install root node dependencies
- name: Install Package
working-directory: package
run: yarn

- name: Download Skia Binary Artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: "build-skia.yml"
repo: shopify/react-native-skia
path: artifacts
path: package/artifacts
branch: main

- name: Copy Artifacts to libs folder
working-directory: package
run: yarn workflow-copy-libs

- name: Copy Skia Headers
working-directory: package
run: yarn copy-skia-headers

- name: SDKs - accept licenses
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses

- name: Install Package
working-directory: package
run: yarn install

# Install node dependencies in specified directories using matrix
- name: Install app node dependencies
working-directory: ${{ matrix.directory }}
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
cache-dependency-path: package/yarn.lock
cache: 'yarn'

- name: Set up JDK 11
Expand All @@ -41,30 +42,29 @@ jobs:
- name: Set ANDROID_NDK
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV

- name: Install root node dependencies
run: yarn
- name: Install Package
working-directory: package
run: yarn install

- name: Download Skia Binary Artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: "build-skia.yml"
repo: shopify/react-native-skia
path: artifacts
path: package/artifacts
branch: main

- name: Copy Artifacts to libs folder
working-directory: package
run: yarn workflow-copy-libs

- name: Copy Skia Headers
working-directory: package
run: yarn copy-skia-headers

- name: SDKs - accept licenses
run: y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses

- name: Install Package
working-directory: package
run: yarn install

- name: Install example app node dependencies
working-directory: ${{ matrix.working-directory }}
run: yarn
Expand Down Expand Up @@ -114,9 +114,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
cache-dependency-path: package/yarn.lock
cache: 'yarn'

- name: Install root dependencies
working-directory: package
run: yarn bootstrap

- name: Restore APK
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/build-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache-dependency-path: package/yarn.lock
cache: 'yarn'
cache-dependency-path: 'package/yarn.lock'

- name: Install root node dependencies
run: yarn

- name: Install package dependencies
working-directory: package
Expand All @@ -32,13 +29,15 @@ jobs:
uses: dawidd6/action-download-artifact@v2
with:
workflow: "build-skia.yml"
path: artifacts
path: package/artifacts
branch: main

- name: Copy Artifacts to libs folder
working-directory: package
run: yarn workflow-copy-libs

- name: Copy Skia Headers
working-directory: package
run: yarn copy-skia-headers

- name: Build NPM Package
Expand Down
76 changes: 39 additions & 37 deletions .github/workflows/build-skia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
runs-on: macos-latest
env:
WORKING_DIRECTORY: ./
WORKING_DIRECTORY: ./package
steps:
- name: checkout
uses: actions/checkout@v2
Expand All @@ -23,13 +23,15 @@ jobs:
- name: Setup Nodejs and npm
uses: actions/setup-node@v3
with:
cache-dependency-path: package/yarn.lock
cache: yarn

- name: Install root node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn

- name: Build Skia
working-directory: ${{ env.WORKING_DIRECTORY }}/
working-directory: ${{ env.WORKING_DIRECTORY }}
env:
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
run: yarn build-skia
Expand All @@ -40,66 +42,66 @@ jobs:
with:
name: skia-android-arm
path: |
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm/libskia.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm/libskshaper.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm/libsvg.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm/libskottie.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm/libsksg.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm/libskparagraph.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm/libskunicode.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm/libskia.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm/libskshaper.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm/libsvg.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm/libskottie.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm/libsksg.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm/libskparagraph.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm/libskunicode.a
- name: Upload artifacts - Android arm64
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v2
with:
name: skia-android-arm-64
path: |
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm64/libskia.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm64/libskshaper.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm64/libsvg.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm64/libskottie.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm64/libsksg.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm64/libskparagraph.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/arm64/libskunicode.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm64/libskia.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm64/libskshaper.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm64/libsvg.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm64/libskottie.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm64/libsksg.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm64/libskparagraph.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/arm64/libskunicode.a
- name: Upload artifacts - Android x86
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v2
with:
name: skia-android-arm-x86
path: |
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x86/libskia.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x86/libskshaper.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x86/libsvg.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x86/libskottie.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x86/libsksg.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x86/libskparagraph.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x86/libskunicode.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x86/libskia.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x86/libskshaper.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x86/libsvg.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x86/libskottie.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x86/libsksg.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x86/libskparagraph.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x86/libskunicode.a
- name: Upload artifacts - Android x64
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v2
with:
name: skia-android-arm-x64
path: |
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x64/libskia.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x64/libskshaper.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x64/libsvg.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x64/libskottie.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x64/libsksg.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x64/libskparagraph.a
${{ env.WORKING_DIRECTORY }}/externals/skia/out/android/x64/libskunicode.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x64/libskia.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x64/libskshaper.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x64/libsvg.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x64/libskottie.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x64/libsksg.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x64/libskparagraph.a
${{ env.WORKING_DIRECTORY }}/../externals/skia/out/android/x64/libskunicode.a
- name: Upload artifacts - iOS xcframeworks
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v2
with:
name: skia-ios-xcframeworks
path: |
${{ env.WORKING_DIRECTORY }}/package/libs/ios/libskia.xcframework
${{ env.WORKING_DIRECTORY }}/package/libs/ios/libskshaper.xcframework
${{ env.WORKING_DIRECTORY }}/package/libs/ios/libsvg.xcframework
${{ env.WORKING_DIRECTORY }}/package/libs/ios/libskottie.xcframework
${{ env.WORKING_DIRECTORY }}/package/libs/ios/libsksg.xcframework
${{ env.WORKING_DIRECTORY }}/package/libs/ios/libskparagraph.xcframework
${{ env.WORKING_DIRECTORY }}/package/libs/ios/libskunicode.xcframework
${{ env.WORKING_DIRECTORY }}/../package/libs/ios/libskia.xcframework
${{ env.WORKING_DIRECTORY }}/../package/libs/ios/libskshaper.xcframework
${{ env.WORKING_DIRECTORY }}/../package/libs/ios/libsvg.xcframework
${{ env.WORKING_DIRECTORY }}/../package/libs/ios/libskottie.xcframework
${{ env.WORKING_DIRECTORY }}/../package/libs/ios/libsksg.xcframework
${{ env.WORKING_DIRECTORY }}/../package/libs/ios/libskparagraph.xcframework
${{ env.WORKING_DIRECTORY }}/../package/libs/ios/libskunicode.xcframework
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
cache: yarn

- name: Install dependencies
working-directory: package
run: yarn bootstrap

- name: Build Documentation
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ios-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@ jobs:

- uses: actions/setup-node@v3
with:
cache-dependency-path: package/yarn.lock
cache: 'yarn'

- name: Install root node dependencies
run: yarn
- name: Install Package
working-directory: package
run: yarn install --frozen-lockfile

- name: Download Skia Binary Artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: "build-skia.yml"
repo: shopify/react-native-skia
path: artifacts
path: package/artifacts
branch: main

- name: Copy Artifacts to libs folder
working-directory: package
run: yarn workflow-copy-libs

- name: Copy Skia Headers
run: yarn copy-skia-headers

- name: Install Package
working-directory: package
run: yarn install --frozen-lockfile
run: yarn copy-skia-headers

- name: Install app node_modules
working-directory: ${{ matrix.working-directory }}
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,45 @@ jobs:
run: sudo apt-get install -y clang-format

- name: Run clang-format-ios
working-directory: package
run: yarn clang-format-ios --dry-run --Werror

- name: Run clang-format-android
working-directory: package
run: yarn clang-format-android --dry-run --Werror

- name: Run clang-format-common
working-directory: package
run: yarn clang-format-common --dry-run --Werror

- uses: actions/setup-node@v3
with:
cache-dependency-path: package/yarn.lock
cache: 'yarn'

- name: Install root node dependencies
working-directory: package
run: yarn install --frozen-lockfile

- name: Typecheck the build scripts
working-directory: package
run: yarn tsc

- name: Install Package
run: cd package; yarn install --frozen-lockfile
working-directory: package
run: yarn install --frozen-lockfile

- name: Lint Package
run: cd package; yarn lint;
working-directory: package
run: yarn lint;

- name: TypeScript Package
run: cd package; yarn tsc;
working-directory: package
run: yarn tsc;

- name: Run Package Unit tests
run: cd package; yarn test;
working-directory: package
run: yarn test;

- name: Install Example/Fabric Example
run: cd ${{ matrix.directory }}; yarn install --frozen-lockfile
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ And then the _SDK Location_ section. It will show you the NDK path, or the optio

### Building

- Go to the package folder `cd package`
- Install dependencies `yarn bootstrap`
- Build the Skia libraries with `yarn build-skia` (this can take a while)
- Copy Skia headers `yarn copy-skia-headers`
Expand Down
31 changes: 1 addition & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
{
"name": "react-native-skia-dev-tools",
"version": "1.0.0",
"description": "## Getting started",
"main": "index.js",
"directories": {
"example": "example"
},
"devDependencies": {
"@types/node": "16.11.7",
"clang-format": "1.6.0",
"rimraf": "3.0.2",
"ts-node": "10.4.0",
"typescript": "5.3.3"
},
"scripts": {
"build-skia-ios-framework": "ts-node ./scripts/build-skia-ios-framework.ts",
"build-skia-ios": "ts-node ./scripts/build-skia-ios.ts && yarn build-skia-ios-framework",
"build-skia-android": "ts-node ./scripts/build-skia-android.ts",
"build-skia": "yarn build-skia-ios && yarn build-skia-android",
"clean-skia": "yarn rimraf ./package/libs && yarn rimraf ./externals/skia/out",
"copy-skia-include-headers": "yarn rimraf ./package/cpp/skia/include/ && cp -a ./externals/skia/include/. ./package/cpp/skia/include",
"copy-skia-module-headers": "ts-node ./scripts/copy-skia-module-headers.ts",
"copy-skia-headers": "yarn copy-skia-include-headers && yarn copy-skia-module-headers",
"build": "yarn build-skia && yarn copy-skia-headers",
"clang-format": "yarn clang-format-ios && yarn clang-format-android && yarn clang-format-common",
"clang-format-ios": "find package/ios/ -iname *.h -o -iname *.mm -o -iname *.cpp | xargs clang-format -i",
"clang-format-android": "find package/android/cpp/ -iname *.h -o -iname *.m -o -iname *.cpp | xargs clang-format -i",
"clang-format-common": "find package/cpp/ -iname *.h -o -iname *.m -o -iname *.cpp | xargs clang-format -i",
"workflow-copy-libs": "yarn ts-node ./scripts/workflow-copy-libs.ts",
"bootstrap": "yarn && cd ./package && yarn && cd .. && cd ./example && yarn && cd .. && cd ./fabricexample && yarn && cd ..",
"cpplint": "cpplint --linelength=230 --filter=-legal/copyright,-whitespace/indent,-whitespace/comments,-whitespace/ending_newline,-build/include_order,-runtime/references,-readability/todo,-whitespace/blank_line,-whitespace/todo,-runtime/int,-build/c++11,-whitespace/parens --exclude=package/cpp/skia --exclude=package/ios --exclude=package/android/build --exclude=package/node_modules --recursive package"
},
"private": true,
"license": "MIT",
"licenseFilename": "LICENSE.md",
"readmeFilename": "README.md",
Expand Down
Loading

0 comments on commit a811666

Please sign in to comment.