From f4db230562b2b8d699c0cfe02086b96eb67ce8a2 Mon Sep 17 00:00:00 2001 From: William Candillon Date: Tue, 1 Oct 2024 15:09:45 +0200 Subject: [PATCH] =?UTF-8?q?fix(=F0=9F=92=9A):=20add=20missing=20xcframewor?= =?UTF-8?q?ks=20files=20and=20remove=20duplicated=20headers=20(#2671)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- apps/paper/ios/Podfile.lock | 2 +- .../rnskia-android/GrAHardwareBufferUtils.cpp | 6 +-- .../rnskia-android/GrAHardwareBufferUtils.h | 4 +- .../cpp/rnskia-android/SkiaOpenGLHelper.h | 4 +- .../rnskia-android/SkiaOpenGLSurfaceFactory.h | 6 +-- packages/skia/cpp/api/JsiSkSurface.h | 2 +- .../ios/RNSkia-iOS/RNSkMetalCanvasProvider.h | 2 +- .../ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm | 4 +- .../ios/RNSkia-iOS/SkiaCVPixelBufferUtils.h | 4 +- .../ios/RNSkia-iOS/SkiaCVPixelBufferUtils.mm | 2 +- .../ios/RNSkia-iOS/SkiaMetalSurfaceFactory.h | 2 +- .../ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm | 4 +- packages/skia/package.json | 8 +--- packages/skia/react-native-skia.podspec | 9 ++-- .../skia/scripts/copy-skia-module-headers.ts | 24 ++++++++++- turbo.json | 41 ++----------------- 17 files changed, 54 insertions(+), 72 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 727c795230..8e92fe73de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,7 +232,7 @@ jobs: env: JAVA_OPTS: "-XX:MaxHeapSize=6g" run: | - yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force --concurrency 1 + yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --concurrency 1 - name: Cache apk if: env.turbo_cache_hit != 1 diff --git a/apps/paper/ios/Podfile.lock b/apps/paper/ios/Podfile.lock index 79cf619a57..98c1b0091b 100644 --- a/apps/paper/ios/Podfile.lock +++ b/apps/paper/ios/Podfile.lock @@ -1935,7 +1935,7 @@ SPEC CHECKSUMS: React-Mapbuffer: 1c08607305558666fd16678b85ef135e455d5c96 React-microtasksnativemodule: 87b8de96f937faefece8afd2cb3a518321b2ef99 react-native-safe-area-context: ab8f4a3d8180913bd78ae75dd599c94cce3d5e9a - react-native-skia: b1f33ae82bb728aee1d1602a6adfaee52af43f61 + react-native-skia: 89e0ec26e70ca4f34a7a1f7425bc955baf77c566 react-native-slider: 97ce0bd921f40de79cead9754546d5e4e7ba44f8 react-native-wgpu: fb9d60b0f4c63a03fb60bd986d758aeffca6ee13 React-nativeconfig: 57781b79e11d5af7573e6f77cbf1143b71802a6d diff --git a/packages/skia/android/cpp/rnskia-android/GrAHardwareBufferUtils.cpp b/packages/skia/android/cpp/rnskia-android/GrAHardwareBufferUtils.cpp index f1cb0e0221..8f2d7c998d 100644 --- a/packages/skia/android/cpp/rnskia-android/GrAHardwareBufferUtils.cpp +++ b/packages/skia/android/cpp/rnskia-android/GrAHardwareBufferUtils.cpp @@ -11,10 +11,10 @@ #define GL_GLEXT_PROTOTYPES #define EGL_EGLEXT_PROTOTYPES -#include "include/gpu/GrBackendSurface.h" -#include "include/gpu/GrDirectContext.h" +#include "include/gpu/ganesh/GrBackendSurface.h" +#include "include/gpu/ganesh/GrDirectContext.h" #include "include/gpu/ganesh/gl/GrGLBackendSurface.h" -#include "include/gpu/gl/GrGLTypes.h" +#include "include/gpu/ganesh/gl/GrGLTypes.h" #include "src/gpu/ganesh/gl/GrGLDefines.h" // #include "src/gpu/ganesh/GrDirectContextPriv.h" // #include "src/gpu/ganesh/gl/GrGLUtil.h" diff --git a/packages/skia/android/cpp/rnskia-android/GrAHardwareBufferUtils.h b/packages/skia/android/cpp/rnskia-android/GrAHardwareBufferUtils.h index d084ef6129..7fe1a6642f 100644 --- a/packages/skia/android/cpp/rnskia-android/GrAHardwareBufferUtils.h +++ b/packages/skia/android/cpp/rnskia-android/GrAHardwareBufferUtils.h @@ -6,8 +6,8 @@ #if __ANDROID_API__ >= 26 -#include "include/gpu/GrBackendSurface.h" -#include "include/gpu/GrTypes.h" +#include "include/gpu/ganesh/GrBackendSurface.h" +#include "include/gpu/ganesh/GrTypes.h" class GrDirectContext; diff --git a/packages/skia/android/cpp/rnskia-android/SkiaOpenGLHelper.h b/packages/skia/android/cpp/rnskia-android/SkiaOpenGLHelper.h index 49672ac125..d68119e4ea 100644 --- a/packages/skia/android/cpp/rnskia-android/SkiaOpenGLHelper.h +++ b/packages/skia/android/cpp/rnskia-android/SkiaOpenGLHelper.h @@ -15,9 +15,9 @@ #include "include/core/SkCanvas.h" #include "include/core/SkColorSpace.h" #include "include/core/SkSurface.h" -#include "include/gpu/GrDirectContext.h" +#include "include/gpu/ganesh/GrDirectContext.h" #include "include/gpu/ganesh/gl/GrGLDirectContext.h" -#include "include/gpu/gl/GrGLInterface.h" +#include "include/gpu/ganesh/gl/GrGLInterface.h" #pragma clang diagnostic pop diff --git a/packages/skia/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h b/packages/skia/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h index 691cfb44ca..119207b796 100644 --- a/packages/skia/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +++ b/packages/skia/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h @@ -22,10 +22,10 @@ #include "include/core/SkCanvas.h" #include "include/core/SkColorSpace.h" #include "include/core/SkSurface.h" -#include "include/gpu/GrBackendSurface.h" -#include "include/gpu/GrDirectContext.h" +#include "include/gpu/ganesh/GrBackendSurface.h" +#include "include/gpu/ganesh/GrDirectContext.h" #include "include/gpu/ganesh/SkSurfaceGanesh.h" -#include "include/gpu/gl/GrGLInterface.h" +#include "include/gpu/ganesh/gl/GrGLInterface.h" #pragma clang diagnostic pop diff --git a/packages/skia/cpp/api/JsiSkSurface.h b/packages/skia/cpp/api/JsiSkSurface.h index ff951e2708..39b23866c4 100644 --- a/packages/skia/cpp/api/JsiSkSurface.h +++ b/packages/skia/cpp/api/JsiSkSurface.h @@ -14,7 +14,7 @@ #pragma clang diagnostic ignored "-Wdocumentation" #include "include/core/SkSurface.h" -#include "include/gpu/GrDirectContext.h" +#include "include/gpu/ganesh/GrDirectContext.h" #pragma clang diagnostic pop diff --git a/packages/skia/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h b/packages/skia/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h index 193a2736e8..3bc5fa1e4c 100644 --- a/packages/skia/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +++ b/packages/skia/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h @@ -9,7 +9,7 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdocumentation" -#import +#import #pragma clang diagnostic pop diff --git a/packages/skia/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm b/packages/skia/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm index 0c73eeee54..05a5a477eb 100644 --- a/packages/skia/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +++ b/packages/skia/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm @@ -9,8 +9,8 @@ #import "include/core/SkColorSpace.h" #import "include/core/SkSurface.h" -#import -#import +#import +#import #import #pragma clang diagnostic pop diff --git a/packages/skia/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.h b/packages/skia/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.h index e274f83bde..1daa5bf2e0 100644 --- a/packages/skia/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.h +++ b/packages/skia/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.h @@ -17,8 +17,8 @@ #pragma clang diagnostic ignored "-Wdocumentation" #import "include/core/SkColorSpace.h" #import "include/core/SkImage.h" -#import "include/gpu/GrBackendSurface.h" -#import "include/gpu/GrYUVABackendTextures.h" +#import "include/gpu/ganesh/GrBackendSurface.h" +#import "include/gpu/ganesh/GrYUVABackendTextures.h" #pragma clang diagnostic pop /** diff --git a/packages/skia/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.mm b/packages/skia/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.mm index b1108c898e..6e2b6fa064 100644 --- a/packages/skia/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.mm +++ b/packages/skia/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.mm @@ -11,7 +11,7 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdocumentation" #import "include/core/SkColorSpace.h" -#import +#import #import #import #import diff --git a/packages/skia/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.h b/packages/skia/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.h index 6e1e695349..a7099fb083 100644 --- a/packages/skia/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.h +++ b/packages/skia/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.h @@ -11,7 +11,7 @@ #import "include/core/SkCanvas.h" #import #import -#import +#import #pragma clang diagnostic pop diff --git a/packages/skia/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm b/packages/skia/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm index 0ab258c8c2..aad2f60997 100644 --- a/packages/skia/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +++ b/packages/skia/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm @@ -10,8 +10,8 @@ #import "include/core/SkColorSpace.h" #import "include/core/SkSurface.h" -#import -#import +#import +#import #import #import #import diff --git a/packages/skia/package.json b/packages/skia/package.json index 4676958af6..e24a6d8041 100644 --- a/packages/skia/package.json +++ b/packages/skia/package.json @@ -29,13 +29,7 @@ "jestEnv.mjs", "cpp/**/*.{h,cpp}", "ios/**", - "libs/ios/libskia.xcframework/**", - "libs/ios/libskshaper.xcframework/**", - "libs/ios/libsvg.xcframework/**", - "libs/ios/libskottie.xcframework/**", - "libs/ios/libsksg.xcframework/**", - "libs/ios/libskparagraph.xcframework/**", - "libs/ios/libskunicode.xcframework/**", + "libs/ios/*.xcframework/**", "react-native-skia.podspec", "scripts/setup-canvaskit.js", "dist/**" diff --git a/packages/skia/react-native-skia.podspec b/packages/skia/react-native-skia.podspec index cc2295f62c..60a8904303 100644 --- a/packages/skia/react-native-skia.podspec +++ b/packages/skia/react-native-skia.podspec @@ -12,11 +12,12 @@ Pod::Spec.new do |s| @shopify/react-native-skia DESC s.homepage = "https://github.com/shopify/react-native-skia" - # brief license entry: s.license = "MIT" - # optional - use expanded license entry instead: - # s.license = { :type => "MIT", :file => "LICENSE" } - s.authors = { "Your Name" => "yourname@email.com" } + s.license = { :type => "MIT", :file => "LICENSE.md" } + s.authors = { + "Christian Falch" => "christian.falch@gmail.com", + "William Candillon" => "wcandillon@gmail.com" + } s.platforms = { :ios => "13.0" } s.source = { :git => "https://github.com/shopify/react-native-skia/react-native-skia.git", :tag => "#{s.version}" } diff --git a/packages/skia/scripts/copy-skia-module-headers.ts b/packages/skia/scripts/copy-skia-module-headers.ts index 19857b6b8d..7e6fcb4a47 100644 --- a/packages/skia/scripts/copy-skia-module-headers.ts +++ b/packages/skia/scripts/copy-skia-module-headers.ts @@ -38,7 +38,29 @@ const copyModule = (module: string) => [ "mkdir -p ./cpp/skia/modules/skunicode/include/", "cp -a ../../externals/skia/modules/skunicode/include/SkUnicode.h ./cpp/skia/modules/skunicode/include/.", - "mkdir -p ./cpp/skia/include/gpu/graphite", + // Remove migrated headers + //grep -R "Delete this after migrating clients" cpp + "rm -rf ./cpp/skia/include/gpu/GrContextThreadSafeProxy.h", + "rm -rf ./cpp/skia/include/gpu/GrDirectContext.h", + "rm -rf ./cpp/skia/include/gpu/GrBackendSemaphore.h", + "rm -rf ./cpp/skia/include/gpu/mock/GrMockTypes.h", + "rm -rf ./cpp/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h", + "rm -rf ./cpp/skia/include/gpu/GrTypes.h", + "rm -rf ./cpp/skia/include/gpu/vk/GrVkTypes.h", + "rm -rf ./cpp/skia/include/gpu/GrDriverBugWorkarounds.h", + "rm -rf ./cpp/skia/include/gpu/GrContextOptions.h", + "rm -rf ./cpp/skia/include/gpu/gl/GrGLExtensions.h", + "rm -rf ./cpp/skia/include/gpu/gl/GrGLAssembleInterface.h", + "rm -rf ./cpp/skia/include/gpu/gl/GrGLTypes.h", + "rm -rf ./cpp/skia/include/gpu/gl/GrGLConfig.h", + "rm -rf ./cpp/skia/include/gpu/gl/GrGLFunctions.h", + "rm -rf ./cpp/skia/include/gpu/gl/GrGLAssembleHelpers.h", + "rm -rf ./cpp/skia/include/gpu/gl/GrGLInterface.h", + "rm -rf ./cpp/skia/include/gpu/GrYUVABackendTextures.h", + "rm -rf ./cpp/skia/include/gpu/GrRecordingContext.h", + "rm -rf ./cpp/skia/include/gpu/GrBackendSurface.h", + "rm -rf ./cpp/skia/include/gpu/d3d/GrD3DBackendContext.h", + "rm -rf ./cpp/skia/include/gpu/d3d/GrD3DTypes.h", ].map((cmd) => { console.log(cmd); executeCmdSync(cmd); diff --git a/turbo.json b/turbo.json index 0b7af13567..b7fc411404 100644 --- a/turbo.json +++ b/turbo.json @@ -2,48 +2,13 @@ "$schema": "https://turbo.build/schema.json", "tasks": { "build:android": { - "env": ["JAVA_HOME", "ANDROID_NDK", "ANDROID_SDK", "ANDROID_HOME"], - "inputs": [ - "packages/*/package.json", - "packages/app/package.json", - "packages/*/src/*.{ts,tsx}", - "apps/*/src/*.{ts,tsx}", - "apps/*/cpp/*.{cpp,h}", - "packages/*/android", - "!packages/*/android/build", - "apps/*/src/android", - "!apps/*/src/.gradle", - "!apps/*/src/build", - "!apps/*/src/app/build" - ], - "outputs": [ - "apps/*/android/**" - ] + "env": ["JAVA_HOME", "ANDROID_NDK", "ANDROID_SDK", "ANDROID_HOME"] }, "build:ios": { - "dependsOn": ["pod:install"], - "outputs": [ - "apps/*/ios/build/**", - "!apps/*/ios/.ios.xcode.env.local" - ], - "inputs": [ - "packages/*/package.json", - "packages/app/package.json", - "packages/*/src/*.{ts,tsx}", - "apps/*/src/*.{ts,tsx}", - "apps/*/cpp/*.{cpp,h}", - "packages/*/*.podspec", - "packages/*/ios", - "apps/*/ios", - "!apps/*/ios/.ios.xcode.env.local", - "!apps/*/ios/build", - "!apps/*/ios/Pods" - ] + "dependsOn": ["pod:install"] }, "pod:install": { - "cache": false, - "inputs": ["**/ios/Podfile", "**/ios/Podfile.lock"], - "outputs": ["**/ios/Pods/**"] + "cache": false }, "lint": {}, "tsc": {},