Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljfischer committed Nov 2, 2020
2 parents 2f14273 + dec92ed commit d57c95e
Show file tree
Hide file tree
Showing 208 changed files with 210 additions and 807 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]

env:
PROJECT: 'SmartDeviceLink-iOS.xcodeproj'
DESTINATION: 'platform=iOS Simulator,name=iPhone 11,OS=14.0'
DESTINATION: 'platform=iOS Simulator,name=iPhone 11,OS=14.1'

jobs:
build:
Expand All @@ -27,7 +27,7 @@ jobs:

# Select the Xcode version (the platform/simulator/OS available for testing depend on the Xcode version)
- name: Select Xcode version
run: sudo xcode-select -switch /Applications/Xcode_12.0.0.app
run: sudo xcode-select -switch /Applications/Xcode_12.1.app

- name: Build
run: set -o pipefail && xcodebuild -scheme "${{ matrix.scheme }}" -destination "$DESTINATION" build | xcpretty --color --simple
Expand All @@ -46,7 +46,7 @@ jobs:

# Select the Xcode version (the platform/simulator/OS available for testing depend on the Xcode version)
- name: Select Xcode version
run: sudo xcode-select -switch /Applications/Xcode_12.0.0.app
run: sudo xcode-select -switch /Applications/Xcode_12.1.app

