-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: Tuist를 통한 WeTri App Project 생성 * build: SwiftLint, SwiftFormat 적용 --------- Co-authored-by: JongPyoAhn <[email protected]>
- Loading branch information
1 parent
16c657d
commit ffafffe
Showing
16 changed files
with
392 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--swiftversion 5.9 | ||
|
||
# format options | ||
|
||
--indent 2 | ||
--selfrequired | ||
--importgrouping alpha | ||
--enable acronyms | ||
--acronyms "URL, ID, UUID" | ||
--enable blankLineAfterImports | ||
--enable blankLinesAroundMark | ||
--enable blockComments | ||
--enable docComments | ||
--enable isEmpty | ||
--enable markTypes | ||
--enable sortedSwitchCases | ||
--enable wrapEnumCases | ||
--enable wrapSwitchCases | ||
|
||
--disable wrapMultilineStatementBraces | ||
--disable andOperator | ||
--disable redundantReturn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
only_rules: | ||
- colon | ||
- fatal_error_message | ||
- implicitly_unwrapped_optional | ||
- legacy_cggeometry_functions | ||
- legacy_constant | ||
- legacy_constructor | ||
- legacy_nsgeometry_functions | ||
- operator_usage_whitespace | ||
- return_arrow_whitespace | ||
- trailing_newline | ||
- unused_optional_binding | ||
- vertical_whitespace | ||
- void_return | ||
- unowned_variable_capture | ||
- custom_rules | ||
|
||
excluded: | ||
- Carthage | ||
- Pods | ||
- .build | ||
|
||
colon: | ||
apply_to_dictionaries: false | ||
|
||
indentation: 2 | ||
|
||
custom_rules: | ||
no_objcMembers: | ||
name: "@objcMembers" | ||
regex: "@objcMembers" | ||
message: "Explicitly use @objc on each member you want to expose to Objective-C" | ||
severity: error | ||
no_direct_standard_out_logs: | ||
name: "Writing log messages directly to standard out is disallowed" | ||
regex: "(\\bprint|\\bdebugPrint|\\bdump|Swift\\.print|Swift\\.debugPrint|Swift\\.dump)\\s*\\(" | ||
match_kinds: | ||
- identifier | ||
message: "Don't commit `print(…)`, `debugPrint(…)`, or `dump(…)` as they write to standard out in release. Either log to a dedicated logging system or silence this warning in debug-only scenarios explicitly using `// swiftlint:disable:next no_direct_standard_out_logs`" | ||
severity: error | ||
no_file_literal: | ||
name: "#file is disallowed" | ||
regex: "(\\b#file\\b)" | ||
match_kinds: | ||
- identifier | ||
message: "Instead of #file, use #fileID" | ||
severity: error | ||
no_filepath_literal: | ||
name: "#filePath is disallowed" | ||
regex: "(\\b#filePath\\b)" | ||
match_kinds: | ||
- identifier | ||
message: "Instead of #filePath, use #fileID." | ||
severity: error | ||
no_unchecked_sendable: | ||
name: "`@unchecked Sendable` is discouraged." | ||
regex: "@unchecked Sendable" | ||
match_kinds: | ||
- attribute.builtin | ||
- typeidentifier | ||
message: "Instead of using `@unchecked Sendable`, consider a safe alternative like a standard `Sendable` conformance or using `@preconcurrency import`. If you really must use `@unchecked Sendable`, you can add a `// swiftlint:disable:next no_unchecked_sendable` annotation with an explanation for how we know the type is thread-safe, and why we have to use @unchecked Sendable instead of Sendable. More explanation and suggested safe alternatives are available at https://github.com/airbnb/swift#unchecked-sendable." | ||
severity: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// swift-tools-version: 5.8 | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "MyPlugin", | ||
products: [ | ||
.executable(name: "tuist-my-cli", targets: ["tuist-my-cli"]), | ||
], | ||
targets: [ | ||
.executableTarget( | ||
name: "tuist-my-cli" | ||
), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ProjectDescription | ||
|
||
let plugin = Plugin(name: "MyPlugin") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Foundation | ||
|
||
public struct LocalHelper { | ||
let name: String | ||
|
||
public init(name: String) { | ||
self.name = name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print("Hello, from your Tuist Task") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Project.swift | ||
// ProjectDescriptionHelpers | ||
// | ||
// Created by 홍승현 on 11/10/23. | ||
// | ||
|
||
import ProjectDescription | ||
import ProjectDescriptionHelpers | ||
|
||
let project = Project.makeModule( | ||
name: "WeTri", | ||
product: .app, | ||
resources: ["Resources/**"], | ||
infoPlist: .extendingDefault( | ||
with: [ | ||
"UILaunchStoryboardName": "LaunchScreen", | ||
"UIApplicationSceneManifest": [ | ||
"UIApplicationSupportsMultipleScenes": false, | ||
"UISceneConfigurations": [ | ||
"UIWindowSceneSessionRoleApplication": [ | ||
[ | ||
"UISceneConfigurationName": "Default Configuration", | ||
"UISceneDelegateClassName": "$(PRODUCT_MODULE_NAME).SceneDelegate", | ||
], | ||
], | ||
], | ||
], | ||
] | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--View Controller--> | ||
<scene sceneID="EHf-IW-A2E"> | ||
<objects> | ||
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="53" y="375"/> | ||
</scene> | ||
</scenes> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import UIKit | ||
|
||
@main | ||
final class AppDelegate: UIResponder, UIApplicationDelegate { | ||
func application( | ||
_: UIApplication, | ||
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil | ||
) | ||
-> Bool { | ||
return true | ||
} | ||
|
||
func application( | ||
_: UIApplication, | ||
configurationForConnecting connectingSceneSession: UISceneSession, | ||
options _: UIScene.ConnectionOptions | ||
) | ||
-> UISceneConfiguration { | ||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// SceneDelegate.swift | ||
// WeTri | ||
// | ||
// Created by 홍승현 on 11/10/23. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
final class SceneDelegate: UIResponder, UIWindowSceneDelegate { | ||
var window: UIWindow? | ||
|
||
func scene(_ scene: UIScene, willConnectTo _: UISceneSession, options _: UIScene.ConnectionOptions) { | ||
guard let windowScene = scene as? UIWindowScene else { return } | ||
window = UIWindow(windowScene: windowScene) | ||
window?.rootViewController = ViewController() | ||
window?.makeKeyAndVisible() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// ViewController.swift | ||
// WeTri | ||
// | ||
// Created by 홍승현 on 11/10/23. | ||
// Copyright © 2023 kr.codesquad.boostcamp8. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
final class ViewController: UIViewController { | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
view.backgroundColor = .systemBackground | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ProjectDescription | ||
|
||
let config = Config() |
85 changes: 85 additions & 0 deletions
85
iOS/Tuist/ProjectDescriptionHelpers/Project+Templates.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import ProjectDescription | ||
|
||
public extension Project { | ||
static func makeModule( | ||
name: String, | ||
platform: Platform = .iOS, | ||
product: Product, | ||
organizationName: String = "kr.codesquad.boostcamp8", | ||
packages: [Package] = [], | ||
deploymentTarget: DeploymentTarget? = .iOS(targetVersion: "16.0", devices: [.iphone]), | ||
dependencies: [TargetDependency] = [], | ||
sources: SourceFilesList = ["Sources/**"], | ||
resources: ResourceFileElements? = nil, | ||
infoPlist: InfoPlist = .default, | ||
isTestable: Bool = false) | ||
-> Project { | ||
|
||
let settings: Settings = .settings( | ||
base: [:], | ||
configurations: [ | ||
.debug(name: .debug), | ||
.release(name: .release) | ||
], | ||
defaultSettings: .recommended) | ||
|
||
let appTarget = Target( | ||
name: name, | ||
platform: platform, | ||
product: product, | ||
bundleId: "\(organizationName).\(name)", | ||
deploymentTarget: deploymentTarget, | ||
infoPlist: infoPlist, | ||
sources: sources, | ||
resources: resources, | ||
scripts: [.swiftLint, .swiftFormat], | ||
dependencies: dependencies) | ||
|
||
let schemes: [Scheme] = [.makeScheme(target: .debug, name: name)] | ||
|
||
var targets: [Target] = [appTarget] | ||
|
||
if isTestable { | ||
let testTarget = Target( | ||
name: "\(name)Tests", | ||
platform: platform, | ||
product: .unitTests, | ||
bundleId: "\(organizationName).\(name)Tests", | ||
deploymentTarget: deploymentTarget, | ||
infoPlist: .default, | ||
sources: ["Tests/**"], | ||
dependencies: [.target(name: name)] | ||
) | ||
|
||
targets.append(testTarget) | ||
} | ||
|
||
return Project( | ||
name: name, | ||
organizationName: organizationName, | ||
packages: packages, | ||
settings: settings, | ||
targets: targets, | ||
schemes: schemes) | ||
} | ||
} | ||
|
||
extension Scheme { | ||
///Scheme을 만드는 메소드 | ||
static func makeScheme(target: ConfigurationName, name: String) -> Scheme { | ||
return Scheme( | ||
name: name, | ||
shared: true, | ||
buildAction: .buildAction(targets: ["\(name)"]), | ||
testAction: .targets( | ||
["\(name)Tests"], | ||
configuration: target, | ||
options: .options(coverage: true, codeCoverageTargets: ["\(name)"]) | ||
), | ||
runAction: .runAction(configuration: target), | ||
archiveAction: .archiveAction(configuration: target), | ||
profileAction: .profileAction(configuration: target), | ||
analyzeAction: .analyzeAction(configuration: target) | ||
) | ||
} | ||
} |
Oops, something went wrong.