Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/0.3.0' into versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Nov 3, 2020
2 parents 8c3927d + 60fe24b commit c6fa1ca
Show file tree
Hide file tree
Showing 50 changed files with 1,079 additions and 2,459 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches: [main, versions]

pull_request:
branches: [main]

jobs:
cancel-previous-runs:
runs-on: ubuntu-latest

steps:
- name: Cancel previous runs of this workflow on same branch
uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

swiftlint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run SwiftLint
uses: norio-nomura/[email protected]
with:
args: --strict

test-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run tests
run: swift test -v

test-macos:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v2

- name: Run tests
run: swift test -v
30 changes: 29 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## macOS
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
Expand Down Expand Up @@ -64,4 +92,4 @@ Carthage/Cachefile
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/test_output
16 changes: 16 additions & 0 deletions .sourcery/LinuxMain.stencil
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@testable import MicroyaTests
import XCTest

// swiftlint:disable line_length file_length

{% for type in types.classes|based:"XCTestCase" %}
extension {{ type.name }} {
static var allTests: [(String, ({{ type.name }}) -> () throws -> Void)] = [
{% for method in type.methods where method.parameters.count == 0 and method.shortName|hasPrefix:"test" and method|!annotated:"skipTestOnLinux" %} ("{{ method.shortName }}", {{ method.shortName }}){% if not forloop.last %},{% endif %}
{% endfor %}]
}

{% endfor %}
XCTMain([
{% for type in types.classes|based:"XCTestCase" %} testCase({{ type.name }}.allTests){% if not forloop.last %},{% endif %}
{% endfor %}])
19 changes: 7 additions & 12 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ opt_in_rules:
- modifier_order
- multiline_arguments
- multiline_arguments_brackets
- multiline_function_chains
- multiline_literal_brackets
- multiline_parameters
- multiline_parameters_brackets
Expand All @@ -53,7 +52,6 @@ opt_in_rules:
- sorted_first_last
- sorted_imports
- switch_case_on_newline
- trailing_closure
- type_contents_order
- unavailable_function
- unneeded_parentheses_in_closure_argument
Expand All @@ -71,7 +69,7 @@ disabled_rules:
- type_name

included:
- Frameworks
- Sources
- Tests

excluded:
Expand All @@ -86,15 +84,8 @@ explicit_type_interface:
excluded:
- local

file_header:
required_pattern: |
\/\/
\/\/ Created by [^\(\)\d\n]+ on \S{6,10}\.
\/\/ Copyright © \d{4} Flinesoft\. All rights reserved\.
\/\/
file_name:
suffix_pattern: "Extensions?|\\+.*"
suffix_pattern: "Ext?|\\+.*"

file_types_order:
order:
Expand All @@ -106,7 +97,11 @@ identifier_name:
excluded:
- id

line_length: 160
large_tuple:
warning: 3
error: 5

line_length: 140

type_contents_order:
order:
Expand Down
59 changes: 36 additions & 23 deletions ...eddata/xcschemes/Microya watchOS.xcscheme → ...e/xcshareddata/xcschemes/Microya.xcscheme
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -14,10 +14,24 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A102BD941F02358E000C6B38"
BuildableName = "Microya.framework"
BlueprintName = "Microya watchOS"
ReferencedContainer = "container:Microya.xcodeproj">
BlueprintIdentifier = "Microya"
BuildableName = "Microya"
BlueprintName = "Microya"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MicroyaTests"
BuildableName = "MicroyaTests"
BlueprintName = "MicroyaTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -26,11 +40,21 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
language = "en"
region = "US">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MicroyaTests"
BuildableName = "MicroyaTests"
BlueprintName = "MicroyaTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -42,17 +66,6 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A102BD941F02358E000C6B38"
BuildableName = "Microya.framework"
BlueprintName = "Microya watchOS"
ReferencedContainer = "container:Microya.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -63,10 +76,10 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A102BD941F02358E000C6B38"
BuildableName = "Microya.framework"
BlueprintName = "Microya watchOS"
ReferencedContainer = "container:Microya.xcodeproj">
BlueprintIdentifier = "Microya"
BuildableName = "Microya"
BlueprintName = "Microya"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
### Security
- None.

## [0.3.0] - 2020-11-03
### Added
- New `ApiProvider` type encapsulating different request methods with support for plugins.
- New asynchronous `performRequest` methods with completion callbacks. ([#2](https://github.com/Flinesoft/Microya/issues/2))
- New `Plugin` class to subclass for integrating into the networking logic via callbacks.
- New pre-implemented plugins: `HttpBasicAuth`, `ProgressIndicator`, `RequestLogger`, `ResponseLogger`.
- New `EmptyResponseBody` type to use whenever the body is expected to be empty or should be ignored.
### Changed
- Renamed `JsonApi` protocol to `Endpoint`.
- Renamed `Method` to `HttpMethod` and added `body: Data` to the cases `post` and `patch`.
- Moved the `request` method from `JsonApi` to the new `ApiProvider` & renamed to `performRequestAndWait`.
- Generally improved the cases in `JsonApiError` & renamed the type to `ApiError`.
- Moved CI from [Bitrise](https://www.bitrise.io/) to [GitHub Actions](https://github.com/Flinesoft/Microya/actions).
### Removed
- The `bodyData: Data?` requirement on `JsonApi` (bodies are not part of `HttpMethod`, see above).
- Installation is no longer possible via [CocoaPods](https://github.com/CocoaPods/CocoaPods) or [Carthage](https://github.com/Carthage/Carthage). Please use [SwiftPM](https://github.com/apple/swift-package-manager) instead.

## [0.2.0] - 2020-08-15
### Changed
- Make some fields of the `JsonApi` protocol optional by providing default implementation.
Expand Down
5 changes: 0 additions & 5 deletions Cartfile

This file was deleted.

Empty file removed Cartfile.resolved
Empty file.
Empty file removed Frameworks/Microya/Globals/.keep
Empty file.
Loading

0 comments on commit c6fa1ca

Please sign in to comment.