Skip to content

Commit

Permalink
Merge pull request #234 from nimblehq/release/3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
suho authored Nov 29, 2021
2 parents 4e3cee4 + ea2109a commit e56fdc5
Show file tree
Hide file tree
Showing 22 changed files with 80 additions and 46 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish_docs_to_wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish docs to Wiki

on:
push:
paths:
- docs/**
branches:
- main

env:
USER_TOKEN: ${{ secrets.NIMBLE_DEV_TOKEN }}
USER_NAME: team-nimblehq
USER_EMAIL: [email protected]
OWNER: ${{ github.event.repository.owner.name }}
REPOSITORY_NAME: ${{ github.event.repository.name }}

jobs:
publish_docs_to_wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Pull wiki
run: |
mkdir tmp_wiki
cd tmp_wiki
git init
git config user.name $USER_NAME
git config user.email $USER_EMAIL
git pull https://[email protected]/$OWNER/$REPOSITORY_NAME.wiki.git
- name: Push wiki
run: |
rsync -av --delete docs/ tmp_wiki/ --exclude .git
cd tmp_wiki
git add .
git commit -m "Update Wiki content"
git push -f --set-upstream https://[email protected]/$OWNER/$REPOSITORY_NAME.wiki.git master
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.0
1 change: 1 addition & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
--disable wrapMultilineStatementBraces
--disable wrapSwitchCases
--disable blankLinesAtStartOfScope
--stripunusedargs closure-only
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ included:

excluded:
- {PROJECT_NAME}Tests/Sources/Mocks/Sourcery/AutoMockable.generated.swift
- {PROJECT_NAME}/Sources/Supports/Helpers/R.swift/R.generated.swift
- {PROJECT_NAME}/Sources/Supports/Helpers/Rswift/R.generated.swift
- Pods
- Derived
- DerivedData
Expand Down
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
platform :ios, '11.0'
use_frameworks!
inhibit_all_warnings!

def testing_pods
pod 'Quick'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ extension TargetAction {
public static func rswiftAction() -> TargetAction {
let rswiftPath = "$PODS_ROOT/R.swift/rswift"
let inputPath = "$TEMP_DIR/rswift-lastrun"
let outputPath = "$SRCROOT/$PROJECT_NAME/Sources/Supports/Helpers/R.swift/R.generated.swift"
let outputPath = "$SRCROOT/$PROJECT_NAME/Sources/Supports/Helpers/Rswift/R.generated.swift"
return .pre(
script: "\"\(rswiftPath)\" generate \"\(outputPath)\"",
name: "R.swift",
inputPaths: ["\(inputPath)"],
outputPaths: ["\(outputPath)"],
basedOnDependencyAnalysis: true
basedOnDependencyAnalysis: false
)
}

Expand Down Expand Up @@ -78,7 +77,7 @@ extension TargetAction {
;;
esac
"""

return .post(
script: script,
name: "Copy GoogleService-Info.plist",
Expand Down
5 changes: 5 additions & 0 deletions docs/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Nimble iOS Templates

This wiki contains documentation about our optimized iOS template.

If you want to understand our templates, let's jump into [[Getting Started]].
1 change: 1 addition & 0 deletions docs/_Footer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This project is maintained and funded by Nimble.
1 change: 1 addition & 0 deletions docs/_Sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [[Home]]
19 changes: 4 additions & 15 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,6 @@ default_platform(:ios)
platform :ios do
# Testing

desc 'Build for testing'
lane :build_for_testing do
test_manager.build(scheme: Constants.TESTS_SCHEME)
end

desc 'Run tests'
lane :tests do
test_manager.test(
scheme: Constants.TESTS_SCHEME,
targets: [Constants.TESTS_TARGET, Constants.UI_TESTS_TARGET]
)
end

desc 'Run xcov'
lane :run_xcov do
clear_derived_data(derived_data_path: Constants.XCOV_OUTPUT_DIRECTORY_PATH)
Expand All @@ -76,8 +63,10 @@ platform :ios do

desc 'Build and Test'
lane :build_and_test do
build_for_testing
tests
test_manager.build_and_test(
scheme: Constants.TESTS_SCHEME,
targets: [Constants.TESTS_TARGET, Constants.UI_TESTS_TARGET]
)
end

# Code Sign
Expand Down
17 changes: 1 addition & 16 deletions fastlane/Managers/TestManager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,13 @@ def initialize(fastlane:, device:, output_directory:)
@output_directory = output_directory
end

def build(scheme:)
def build_and_test(scheme:, targets:)
@fastlane.scan(
scheme: scheme,
device: @device,
output_directory: @output_directory,
code_coverage: true,
result_bundle: true,
build_for_testing: true,
should_zip_build_products: true,
clean: true,
fail_build: false
)
end

def test(scheme:, targets:)
@fastlane.scan(
scheme: scheme,
device: @device,
output_directory: @output_directory,
code_coverage: true,
result_bundle: true,
test_without_building: true,
only_testing: targets,
fail_build: false
)
Expand Down
6 changes: 5 additions & 1 deletion make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ rename_folder "${CONSTANT_PROJECT_NAME}" "${PROJECT_NAME_NO_SPACES}"
mkdir -p "${PROJECT_NAME_NO_SPACES}Tests/Sources/Mocks/Sourcery"
touch "${PROJECT_NAME_NO_SPACES}Tests/Sources/Mocks/Sourcery/AutoMockable.generated.swift"

# Add R.generated.swift file
mkdir -p "${PROJECT_NAME_NO_SPACES}/Sources/Supports/Helpers/Rswift"
touch "${PROJECT_NAME_NO_SPACES}/Sources/Supports/Helpers/Rswift/R.generated.swift"

echo "✅ Completed"

# Search and replace in files
Expand Down Expand Up @@ -163,4 +167,4 @@ rm -rf .github/workflows/test_install_script.yml
echo "✅ Completed"

# Done!
echo "=> 🚀 Done! App is ready to be tested 🙌"
echo "=> 🚀 Done! App is ready to be tested 🙌"
3 changes: 2 additions & 1 deletion {PROJECT_NAME}/Sources/Constants/Constants+API.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// swiftlint:disable:this file_name
//
// Constants+API.swift
//

extension Constants.API { }
extension Constants.API {}
2 changes: 1 addition & 1 deletion {PROJECT_NAME}/Sources/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

enum Constants {

enum API { }
enum API {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// NetworkAPIProtocol.swift
//

import RxSwift
import Alamofire
import RxAlamofire
import RxSwift

protocol NetworkAPIProtocol {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// RequestConfiguration.swift
//

import Foundation
import Alamofire
import Foundation

protocol RequestConfiguration {

Expand Down
2 changes: 1 addition & 1 deletion {PROJECT_NAME}/Sources/Data/NetworkAPI/NetworkAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// NetworkAPI.swift
//

import Foundation
import Alamofire
import Foundation
import RxSwift

final class NetworkAPI: NetworkAPIProtocol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// UseCaseFactoryProtocol.swift
//

protocol UseCaseFactoryProtocol: AnyObject { }
protocol UseCaseFactoryProtocol: AnyObject {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ extension Navigator {

enum Scene {
// Define scene
case home
}
}
8 changes: 5 additions & 3 deletions {PROJECT_NAME}/Sources/Presentation/Navigator/Navigator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ protocol Navigatable: AnyObject {
final class Navigator {

private func viewController(from scene: Scene) -> UIViewController {
#warning("Create view controllers here")
return HomeViewController()
switch scene {
case .home:
return HomeViewController()
}
}
}

extension Navigator: Navigatable {

func show(scene: Scene, sender: UIViewController?, transition: Transition) {
let target = viewController(from: scene)
if case .root(let window) = transition {
if case let .root(window) = transition {
let snapshotOverlayView = UIScreen.main.snapshotView(afterScreenUpdates: false)
target.view.addSubview(snapshotOverlayView)
window?.rootViewController = target
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// swiftlint:disable:this file_name
//
// UIColor+Application.swift
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// swiftlint:disable:this file_name
//
// Typealiases.swift
//
Expand Down

0 comments on commit e56fdc5

Please sign in to comment.