Skip to content

Commit 0fc1006

Browse files
shai-almogclaude
andcommitted
xcodebuild CI: umbrella ML Kit headers + static-lib target type
Two iterations on the matrix: 1. The per-class ML Kit header paths I was using (`<MLKitTextRecognition/MLKTextRecognizer.h>` etc.) aren't actually exported by the GoogleMLKit pods. ML Kit ships ONE umbrella header per framework, named after the framework itself. Switch every iOS bridge to import the umbrella (`<MLKitTextRecognition/MLKitText Recognition.h>`, `<MLKitVision/MLKitVision.h>`, etc.) so clang's framework header search resolves and the public classes -- which the umbrella re-exports -- stay visible to the .m bodies. 2. The cn1libs that ship without a CocoaPod (whisper / stable diffusion) declare extern symbols that the real build server resolves against the bundled static library / Swift runner. The probe build had no such library so the link phase failed. Switch the probe target from `framework` to `library.static` -- .a archives don't link, they archive .o files, so unresolved externs are fine. We still compile-check every source file, which is the whole point of this gate. 3. Also fix tflite's umbrella import: the pod is `TensorFlowLiteObjC` but the produced framework's module name -- the one used in the angle-bracket prefix -- is `TFLTensorFlowLite`. So `<TFLTensorFlowLite/TFLTensorFlowLite.h>`, not `<TensorFlowLiteObjC/...>`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 915d524 commit 0fc1006

13 files changed

Lines changed: 48 additions & 75 deletions

File tree

.github/workflows/ai-cn1lib-native-check.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ jobs:
8686
iOS: "14.0"
8787
targets:
8888
CN1AIProbe:
89-
type: framework
89+
# Static library: archives .o files without linking, so cn1libs
90+
# that reference externs supplied by the real build server
91+
# (libwhisper.a for whisper, cn1_sd_generate for stable
92+
# diffusion, the actual ML Kit framework binaries) still
93+
# compile-check successfully.
94+
type: library.static
9095
platform: iOS
9196
sources:
9297
- path: CN1AIProbe
@@ -95,9 +100,6 @@ jobs:
95100
CLANG_ENABLE_MODULES: YES
96101
CLANG_ENABLE_OBJC_ARC: YES
97102
CODE_SIGNING_ALLOWED: NO
98-
GENERATE_INFOPLIST_FILE: YES
99-
DEFINES_MODULE: YES
100-
PRODUCT_BUNDLE_IDENTIFIER: com.codenameone.cn1ai.probe
101103
YAML
102104
cd "$PROBE"
103105
xcodegen generate --spec project.yml

maven/cn1-ai-mlkit-barcode/ios/src/main/objectivec/com_codename1_ai_mlkit_barcode_NativeBarcodeScannerImpl.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#import "com_codename1_ai_mlkit_barcode_NativeBarcodeScannerImpl.h"
22
#import <UIKit/UIKit.h>
3-
#import <MLKitBarcodeScanning/MLKBarcodeScanner.h>
4-
#import <MLKitBarcodeScanning/MLKBarcodeScannerOptions.h>
5-
#import <MLKitBarcodeScanning/MLKBarcode.h>
6-
#import <MLKitVision/MLKVisionImage.h>
3+
#import <MLKitBarcodeScanning/MLKitBarcodeScanning.h>
4+
#import <MLKitVision/MLKitVision.h>
75
#import <arpa/inet.h>
86

97
@implementation com_codename1_ai_mlkit_barcode_NativeBarcodeScannerImpl

maven/cn1-ai-mlkit-face/ios/src/main/objectivec/com_codename1_ai_mlkit_face_NativeFaceDetectorImpl.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#import "com_codename1_ai_mlkit_face_NativeFaceDetectorImpl.h"
22
#import <UIKit/UIKit.h>
3-
#import <MLKitFaceDetection/MLKFaceDetector.h>
4-
#import <MLKitFaceDetection/MLKFaceDetectorOptions.h>
5-
#import <MLKitFaceDetection/MLKFace.h>
6-
#import <MLKitVision/MLKVisionImage.h>
3+
#import <MLKitFaceDetection/MLKitFaceDetection.h>
4+
#import <MLKitVision/MLKitVision.h>
75
#import <arpa/inet.h>
86

97
@implementation com_codename1_ai_mlkit_face_NativeFaceDetectorImpl

maven/cn1-ai-mlkit-labeling/ios/src/main/objectivec/com_codename1_ai_mlkit_labeling_NativeImageLabelerImpl.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#import "com_codename1_ai_mlkit_labeling_NativeImageLabelerImpl.h"
22
#import <UIKit/UIKit.h>
3-
#import <MLKitImageLabeling/MLKImageLabeler.h>
4-
#import <MLKitImageLabeling/MLKImageLabelerOptions.h>
5-
#import <MLKitImageLabeling/MLKImageLabel.h>
6-
#import <MLKitVision/MLKVisionImage.h>
3+
#import <MLKitImageLabeling/MLKitImageLabeling.h>
4+
#import <MLKitVision/MLKitVision.h>
75
#import <arpa/inet.h>
86

