Blaž Vantur
09/11/2024, 9:35 AMBlaž Vantur
09/11/2024, 9:35 AMpackage = sp.bvantur.inspektify.shakedetector
language = Objective-C
headers = ShakeDetectorIOS.h
linkerOpts = -lobjc -framework Foundation
ShakeDetectorIOS.h:
#import <Foundation/Foundation.h>
@interface ShakeDetectorIOS : NSObject
//- (void)enableShakeDetector:(BOOL)condition;
@end
ShakeDetectorIOS.swift:
import Foundation
@objc public class ShakeDetectorIOS: NSObject {
}
build.gradle.kts:
listOf(
iosArm64(),
iosX64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "InspektifyLib"
isStatic = true
}
it.compilations.getByName("main") {
cinterops.create("ShakeDetectorIOS") {
defFile = file("src/nativeInterop/cinterop/ShakeDetectorIOS.def")
packageName = "sp.bvantur.inspektify.shakedetector"
includeDirs.allHeaders("src/nativeInterop/cinterop/")
extraOpts("-libraryPath", "$projectDir/src/nativeInterop/cinterop/")
}
}
}