Skip to content

Commit

Permalink
💚
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon committed Aug 26, 2024
1 parent 568b347 commit 36708f9
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 360 deletions.
5 changes: 3 additions & 2 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,14 @@
"e2e": "E2E=true yarn test -i e2e",
"build": "bob build && merge-dirs lib/typescript/src lib/commonjs && merge-dirs lib/typescript/src lib/module",
"release": "semantic-release",

"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",
"clean-skia": "yarn rimraf ./libs && yarn rimraf ../externals/skia/out",
"copy-skia-include-headers": "yarn rimraf ./cpp/skia/include/ && cp -a ../externals/skia/include/. ./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-skia": "yarn build-skia && yarn copy-skia-headers",
"build-skia": "yarn build-skia-ios && yarn build-skia-android && yarn copy-skia-headers",
"clang-format": "yarn clang-format-ios && yarn clang-format-android && yarn clang-format-common",
"clang-format-ios": "find ios/ -iname *.h -o -iname *.mm -o -iname *.cpp | xargs clang-format -i",
"clang-format-android": "find android/cpp/ -iname *.h -o -iname *.m -o -iname *.cpp | xargs clang-format -i",
Expand Down Expand Up @@ -122,7 +121,9 @@
"react-native": "0.72.6",
"react-native-builder-bob": "0.18.2",
"react-native-reanimated": "3.6.2",
"rimraf": "3.0.2",
"ts-jest": "29.1.1",
"ts-node": "^10.9.2",
"typescript": "5.1.6",
"ws": "8.18.0"
},
Expand Down
2 changes: 1 addition & 1 deletion package/scripts/build-skia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (process.argv.length !== 4) {
}

const currentDir = process.cwd();
const SkiaDir = "./externals/skia";
const SkiaDir = "../externals/skia";
const SelectedPlatform = (process.argv[2] as PlatformName) ?? "";
const SelectedTarget = process.argv[3] ?? "";

Expand Down
38 changes: 19 additions & 19 deletions package/scripts/copy-skia-module-headers.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { executeCmdSync } from "./utils";

const copyModule = (module: string) => [
`mkdir -p ./package/cpp/skia/modules/${module}/include`,
`cp -a ./externals/skia/modules/${module}/include/. ./package/cpp/skia/modules/${module}/include`,
`mkdir -p ./cpp/skia/modules/${module}/include`,
`cp -a ../externals/skia/modules/${module}/include/. ./cpp/skia/modules/${module}/include`,
];

