Skip to content

Commit

Permalink
Merge pull request #16 from HelioMesquita/feature/moving_framework_to…
Browse files Browse the repository at this point in the history
…_spm

Start using SPM to modularization
  • Loading branch information
HelioMesquita committed Apr 2, 2024
2 parents 8784cd6 + 34e7715 commit 54290e7
Show file tree
Hide file tree
Showing 97 changed files with 225 additions and 331 deletions.
22 changes: 0 additions & 22 deletions Infrastructure/Resources/Info.plist

This file was deleted.

19 changes: 0 additions & 19 deletions Infrastructure/Resources/Infrastructure.h

This file was deleted.

19 changes: 0 additions & 19 deletions Infrastructure/Utils/Bundle+Utils.swift

This file was deleted.

22 changes: 0 additions & 22 deletions InfrastructureTests/Info.plist

This file was deleted.

8 changes: 8 additions & 0 deletions NetworkLayer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
/.build
/Packages
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
27 changes: 27 additions & 0 deletions NetworkLayer/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "NetworkLayer",
defaultLocalization: "en",
platforms: [
.iOS(.v15)
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "NetworkLayer",
targets: ["NetworkLayer"]),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "NetworkLayer"),
.testTarget(
name: "NetworkLayerTests",
dependencies: ["NetworkLayer"]),
]
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import XCTest

@testable import Visual
@testable import NetworkLayer

class BundleTests: XCTestCase {

func testReturnsModuleName() {
XCTAssertEqual(
Bundle.module.bundleIdentifier, "com.visual")
Bundle.module.bundleIdentifier, "NetworkLayer-NetworkLayer-resources")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

@testable import Infrastructure
@testable import NetworkLayer

class MockProvider: RequestProviderProtocol {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import XCTest

@testable import Infrastructure
@testable import NetworkLayer

class RequestErrorTests: XCTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import XCTest

@testable import Infrastructure
@testable import NetworkLayer

class RequestProviderProtocolTests: XCTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import XCTest

@testable import Infrastructure
@testable import NetworkLayer

class ServiceProviderProtocolTests: XCTestCase {

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![SPM](https://img.shields.io/badge/spm-compatible-blue.svg?style=flat)](https://www.apple.com)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/HelioMesquita/Swiftmazing/blob/master/LICENSE)

A iOS application with layout based on App Store that can check the most starred and last updated Swift repository. It was developed in a modular way, with their respective tests, using the modern collection view
A iOS application with layout based on App Store that can check the most starred and last updated Swift repository. It was developed in a modular way using SPM, with their respective tests and using the modern collection view


## Features
Expand All @@ -20,7 +20,7 @@ A iOS application with layout based on App Store that can check the most starred
<img src="https://github.com/HelioMesquita/Swiftmazing/blob/master/.assets/appscreendark.png" align="right"
title="App preview dark mode" width="220 " height="476">

* Modularization
* Modularization using SPM
* Xcodegen
* CLEAN Swift Architecture (VIP)
* Modern Collection View
Expand All @@ -33,7 +33,6 @@ A iOS application with layout based on App Store that can check the most starred
* Internationalization (English and PT-Br)
* Unit tests
* Snapshots Tests
* Functional Tests
* Await/Async Request

### Prerequisites
Expand All @@ -43,7 +42,7 @@ A iOS application with layout based on App Store that can check the most starred

### Installing

First of all download and install Xcode, Cocoapods and xcodegen, then clone the repository
First of all download and install Xcode, and Xcodegen, then clone the repository

```
https://github.com/HelioMesquita/Swiftmazing.git
Expand All @@ -60,9 +59,10 @@ Open the directory project and double tap on Swiftmazing.xcodeproj
## Running the tests

For each scheme in project run some tests targets
* The Visual scheme runs the snapshots tests for all views and view controllers
* The Infrastructure scheme runs the unit tests for all network tests
* The Swiftmazing scheme runs the unit tests for all bussiness and presentation rules
* The Swiftmazing scheme runs the unit tests for all business and presentation rules
* The UIComponents scheme runs the snapshot tests for all views and view controllers
* The NetworkLayer scheme runs the unit tests for all network tests


## Built With

Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import UIKit
import Visual
import UIComponents

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Infrastructure/RequestProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import Infrastructure
import NetworkLayer

extension RequestProviderProtocol {

Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Infrastructure/ServiceProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import Infrastructure
import NetworkLayer

class ServiceProvider: ServiceProviderProtocol {

Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Infrastructure/ServiceProviderMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import Infrastructure
import NetworkLayer

class ServiceProvider: ServiceProviderProtocol {

Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/Feed/FeedInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// This tag below is used to create the testable files from the Cuckoo pod
// CUCKOO_TESTABLE

import Infrastructure
import NetworkLayer
import UIKit

protocol FeedBusinessLogic {
Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/Feed/FeedModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//

import UIKit
import Visual
import UIComponents

enum Feed {

Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/Feed/FeedViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//

import UIKit
import Visual
import UIComponents

protocol FeedDisplayLogic: AlertDisplayLogic {
func show(_ viewModel: Feed.ViewModel)
Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/List/ListInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// This tag below is used to create the testable files from the Cuckoo pod
// CUCKOO_TESTABLE

import Infrastructure
import NetworkLayer
import UIKit

protocol ListBusinessLogic {
Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/List/ListModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//

import UIKit
import Visual
import UIComponents

enum List {

Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/List/ListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//

import UIKit
import Visual
import UIComponents

protocol ListDisplayLogic: AlertDisplayLogic {
func showTitle(_ title: String)
Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/Models/RepositoriesBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import Infrastructure
import NetworkLayer

class RepositoryBuilder: BuilderProviderProtocol {

Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/Models/RepositoriesRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import Infrastructure
import NetworkLayer

enum Filter: String {
case stars
Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/Models/RepositoriesResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import Infrastructure
import NetworkLayer

struct RepositoriesResponse: RequestDecodable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//

import UIKit
import Visual
import UIComponents

protocol RepositoryDetailDisplayLogic: AnyObject {
func showImage(_ imageURL: URL)
Expand Down
2 changes: 1 addition & 1 deletion Swiftmazing/Scenes/Worker/RepositoriesWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// CUCKOO_TESTABLE

import Foundation
import Infrastructure
import NetworkLayer

class RepositoriesWorker {

Expand Down
8 changes: 8 additions & 0 deletions UIComponents/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
/.build
/Packages
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
Loading

0 comments on commit 54290e7

Please sign in to comment.