Skip to content

Commit a9ab56a

Browse files
authored
Merge branch 'master' into master
2 parents 5e7de74 + 0a02552 commit a9ab56a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2736
-2450
lines changed

.github/ISSUE_TEMPLATE/BUG_REPORT.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: 🐛 Bug Report
3+
about: If something isn't working as expected 🤔
4+
5+
---
6+
7+
<!-- Thanks for helping PhoneNumberKit! Before you submit your issue, please make sure you followed our checklist and check the appropriate boxes by putting an x in the [ ]: [x] -->
8+
9+
### New Issue Checklist
10+
11+
- [ ] Updated PhoneNumberKit to the latest version
12+
- [ ] Phone number formatted correctly on [JavaScript version](https://htmlpreview.github.io/?https://github.com/google/libphonenumber/blob/master/javascript/i18n/phonenumbers/demo-compiled.html)
13+
- [ ] I searched for [existing GitHub issues](https://github.com/marmelroy/PhoneNumberKit)
14+
- [ ] I am aware that this library is not responsible of adding/removing/changing phone number formats and any request should be done at [libphonenumber repo](https://github.com/google/libphonenumber)
15+
16+
### Steps to reproduce
17+
<!-- Please include the steps to reproduce the issue -->
18+
19+
##### Expected result
20+
<!-- What is the expected result? -->
21+
22+
##### Actual result
23+
<!-- What is the actual result? -->
24+
25+
### Environment
26+
<!-- Please describe how you're using the library and which platform: Cocoapods, SPM, manual integration, macOS, iOS, Linux, etc -->

.github/ISSUE_TEMPLATE/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false

.github/workflows/pr.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
linux-tests:
13+
name: Linux
14+
runs-on: ubuntu-latest
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}-linux-tests
18+
cancel-in-progress: true
19+
20+
steps:
21+
- name: Checkout Repository
22+
uses: actions/checkout@v3
23+
24+
- name: Run tests
25+
run: |
26+
set -o pipefail && swift test
27+
28+
macos-tests:
29+
name: macOS
30+
runs-on: macos-latest
31+
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.ref }}-macos-tests
34+
cancel-in-progress: true
35+
36+
steps:
37+
- name: Checkout Repository
38+
uses: actions/checkout@v3
39+
40+
- name: Run tests
41+
run: |
42+
set -o pipefail && swift test
43+
44+
macos-carthage-build:
45+
name: Carthage Build
46+
runs-on: macos-latest
47+
needs:
48+
- linux-tests
49+
- macos-tests
50+
51+
concurrency:
52+
group: ${{ github.workflow }}-${{ github.ref }}-macos-carthage-build
53+
cancel-in-progress: true
54+
55+
steps:
56+
- name: Checkout Repository
57+
uses: actions/checkout@v3
58+
59+
- name: Build - iOS
60+
run: |
61+
set -o pipefail && xcodebuild -project "PhoneNumberKit.xcodeproj" -scheme "PhoneNumberKit" -destination "generic/platform=iOS" build
62+
63+
- name: Build - macOS
64+
run: |
65+
set -o pipefail && xcodebuild -project "PhoneNumberKit.xcodeproj" -scheme "PhoneNumberKit-macOS" -destination "generic/platform=macOS" build

.github/workflows/update_metadata.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
- name: Configure Python
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: '3.9'
15+
python-version: '3.12'
1616

1717
- name: Install XML to JSON converter
1818
run: pip install xmljson
1919

2020
- name: Checkout
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2222

2323
- name: Authorize
2424
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Xcode
22
#
3-
build/
3+
.build/
44
*.pbxuser
55
!default.pbxuser
66
*.mode1v3

.swiftformat

+7-32
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
--allman false
2-
--binarygrouping none
3-
--closingparen balanced
4-
--commas inline
5-
--conflictmarkers reject
6-
--decimalgrouping none
7-
--elseposition same-line
8-
--empty void
9-
--exponentcase lowercase
10-
--exponentgrouping disabled
11-
--fractiongrouping disabled
12-
--fragment false
13-
--header ignore
14-
--hexgrouping none
15-
--hexliteralcase uppercase
16-
--ifdef outdent
17-
--importgrouping alphabetized
18-
--indent 4
19-
--indentcase false
20-
--linebreaks lf
21-
--octalgrouping none
22-
--operatorfunc spaced
23-
--patternlet inline
1+
--swiftversion 5.3
2+
--xcodeindentation enabled
3+
--disable unusedArguments, redundantReturn, redundantSelf, trailingCommas, trailingClosures, wrapArguments, wrapMultilineStatementBraces
4+
--enable blockComments, isEmpty
5+
--emptybraces spaced
6+
--ifdef no-indent
7+
--importgrouping testable-first
248
--ranges no-space
25-
--self insert
26-
--selfrequired
27-
--semicolons inline
28-
--stripunusedargs closure-only
29-
--trailingclosures
30-
--trimwhitespace always
31-
--wraparguments before-first
32-
--wrapcollections before-first
33-
--xcodeindentation disabled