97
@implementation com_codename1_ai_mlkit_labeling_NativeImageLabelerImpl

maven/cn1-ai-mlkit-langid/ios/src/main/objectivec/com_codename1_ai_mlkit_langid_NativeLanguageIdentifierImpl.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#import "com_codename1_ai_mlkit_langid_NativeLanguageIdentifierImpl.h"
22
#import <UIKit/UIKit.h>
3-
#import <MLKitLanguageID/MLKLanguageIdentification.h>
3+
#import <MLKitLanguageID/MLKitLanguageID.h>
44

55
@implementation com_codename1_ai_mlkit_langid_NativeLanguageIdentifierImpl
66

maven/cn1-ai-mlkit-pose/ios/src/main/objectivec/com_codename1_ai_mlkit_pose_NativePoseDetectorImpl.m

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#import "com_codename1_ai_mlkit_pose_NativePoseDetectorImpl.h"
22
#import <UIKit/UIKit.h>
3-
#import <MLKitPoseDetection/MLKPoseDetector.h>
4-
#import <MLKitPoseDetection/MLKPoseDetectorOptions.h>
5-
#import <MLKitPoseDetection/MLKPose.h>
6-
#import <MLKitPoseDetection/MLKPoseLandmark.h>
7-
#import <MLKitVision/MLKVisionImage.h>
3+
#import <MLKitPoseDetection/MLKitPoseDetection.h>
4+
#import <MLKitVision/MLKitVision.h>
85

96
@implementation com_codename1_ai_mlkit_pose_NativePoseDetectorImpl
107

maven/cn1-ai-mlkit-segmentation/ios/src/main/objectivec/com_codename1_ai_mlkit_segmentation_NativeSelfieSegmenterImpl.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#import "com_codename1_ai_mlkit_segmentation_NativeSelfieSegmenterImpl.h"
22
#import <UIKit/UIKit.h>
3-
#import <MLKitSegmentationSelfie/MLKSelfieSegmenterOptions.h>
4-
#import <MLKitSegmentationCommon/MLKSegmenter.h>
5-
#import <MLKitSegmentationCommon/MLKSegmentationMask.h>
6-
#import <MLKitVision/MLKVisionImage.h>
3+
#import <MLKitSegmentationSelfie/MLKitSegmentationSelfie.h>
4+
#import <MLKitVision/MLKitVision.h>
75
#import <CoreVideo/CoreVideo.h>
86

97
@implementation com_codename1_ai_mlkit_segmentation_NativeSelfieSegmenterImpl

maven/cn1-ai-mlkit-smartreply/ios/src/main/objectivec/com_codename1_ai_mlkit_smartreply_NativeSmartReplyImpl.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#import "com_codename1_ai_mlkit_smartreply_NativeSmartReplyImpl.h"
22
#import <UIKit/UIKit.h>
3-
#import <MLKitSmartReply/MLKSmartReply.h>
4-
#import <MLKitSmartReply/MLKTextMessage.h>
5-
#import <MLKitSmartReply/MLKSmartReplySuggestion.h>
6-
#import <MLKitSmartReply/MLKSmartReplySuggestionResult.h>
3+
#import <MLKitSmartReply/MLKitSmartReply.h>
74
#import <arpa/inet.h>
85

96
@implementation com_codename1_ai_mlkit_smartreply_NativeSmartReplyImpl

maven/cn1-ai-mlkit-text/common/codenameone_library_required.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@
44
# further per-class entries as needed.
55
codename1.arg.ios.pods=GoogleMLKit/TextRecognition
66
codename1.arg.android.gradleDep=implementation 'com.google.mlkit:text-recognition:16.0.0'
7-
8-
9-

maven/cn1-ai-mlkit-text/ios/src/main/objectivec/com_codename1_ai_mlkit_text_NativeTextRecognizerImpl.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#import "com_codename1_ai_mlkit_text_NativeTextRecognizerImpl.h"
22
#import <UIKit/UIKit.h>
3-
#import <MLKitTextRecognition/MLKTextRecognizer.h>
4-
#import <MLKitTextRecognition/MLKTextRecognizerOptions.h>
5-
#import <MLKitVision/MLKVisionImage.h>
6-
#import <MLKitVision/MLKText.h>
3+
#import <MLKitTextRecognition/MLKitTextRecognition.h>
4+
#import <MLKitVision/MLKitVision.h>
75

86
@implementation com_codename1_ai_mlkit_text_NativeTextRecognizerImpl
97

0 commit comments

Comments
 (0)