- name: Checkout repository
uses: actions/checkout@v2.3.1
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Updated max URL lengths in `SystemRequest` to be unlimited (https://github.com/smartdevicelink/sdl_ios/issues/1110).
* Added support for new types of character sets (https://github.com/smartdevicelink/sdl_ios/issues/1139).
* Added new RPC for `SubtleAlert`, a notification-like alert (https://github.com/smartdevicelink/sdl_ios/issues/1355).
* Added support to Swift Package Manager (https://github.com/smartdevicelink/sdl_ios/issues/1387).
* Added new vehicle data `StabilityControlsStatus` (https://github.com/smartdevicelink/sdl_ios/issues/1449).
* Changed fuel-related vehicle data RPCs (https://github.com/smartdevicelink/sdl_ios/issues/1472).
* Added new vehicle data `HandsOffSteering` (https://github.com/smartdevicelink/sdl_ios/issues/1473).
Expand All @@ -29,13 +30,16 @@
* Added support for new WebEngine projection hmi types and templates (note that this is not properly supported in this library outside of the RPCs; look at the JavaScript Suite library for more information) (https://github.com/smartdevicelink/sdl_ios/issues/1681).
* Added a `reason` parameter to protocol NAKs (https://github.com/smartdevicelink/sdl_ios/issues/1684).
* Update the minimum required iOS version to 10.0 (https://github.com/smartdevicelink/sdl_ios/issues/1738).
* `SDLSetDisplayLayout(+Response)` is now deprecated (https://github.com/smartdevicelink/sdl_ios/issues/1785).
* `SDLLockScreenViewController` now defaults to modal presentation style `.fullScreen` (https://github.com/smartdevicelink/sdl_ios/issues/1794).

### Bug Fixes
* `SDLServiceUpdateReason` enums are now named properly (https://github.com/smartdevicelink/sdl_ios/issues/1502).
* Consolidated serial queue logic (https://github.com/smartdevicelink/sdl_ios/issues/1614).
* Consolidated logic for saving the dynamic MTU size (https://github.com/smartdevicelink/sdl_ios/issues/1615).
* Fixed example app files not in the proper folder (https://github.com/smartdevicelink/sdl_ios/issues/1765).
* Fixed `SDLSetGlobalProperties` init missing `userLocation` (https://github.com/smartdevicelink/sdl_ios/issues/1771).
* Fixed `SDLOnDriverDistraction` properties missing `nullable` (https://github.com/smartdevicelink/sdl_ios/issues/1813).

### RPC Generator
* Fixed generator not sorting imports (https://github.com/smartdevicelink/sdl_ios/issues/1720).
Expand All @@ -51,8 +55,12 @@
### Other
* Moved files around to simplify distribution (https://github.com/smartdevicelink/sdl_ios/issues/568).
* Fixed warnings in Objective-C example app (https://github.com/smartdevicelink/sdl_ios/issues/1772).
* Fixed example apps resetting soft buttons whenever going to HMI FULL (https://github.com/smartdevicelink/sdl_ios/issues/1782).
* Cleaned up inline documentation grammar and spelling issues (https://github.com/smartdevicelink/sdl_ios/issues/1787).
* Update CI to Xcode 12 and fix screenshot failures (https://github.com/smartdevicelink/sdl_ios/issues/1801).
* Fixed unit tests crashing (https://github.com/smartdevicelink/sdl_ios/issues/1802).
* README updates to point to testing YAML (https://github.com/smartdevicelink/sdl_ios/issues/1816).
* Removed some unnecessary warning suppression (https://github.com/smartdevicelink/sdl_ios/issues/1819).

## 6.7.0
### Versions
Expand Down
10 changes: 4 additions & 6 deletions Example Apps/Example ObjC/MenuManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ + (SDLMenuCell *)sdlex_menuCellChangeTemplateWithManager:(SDLManager *)manager {

// Non - Media
SDLMenuCell *cell = [[SDLMenuCell alloc] initWithTitle:@"Non - Media (Default)" icon:nil voiceCommands:nil handler:^(SDLTriggerSource _Nonnull triggerSource) {
SDLSetDisplayLayout* display = [[SDLSetDisplayLayout alloc] initWithPredefinedLayout:SDLPredefinedLayoutNonMedia];
[manager sendRequest:display withResponseHandler:^(SDLRPCRequest *request, SDLRPCResponse *response, NSError *error) {
if (!response.success) {
[manager.screenManager changeLayout:[[SDLTemplateConfiguration alloc] initWithPredefinedLayout:SDLPredefinedLayoutNonMedia] withCompletionHandler:^(NSError * _Nullable error) {
if (error != nil) {
[AlertManager sendAlertWithManager:manager image:nil textField1:errorMessage textField2:nil];
}
}];
Expand All @@ -108,9 +107,8 @@ + (SDLMenuCell *)sdlex_menuCellChangeTemplateWithManager:(SDLManager *)manager {

// Graphic With Text
SDLMenuCell *cell2 = [[SDLMenuCell alloc] initWithTitle:@"Graphic With Text" icon:nil voiceCommands:nil handler:^(SDLTriggerSource _Nonnull triggerSource) {
SDLSetDisplayLayout* display = [[SDLSetDisplayLayout alloc] initWithPredefinedLayout:SDLPredefinedLayoutGraphicWithText];
[manager sendRequest:display withResponseHandler:^(SDLRPCRequest *request, SDLRPCResponse *response, NSError *error) {
if (!response.success) {
[manager.screenManager changeLayout:[[SDLTemplateConfiguration alloc] initWithPredefinedLayout:SDLPredefinedLayoutGraphicWithText] withCompletionHandler:^(NSError * _Nullable error) {
if (error != nil) {
[AlertManager sendAlertWithManager:manager image:nil textField1:errorMessage textField2:nil];
}
}];
Expand Down
7 changes: 3 additions & 4 deletions Example Apps/Example ObjC/ProxyManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,9 @@ - (void)sdlex_createMenus {
- (void)sdlex_showInitialData {
if (![self.sdlManager.hmiLevel isEqualToEnum:SDLHMILevelFull]) { return; }

SDLSetDisplayLayout *setDisplayLayout = [[SDLSetDisplayLayout alloc] initWithPredefinedLayout:SDLPredefinedLayoutNonMedia];
[self.sdlManager sendRequest:setDisplayLayout];
[self.sdlManager.screenManager changeLayout:[[SDLTemplateConfiguration alloc] initWithPredefinedLayout:SDLPredefinedLayoutNonMedia] withCompletionHandler:nil];

[self sdlex_updateScreen];
self.sdlManager.screenManager.softButtonObjects = [self.buttonManager allScreenSoftButtons];
}

- (nullable RefreshUIHandler)refreshUIHandler {
Expand Down Expand Up @@ -245,8 +243,9 @@ - (void)hmiLevel:(SDLHMILevel)oldLevel didChangeToLevel:(SDLHMILevel)newLevel {
// This is our first time in a non-NONE state
self.firstHMILevel = newLevel;

// Send static menu items.
// Send static menu items and soft buttons
[self sdlex_createMenus];
self.sdlManager.screenManager.softButtonObjects = [self.buttonManager allScreenSoftButtons];

// Subscribe to vehicle data.
[self.vehicleDataManager subscribeToVehicleOdometer];
Expand Down
10 changes: 4 additions & 6 deletions Example Apps/Example Swift/MenuManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ private extension MenuManager {
/// Non-Media
let submenuTitleNonMedia = "Non - Media (Default)"
submenuItems.append(SDLMenuCell(title: submenuTitleNonMedia, icon: nil, voiceCommands: nil, handler: { (triggerSource) in
let display = SDLSetDisplayLayout(predefinedLayout: .nonMedia)
manager.send(request: display) { (request, response, error) in
guard response?.success.boolValue == .some(true) else {
manager.screenManager.changeLayout(SDLTemplateConfiguration(predefinedLayout: .nonMedia)) { err in
if err != nil {
AlertManager.sendAlert(textField1: errorMessage, sdlManager: manager)
return
}
Expand All @@ -136,9 +135,8 @@ private extension MenuManager {
/// Graphic with Text
let submenuTitleGraphicText = "Graphic With Text"
submenuItems.append(SDLMenuCell(title: submenuTitleGraphicText, icon: nil, voiceCommands: nil, handler: { (triggerSource) in
let display = SDLSetDisplayLayout(predefinedLayout: .graphicWithText)
manager.send(request: display) { (request, response, error) in
guard response?.success.boolValue == .some(true) else {
manager.screenManager.changeLayout(SDLTemplateConfiguration(predefinedLayout: .graphicWithText)) { err in
if err != nil {
AlertManager.sendAlert(textField1: errorMessage, sdlManager: manager)
return
}
Expand Down
9 changes: 4 additions & 5 deletions Example Apps/Example Swift/ProxyManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ extension ProxyManager: SDLManagerDelegate {
// This is our first time in a non-NONE state
firstHMILevelState = newLevel

// Send static menu items.
// Send static menu items and soft buttons
createMenuAndGlobalVoiceCommands()
sdlManager.screenManager.softButtonObjects = buttonManager.allScreenSoftButtons()

// Subscribe to vehicle data.
vehicleDataManager.subscribeToVehicleOdometer()
Expand Down Expand Up @@ -250,12 +251,10 @@ private extension ProxyManager {
/// Set the template and create the UI
func showInitialData() {
guard sdlManager.hmiLevel == .full else { return }

let setDisplayLayout = SDLSetDisplayLayout(predefinedLayout: .nonMedia)
sdlManager.send(setDisplayLayout)

sdlManager.screenManager.changeLayout(SDLTemplateConfiguration(predefinedLayout: .nonMedia), withCompletionHandler: nil)

updateScreen()
sdlManager.screenManager.softButtonObjects = buttonManager.allScreenSoftButtons()
}

/// Update the UI's textfields, images and soft buttons
Expand Down
27 changes: 20 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
// swift-tools-version:5.0
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "SmartDeviceLink",
defaultLocalization: "en",
platforms: [
.iOS(.v10)
],
products: [
.library(name: "SmartDeviceLink", targets: ["SmartDeviceLink"]),
.library(name: "SmartDeviceLinkSwift", targets: ["SmartDeviceLinkSwift"])
],
dependencies: [
.package(name: "BiSON", url: "https://github.com/smartdevicelink/bson_c_lib.git", from: "1.2.2")
],
targets: [
.target(
name: "SmartDeviceLink",
path: "SmartDeviceLink"
dependencies: ["BiSON"],
path: "SmartDeviceLink",
exclude: ["Info.plist"],
resources: [.process("Assets")],
publicHeadersPath: "public",
cSettings: [
.headerSearchPath("private")
]
),
.target(
name: "SmartDeviceLinkSwift",
dependencies: [
"SmartDeviceLink"
],
path: "SmartDeviceLinkSwift"
),
dependencies: ["SmartDeviceLink"],
path: "SmartDeviceLinkSwift",
exclude: ["Info.plist"]
)
]
)
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Accio supported](https://img.shields.io/badge/Accio-supported-0A7CF5.svg?style=flat)](https://github.com/JamitLabs/Accio)
[![Accio compatible](https://img.shields.io/badge/Accio-compatible-4BC51D.svg?style=flat)](https://github.com/JamitLabs/Accio)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/SmartDeviceLink-iOS.svg?style=flat)](https://cocoapods.org/pods/SmartDeviceLink-iOS)
[![CocoaPods Version](https://img.shields.io/cocoapods/v/SmartDeviceLink-iOS.svg?style=flat)](https://cocoapods.org/pods/SmartDeviceLink-iOS)
[![Swift Package Manager compatible](https://img.shields.io/badge/SPM-compatible-4BC51D.svg?style=flat)](https://github.com/apple/swift-package-manager)
[![License](https://img.shields.io/cocoapods/l/SmartDeviceLink-iOS.svg?style=flat)](https://cocoapods.org/pods/SmartDeviceLink-iOS)
![SmartDeviceLink Tests](https://github.com/smartdevicelink/sdl_ios/workflows/SmartDeviceLink%20Tests/badge.svg)
[![codecov](https://codecov.io/gh/smartdevicelink/sdl_ios/branch/master/graph/badge.svg)](https://codecov.io/gh/smartdevicelink/sdl_ios)
Expand All @@ -24,7 +25,7 @@ The mobile library component of SDL is meant to run on the end user’s smart-de
You can find guides and documentation on how to use this library at the [SmartDeviceLink website](https://smartdevicelink.com/en/guides/iOS/getting-started/installation/). You can find the upcoming releases roadmap at the [SDL Evolution Github](https://github.com/smartdevicelink/sdl_evolution#recent-and-upcoming-releases).

### Installing
To install this library as a framework in your app, see the [Installation Guide](https://smartdevicelink.com/en/guides/iOS/getting-started/installation/). There are instructions on how to install using the dependency managers CocoaPods, Carthage, and Accio, as well as how to install the library framework manually.
To install this library as a framework in your app, see the [Installation Guide](https://smartdevicelink.com/en/guides/iOS/getting-started/installation/). There are instructions on how to install using the dependency managers Accio, Carthage, CocoaPods, and Swift Package Manager, as well as how to install the library framework manually.

#### Adding a Dynamic Framework
Tagged to our releases is a dynamic framework file that can be drag-and-dropped into the application. Dynamic frameworks are supported on iOS 8+. **WARNING: You cannot submit your app to the app store with the framework as is. You MUST strip the simulator part of the framework first. Strip the x64 and i386 portions first like so:**
Expand Down Expand Up @@ -74,16 +75,9 @@ To run tests, you will need to bootstrap the Carthage testing libraries. To do s
Then, from the root project directory, run:
```bash
carthage bootstrap --platform ios
cd ../
```

At this point, you can run tests from Xcode, or, if you wish to run the tests exactly as they will be run on the CI server, run:

```bash
xcodebuild build-for-testing -project SmartDeviceLink-iOS.xcodeproj -destination platform=iOS Simulator,name=iPhone 11,OS=13.5 -scheme SmartDeviceLink

set -o pipefail && xcodebuild test-without-building -project SmartDeviceLink-iOS.xcodeproj -destination platform=iOS Simulator,name=iPhone 11,OS=13.5 -scheme SmartDeviceLink -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES
```
At this point, you can run tests from Xcode, or, if you wish to run the tests exactly as they will be run on the CI server, see the [YAML document](https://github.com/smartdevicelink/sdl_ios/blob/master/.github/workflows/test.yml) describing those tests. You can also check the [previously run CI tests](https://github.com/smartdevicelink/sdl_ios/actions?query=workflow%3A%22SmartDeviceLink+Tests%22) to see how they're currently being run.

##### Lock Screen Screenshot Tests
We run some additional tests using [iOSSnapshotTestCase](https://github.com/uber/ios-snapshot-test-case). These tests generate the lock screen view controller and compare it to generated screenshots. By default, the generated screenshots use the iPhone 11 simulator and if you run the unit tests on that simulator, the tests should pass by default.
Expand Down
4 changes: 2 additions & 2 deletions SmartDeviceLink-iOS.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|

s.name = "SmartDeviceLink-iOS"
s.version = "7.0.0-rc.2"
s.version = "7.0.0-rc.3"
s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
s.author = { "SmartDeviceLink Team" => "developer@smartdevicelink.com" }
s.platform = :ios, "10.0"
s.dependency 'BiSON', '~> 1.2.0'
s.dependency 'BiSON', '~> 1.2.2'
s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s }
s.requires_arc = true

Expand Down
Loading

0 comments on commit d57c95e

Please sign in to comment.