Skip to content

Commit 323e567

Browse files
authored
Merge pull request #542 from Esri/v.next
[Release] 200.6.0
2 parents b5be74c + 0b04f77 commit 323e567

File tree

240 files changed

+6146
-1100
lines changed

Some content is hidden

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

240 files changed

+6146
-1100
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ Package.resolved
3636
## Python build artifact
3737
# If the style check scripts are run locally, ignore the script build artifact.
3838
Scripts/CI/__pycache__/
39+
40+
## SwiftLint Analyzer Log
41+
.xcodebuild.log

.swiftlint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ opt_in_rules:
7373
- vertical_whitespace_closing_braces
7474
- vertical_whitespace_opening_braces
7575
- yoda_condition
76+
77+
analyzer_rules:
78+
- typesafe_array_init
79+
- unused_declaration
80+
- unused_import
7681

7782
attributes:
7883
attributes_with_arguments_always_on_line_above: false

Documentation/ConfigureAppSecrets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Note: License strings are not required for development. Without licensing or lic
1212
touch .secrets
1313
```
1414

15-
2. Add your **License String** to the secrets file. Licensing the app will remove the 'Licensed for Developer Use Only' watermark. Licensing the app is optional in development but required for production. Add your **Extension License String** and **API Key** access token to the secrets file if needed. Learn more about how to [Get a license](https://developers.arcgis.com/swift/license-and-deployment/get-a-license/).
15+
2. Add your **License String** to the secrets file. Licensing the app will remove the 'Licensed for Developer Use Only' watermark. Licensing the app is optional in development but required for production. Add your **Extension License String** and **API Key** access token to the secrets file if needed. If the license string is set, an **Advanced Editing** extension will be required to access all the samples, such as those with utility network capabilities. Learn more about how to [Get a license](https://developers.arcgis.com/swift/license-and-deployment/get-a-license/).
1616

1717
```sh
1818
echo ARCGIS_LICENSE_KEY=your-license-key >> .secrets

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ This repository contains Swift sample code demonstrating the capabilities of the
1818

1919
## Requirements
2020