[
"yarn rimraf ./package/cpp/skia/modules/",
"yarn rimraf ./cpp/skia/modules/",
...copyModule("svg"),
...copyModule("skresources"),
...copyModule("skparagraph"),
`cp -a ./externals/skia/modules/skcms/. ./package/cpp/skia/modules/skcms`,
`mkdir -p ./package/cpp/skia/src/`,
`mkdir -p ./package/cpp/skia/src/core/`,
`cp -a ./externals/skia/src/core/SkPathEnums.h ./package/cpp/skia/src/core/.`,
`cp -a ./externals/skia/src/core/SkPathPriv.h ./package/cpp/skia/src/core/.`,
`cp -a ./externals/skia/src/core/SkChecksum.h ./package/cpp/skia/src/core/.`,
`cp -a ./externals/skia/src/core/SkTHash.h ./package/cpp/skia/src/core/.`,
`cp -a ../externals/skia/modules/skcms/. ./cpp/skia/modules/skcms`,
`mkdir -p ./cpp/skia/src/`,
`mkdir -p ./cpp/skia/src/core/`,
`cp -a ../externals/skia/src/core/SkPathEnums.h ./cpp/skia/src/core/.`,
`cp -a ../externals/skia/src/core/SkPathPriv.h ./cpp/skia/src/core/.`,
`cp -a ../externals/skia/src/core/SkChecksum.h ./cpp/skia/src/core/.`,
`cp -a ../externals/skia/src/core/SkTHash.h ./cpp/skia/src/core/.`,

"mkdir -p ./package/cpp/skia/src/gpu/ganesh/gl",
`cp -a ./externals/skia/src/gpu/ganesh/gl/GrGLDefines.h ./package/cpp/skia/src/gpu/ganesh/gl/.`,
"mkdir -p ./cpp/skia/src/gpu/ganesh/gl",
`cp -a ../externals/skia/src/gpu/ganesh/gl/GrGLDefines.h ./cpp/skia/src/gpu/ganesh/gl/.`,

`cp -a ./externals/skia/src/core/SkLRUCache.h ./package/cpp/skia/src/core/.`,
`cp -a ../externals/skia/src/core/SkLRUCache.h ./cpp/skia/src/core/.`,

"mkdir -p ./package/cpp/skia/src/base",
"cp -a ./externals/skia/src/base/SkTInternalLList.h ./package/cpp/skia/src/base/.",
"cp -a ./externals/skia/src/base/SkUTF.h ./package/cpp/skia/src/base/.",
"mkdir -p ./cpp/skia/src/base",
"cp -a ../externals/skia/src/base/SkTInternalLList.h ./cpp/skia/src/base/.",
"cp -a ../externals/skia/src/base/SkUTF.h ./cpp/skia/src/base/.",

"mkdir -p ./package/cpp/skia/modules/skunicode/include/",
"cp -a externals/skia/modules/skunicode/include/SkUnicode.h ./package/cpp/skia/modules/skunicode/include/.",
"mkdir -p ./cpp/skia/modules/skunicode/include/",
"cp -a ../externals/skia/modules/skunicode/include/SkUnicode.h ./cpp/skia/modules/skunicode/include/.",

`rm ./package/cpp/skia/include/gpu/GrBackendDrawableInfo.h`, // Remove since there are now (Skia M123) two headers with the same name
`rm ./cpp/skia/include/gpu/GrBackendDrawableInfo.h`, // Remove since there are now (Skia M123) two headers with the same name

].map((cmd) => {
console.log(cmd);
Expand Down
2 changes: 1 addition & 1 deletion package/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const getDistFolder = () => "./dist";
export const ensureFolderExists = (dirPath: string) => {
try {
console.log(`Ensuring that ${dirPath} exists...`);
return fs.mkdirSync(dirPath, { recursive: true });
fs.mkdirSync(dirPath, { recursive: true });
} catch (err) {
// @ts-ignore
if (err.code !== "EEXIST") throw err;
Expand Down
100 changes: 98 additions & 2 deletions package/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,13 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==
dependencies:
"@jridgewell/trace-mapping" "0.3.9"

"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
Expand Down Expand Up @@ -1497,6 +1504,11 @@
"@jridgewell/sourcemap-codec" "^1.4.10"
"@jridgewell/trace-mapping" "^0.3.9"

"@jridgewell/resolve-uri@^3.0.3":
version "3.1.2"
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6"
integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==

"@jridgewell/resolve-uri@^3.1.0":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721"
Expand All @@ -1520,6 +1532,14 @@
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==

"@jridgewell/[email protected]":
version "0.3.9"
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9"
integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==
dependencies:
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"

"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9":
version "0.3.22"
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c"
Expand Down Expand Up @@ -1826,6 +1846,26 @@
dependencies:
"@sinonjs/commons" "^3.0.0"

"@tsconfig/node10@^1.0.7":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2"
integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==

"@tsconfig/node12@^1.0.7":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d"
integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==

"@tsconfig/node14@^1.0.0":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1"
integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==

"@tsconfig/node16@^1.0.2":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==

"@types/babel__core@^7.1.14":
version "7.20.5"
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017"
Expand Down Expand Up @@ -2218,6 +2258,18 @@ acorn-jsx@^5.3.2:
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==

acorn-walk@^8.1.1:
version "8.3.3"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.3.tgz#9caeac29eefaa0c41e3d4c65137de4d6f34df43e"
integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==
dependencies:
acorn "^8.11.0"

acorn@^8.11.0, acorn@^8.4.1:
version "8.12.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248"
integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==

acorn@^8.8.2, acorn@^8.9.0:
version "8.11.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a"
Expand Down Expand Up @@ -2319,6 +2371,11 @@ appdirsjs@^1.2.4:
resolved "https://registry.yarnpkg.com/appdirsjs/-/appdirsjs-1.2.7.tgz#50b4b7948a26ba6090d4aede2ae2dc2b051be3b3"
integrity sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw==

arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==

argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
Expand Down Expand Up @@ -2981,6 +3038,11 @@ create-jest@^29.7.0:
jest-util "^29.7.0"
prompts "^2.0.1"

create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==

cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
Expand Down Expand Up @@ -3119,6 +3181,11 @@ diff-sequences@^29.6.3:
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921"
integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==

diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==

dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
Expand Down Expand Up @@ -5205,7 +5272,7 @@ make-dir@^4.0.0:
dependencies:
semver "^7.5.3"

[email protected]:
[email protected], make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
Expand Down Expand Up @@ -6392,7 +6459,7 @@ reusify@^1.0.4:
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==

rimraf@^3.0.2:
rimraf@3.0.2, rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
Expand Down Expand Up @@ -6935,6 +7002,25 @@ [email protected]:
semver "^7.5.3"
yargs-parser "^21.0.1"

ts-node@^10.9.2:
version "10.9.2"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f"
integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==
dependencies:
"@cspotcode/source-map-support" "^0.8.0"
"@tsconfig/node10" "^1.0.7"
"@tsconfig/node12" "^1.0.7"
"@tsconfig/node14" "^1.0.0"
"@tsconfig/node16" "^1.0.2"
acorn "^8.4.1"
acorn-walk "^8.1.1"
arg "^4.1.0"
create-require "^1.1.0"
diff "^4.0.1"
make-error "^1.1.1"
v8-compile-cache-lib "^3.0.1"
yn "3.1.1"

tsconfig-paths@^3.14.1:
version "3.15.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4"
Expand Down Expand Up @@ -7141,6 +7227,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==

v8-compile-cache-lib@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"
integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==

v8-compile-cache@^2.0.3:
version "2.4.0"
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128"
Expand Down Expand Up @@ -7412,6 +7503,11 @@ yargs@^17.3.1, yargs@^17.6.2:
y18n "^5.0.5"
yargs-parser "^21.1.1"

[email protected]:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==

yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
Expand Down
Loading

0 comments on commit 36708f9

Please sign in to comment.