Skip to content

Commit 2234668

Browse files
authored
Merge pull request zxing-cpp#641 from benjohnde/master
Split Podspec into subspecs
2 parents ebd7db8 + 5deb5ba commit 2234668

File tree

2 files changed

+43
-9
lines changed

2 files changed

+43
-9
lines changed

wrappers/ios/README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
# ZXingCpp iOS Framework
22

3-
Add the iOS wrapper either as a local Swift Package by adding it as a dependency to your app or add the repository, the Package.swift file is automatically picked.
3+
## Usage
4+
5+
For general usage, please compare the source code provided in the demo project.
6+
7+
### Swift PM
8+
9+
As this repository provides a `Package.swift` on root level, you can add `zxing-cpp` including wrapper code by adding a Package Dependency in Xcode.
10+
11+
An alternative way is to check this repository out and add it as a local Swift Package by adding it as dependency to your app.
12+
13+
### CocoaPods
14+
15+
As an alternative way, you can also rely on [CocoaPods](https://cocoapods.org/pods/zxing-cpp). Just add the Pod as dependency, for instance:
16+
17+
```
18+
pod 'zxing-cpp'
19+
```
20+
21+
If you just need the core without the wrapper code, you can also rely on:
22+
23+
```
24+
pod 'zxing-cpp/Core'
25+
```
26+
27+
The module to be imported is named `ZXingCpp`.

zxing-cpp.podspec

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Pod::Spec.new do |s|
44
s.summary = 'C++ port of ZXing'
55
s.homepage = 'https://github.com/zxing-cpp/zxing-cpp'
66
s.author = 'axxel'
7+
s.readme = 'https://raw.githubusercontent.com/zxing-cpp/zxing-cpp/master/wrappers/ios/README.md'
78
s.license = {
89
:type => 'Apache License 2.0',
910
:file => 'LICENSE'
@@ -14,16 +15,25 @@ Pod::Spec.new do |s|
1415
}
1516
s.module_name = 'ZXingCpp'
1617
s.platform = :ios, '11.0'
17-
s.frameworks = 'CoreGraphics', 'CoreImage', 'CoreVideo'
1818
s.library = ['c++']
1919
s.pod_target_xcconfig = {
2020
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++20'
2121
}
22-
s.source_files = 'core/src/**/*.{h,c,cpp}',
23-
'wrappers/ios/Sources/Wrapper/**/*.{h,m,mm}'
24-
s.public_header_files = 'wrappers/ios/Sources/Wrapper/Reader/{ZXIBarcodeReader,ZXIResult,ZXIPosition,ZXIPoint,ZXIDecodeHints}.h',
25-
'wrappers/ios/Sources/Wrapper/Writer/ZXIBarcodeWriter.h',
26-
'wrappers/ios/Sources/Wrapper/{ZXIErrors,ZXIFormat}.h'
27-
s.private_header_files = 'core/src/**/*.h'
28-
s.exclude_files = 'wrappers/ios/Sources/Wrapper/UmbrellaHeader.h'
22+
23+
s.default_subspec = 'Wrapper'
24+
25+
s.subspec 'Core' do |ss|
26+
ss.source_files = 'core/src/**/*.{h,c,cpp}'
27+
ss.private_header_files = 'core/src/**/*.h'
28+
end
29+
30+
s.subspec 'Wrapper' do |ss|
31+
ss.dependency 'zxing-cpp/Core'
32+
ss.frameworks = 'CoreGraphics', 'CoreImage', 'CoreVideo'
33+
ss.source_files = 'wrappers/ios/Sources/Wrapper/**/*.{h,m,mm}'
34+
ss.public_header_files = 'wrappers/ios/Sources/Wrapper/Reader/{ZXIBarcodeReader,ZXIResult,ZXIPosition,ZXIPoint,ZXIDecodeHints}.h',
35+
'wrappers/ios/Sources/Wrapper/Writer/ZXIBarcodeWriter.h',
36+
'wrappers/ios/Sources/Wrapper/{ZXIErrors,ZXIFormat}.h'
37+
ss.exclude_files = 'wrappers/ios/Sources/Wrapper/UmbrellaHeader.h'
38+
end
2939
end

0 commit comments

Comments
 (0)