.travis.yml

-19
This file was deleted.

Package.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PackageDescription
44
let package = Package(
55
name: "PhoneNumberKit",
66
platforms: [
7-
.iOS(.v9), .macOS(.v10_10), .tvOS(.v10), .watchOS(.v2)
7+
.iOS(.v12), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v4)
88
],
99
products: [
1010
.library(name: "PhoneNumberKit", targets: ["PhoneNumberKit"]),
@@ -19,7 +19,8 @@ let package = Package(
1919
"Resources/update_metadata.sh",
2020
"Info.plist"],
2121
resources: [
22-
.process("Resources/PhoneNumberMetadata.json")
22+
.process("Resources/PhoneNumberMetadata.json"),
23+
.copy("Resources/PrivacyInfo.xcprivacy")
2324
]),
2425
.testTarget(name: "PhoneNumberKitTests",
2526
dependencies: ["PhoneNumberKit"],

PhoneNumberKit.podspec

+22-41
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,40 @@
1-
#
2-
# Be sure to run `pod lib lint PhoneNumberKit.podspec' to ensure this is a
3-
# valid spec before submitting.
4-
#
5-
# Any lines starting with a # are optional, but their use is encouraged
6-
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
7-
#
8-
91
Pod::Spec.new do |s|
10-
s.name = "PhoneNumberKit"
11-
s.version = "3.5.8"
12-
s.summary = "Swift framework for working with phone numbers"
13-
14-
# This description is used to generate tags and improve search results.
15-
# * Think: What does it do? Why did you write it? What is the focus?
16-
# * Try to keep it short, snappy and to the point.
17-
# * Write the description between the DESC delimiters below.
18-
# * Finally, don't worry about the indent, CocoaPods strips it!
2+
s.name = 'PhoneNumberKit'
3+
s.version = '3.7.11'
4+
s.summary = 'Swift framework for working with phone numbers'
195
s.description = <<-DESC
206
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
21-
DESC
7+
DESC
228

23-
s.homepage = "https://github.com/marmelroy/PhoneNumberKit"
24-
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
9+
s.homepage = 'https://github.com/marmelroy/PhoneNumberKit'
2510
s.license = 'MIT'
26-
s.author = { "Roy Marmelstein" => "[email protected]" }
27-
s.source = { :git => "https://github.com/marmelroy/PhoneNumberKit.git", :tag => s.version.to_s }
28-
s.social_media_url = "http://twitter.com/marmelroy"
29-
11+
s.author = { 'Roy Marmelstein' => '[email protected]' }
12+
s.source = { git: 'https://github.com/marmelroy/PhoneNumberKit.git', tag: s.version.to_s }
3013

3114
s.requires_arc = true
32-
33-
s.ios.frameworks = 'CoreTelephony'
34-
s.osx.frameworks = 'CoreTelephony'
35-
36-
s.ios.deployment_target = '9.0'
37-
s.osx.deployment_target = '10.10'
38-
s.tvos.deployment_target = '10.0'
39-
s.watchos.deployment_target = '2.0'
15+
s.ios.deployment_target = '12.0'
16+
s.osx.deployment_target = '10.13'
17+
s.tvos.deployment_target = '12.0'
18+
s.watchos.deployment_target = '4.0'
4019

4120
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '5.0' }
4221
s.swift_version = '5.0'
4322

4423
s.subspec 'PhoneNumberKitCore' do |core|
45-
core.ios.deployment_target = '9.0'
46-
core.osx.deployment_target = '10.10'
47-
core.tvos.deployment_target = '10.0'
48-
core.watchos.deployment_target = '2.0'
49-
core.source_files = "PhoneNumberKit/*.{swift}"
50-
core.resources = "PhoneNumberKit/Resources/PhoneNumberMetadata.json"
24+
core.ios.deployment_target = '12.0'
25+
core.osx.deployment_target = '10.13'
26+
core.tvos.deployment_target = '12.0'
27+
core.watchos.deployment_target = '4.0'
28+
core.source_files = 'PhoneNumberKit/*.{swift}'
29+
core.resources = [
30+
'PhoneNumberKit/Resources/PhoneNumberMetadata.json'
31+
]
32+
core.resource_bundles = {'PhoneNumberKitPrivacy' => ['PhoneNumberKit/Resources/PrivacyInfo.xcprivacy']}
5133
end
5234

5335
s.subspec 'UIKit' do |ui|
5436
ui.dependency 'PhoneNumberKit/PhoneNumberKitCore'
55-
ui.ios.deployment_target = '9.0'
56-
ui.source_files = 'PhoneNumberKit/UI/'
37+
ui.ios.deployment_target = '12.0'
38+
ui.source_files = 'PhoneNumberKit/UI/*.{swift}'
5739
end
58-
5940
end

0 commit comments

Comments
 (0)