Skip to content

Commit 44aab49

Browse files
committed
feat: add swift package management support
1 parent 18cca72 commit 44aab49

File tree

13 files changed

+59
-32
lines changed

13 files changed

+59
-32
lines changed

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.19.0"
2+
"flutter": "3.24.0"
33
}

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ EXTERNAL SOURCES:
1515

1616
SPEC CHECKSUMS:
1717
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
18-
freerasp: bb827d80b926abcfb8f4ca4ff4557c2fe4a5ae21
18+
freerasp: 9bd38498e07d3f3f419218f0b0077768fbd50791
1919

2020
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011
2121

22-
COCOAPODS: 1.15.2
22+
COCOAPODS: 1.16.2

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<MacroExpansion>
3132
<BuildableReference
@@ -43,6 +44,7 @@
4344
buildConfiguration = "Debug"
4445
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4546
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4648
launchStyle = "0"
4749
useCustomWorkingDirectory = "NO"
4850
ignoresPersistentStateOnLaunch = "NO"

ios/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ Icon?
3535

3636
/Flutter/Generated.xcconfig
3737
/Flutter/ephemeral/
38-
/Flutter/flutter_export_environment.sh
38+
/Flutter/flutter_export_environment.sh
39+
40+
.build/
41+
.swiftpm/

ios/Assets/.gitkeep

Whitespace-only changes.

ios/Classes/FreeraspPlugin.h

Lines changed: 0 additions & 4 deletions
This file was deleted.

ios/Classes/FreeraspPlugin.m

Lines changed: 0 additions & 15 deletions
This file was deleted.

ios/freerasp.podspec

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ FreeRASP for iOS is a lightweight and easy-to-use mobile app protection and secu
1313
s.license = { :file => '../LICENSE' }
1414
s.author = { 'Talsec' => 'talsec.app' }
1515
s.source = { :path => '.' }
16-
s.source_files = 'Classes/**/*', 'TalsecRuntime.xcframework'
16+
s.source_files = 'freerasp/Sources/**/*.swift', 'TalsecRuntime.xcframework'
1717
s.dependency 'Flutter'
18-
s.platform = :ios, '8.0'
19-
18+
s.platform = :ios, '12.0'
2019
s.preserve_paths = 'TalsecRuntime.xcframework'
21-
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework TalsecRuntime' }
2220
s.vendored_frameworks = 'TalsecRuntime.xcframework'
21+
s.xcconfig = {
22+
'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift',
23+
'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift',
24+
'OTHER_LDFLAGS' => '-framework TalsecRuntime'
25+
}
2326

2427
# Flutter.framework does not contain a i386 slice.
2528
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }

ios/freerasp/Package.swift

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "freerasp",
8+
platforms: [
9+
.iOS("12.0"),
10+
],
11+
products: [
12+
.library(name: "freerasp", targets: ["freerasp"])
13+
],
14+
dependencies: [],
15+
targets: [
16+
.target(
17+
name: "freerasp",
18+
dependencies: [],
19+
resources: [
20+
// TODO: If your plugin requires a privacy manifest
21+
// (e.g. if it uses any required reason APIs), update the PrivacyInfo.xcprivacy file
22+
// to describe your plugin's privacy impact, and then uncomment this line.
23+
// For more information, see:
24+
// https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
25+
// .process("PrivacyInfo.xcprivacy"),
26+
27+
// TODO: If you have other resources that need to be bundled with your plugin, refer to
28+
// the following instructions to add them:
29+
// https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package
30+
]
31+
),
32+
.binaryTarget(
33+
name: "TalsecRuntime.xcframework",
34+
path: "./TalsecRuntime.xcframework"
35+
)
36+
]
37+
)

ios/Classes/EventProcessor.swift renamed to ios/freerasp/Sources/freerasp/EventProcessor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import TalsecRuntime
2+
import Flutter
23

34
/// Class for processing security threat events
45
class EventProcessor {

0 commit comments

Comments
 (0)