21-
* [ArcGIS Maps SDK for Swift](https://developers.arcgis.com/swift/) 200.5 (or newer)
22-
* [ArcGIS Maps SDK for Swift Toolkit](https://github.com/Esri/arcgis-maps-sdk-swift-toolkit) 200.5 (or newer)
23-
* Xcode 15.0 (or newer)
21+
* [ArcGIS Maps SDK for Swift](https://developers.arcgis.com/swift/) 200.6 (or newer)
22+
* [ArcGIS Maps SDK for Swift Toolkit](https://github.com/Esri/arcgis-maps-sdk-swift-toolkit) 200.6 (or newer)
23+
* Xcode 16.0 (or newer)
2424

2525
The *ArcGIS Maps SDK for Swift Samples app* has a *Target SDK* version of *16.0*, meaning that it can run on devices with *iOS 16.0* or newer.
2626

Samples.xcodeproj/project.pbxproj

Lines changed: 509 additions & 61 deletions
Large diffs are not rendered by default.

Samples.xcodeproj/xcshareddata/xcschemes/Samples.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1500"
3+
LastUpgradeVersion = "1600"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Scripts/DowloadPortalItemData.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ func name(ofFileInArchiveAt url: URL) throws -> String {
8787
process.waitUntilExit()
8888

8989
let filenameData = outputPipe.fileHandleForReading.readDataToEndOfFile()
90-
return String(data: filenameData, encoding: .utf8)!.trimmingCharacters(in: .whitespacesAndNewlines)
90+
// swiftlint:disable:next optional_data_string_conversion
91+
return String(decoding: filenameData, as: UTF8.self).trimmingCharacters(in: .whitespacesAndNewlines)
9192
}
9293

9394
/// Counts files in a ZIP archive.
@@ -108,7 +109,8 @@ func count(ofFilesInArchiveAt url: URL) throws -> Int {
108109
// To extract the count, cut the string at the first whitespace.
109110
let totalsInfo = outputPipe.fileHandleForReading.readDataToEndOfFile()
110111
// `UInt8(32)` is space in ASCII.
111-
let totalsCount = String(data: totalsInfo.prefix(while: { $0 != 32 }), encoding: .utf8)!
112+
// swiftlint:disable:next optional_data_string_conversion
113+
let totalsCount = String(decoding: totalsInfo.prefix(while: { $0 != 32 }), as: UTF8.self)
112114
return Int(totalsCount)!
113115
}
114116

Scripts/GenerateSampleViewSourceCode.swift

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ private let sampleMetadata: [SampleMetadata] = {
111111
exit(1)
112112
}
113113
}
114-
.sorted { $0.title < $1.title }
115114
} catch {
116115
print("error: Decoding Samples: \(error.localizedDescription)")
117116
exit(1)
@@ -123,6 +122,7 @@ private let sampleStructs = sampleMetadata
123122
let portalItemIDs = (sample.offlineData ?? [])
124123
.map { #"PortalItem.ID("\#($0)")!"# }
125124
return """
125+
\(sample.category == "Augmented Reality" ? "@available(macCatalyst, unavailable)" : "")
126126
struct \(sample.structName): Sample {
127127
var name: String { \"\(sample.title)\" }
128128
var category: String { \"\(sample.category)\" }
@@ -136,25 +136,44 @@ private let sampleStructs = sampleMetadata
136136
}
137137
.joined(separator: "\n")
138138

139-
private let entries = sampleMetadata
139+
// The set of samples supported on all supported platforms.
140+
private let commonSamples = sampleMetadata
141+
.filter { $0.category != "Augmented Reality" }
140142
.map { sample in "\(sample.structName)()" }
141-
.joined(separator: ",\n ")
142-
private let arrayRepresentation = """
143+
.joined(separator: ",\n ")
144+
145+
// The set of samples supported only on iOS.
146+
private let iOSSpecificSamples = sampleMetadata
147+
.filter { $0.category == "Augmented Reality" }
148+
.map { sample in "\(sample.structName)()" }
149+
.joined(separator: ",\n ")
150+
151+
private let commonSamplesArrayRepresentation = """
143152
[
144-
\(entries)
145-
]
146-
#if targetEnvironment(macCatalyst) || targetEnvironment(simulator)
147-
// Exclude AR samples from Mac Catalyst and Simulator targets
148-
// as they don't have camera and sensors available.
149-
.filter { $0.category != "Augmented Reality" }
153+
\(commonSamples)
154+
]
155+
"""
156+
157+
private let iOSSamplesArrayRepresentation = """
158+
{
159+
#if !targetEnvironment(macCatalyst) && !targetEnvironment(simulator)
160+
// Exclude AR samples from Mac Catalyst and Simulator targets
161+
// as they don't have camera and sensors available.
162+
[
163+
\(iOSSpecificSamples)
164+
]
165+
#else
166+
[]
150167
#endif
168+
}()
151169
"""
152170

153171
do {
154172
let templateFile = try String(contentsOf: templateURL, encoding: .utf8)
155173
// Replaces the empty array code stub, i.e. [], with the array representation.
156174
let content = templateFile
157-
.replacingOccurrences(of: "[/* samples */]", with: arrayRepresentation)
175+
.replacingOccurrences(of: "[/* common_samples */]", with: commonSamplesArrayRepresentation)
176+
.replacingOccurrences(of: "[/* ios_samples */]", with: iOSSamplesArrayRepresentation)
158177
.replacingOccurrences(of: "/* structs */", with: sampleStructs)
159178
try content.write(to: outputFileURL, atomically: true, encoding: .utf8)
160179
} catch {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
from common import *
16+
from CI.common import *
1717
import argparse
1818

1919

Scripts/run_swift_lint_analyzer.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 Esri
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# set -xv # uncomment for debugging
17+
18+
# Variables ::
19+
build_destination="generic/platform=iOS Simulator"
20+
log_name=.xcodebuild.log
21+
22+
# Delete derived data. Otherwise, SwiftLint won't find any files to analyze.
23+
rm -rf ~/Library/Developer/Xcode/DerivedData
24+
25+
# Go to project root directory.
26+
cd "$(dirname "$0")/.."
27+
28+
echo "Building '$log_name'"
29+
xcodebuild -project Samples.xcodeproj -scheme Samples -destination "$build_destination" > $log_name
30+
31+
swiftlint analyze --compiler-log-path $log_name
32+
33+
rm $log_name

0 commit comments

Comments
 (0)