-
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.
- demo 앱을 빠르게 만들어줄 수 있도록 shell script와 Makefile을 손봤습니다.
- Loading branch information
Showing
6 changed files
with
141 additions
and
0 deletions.
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,52 @@ | ||
#!/bin/bash | ||
# Tuist Demo Module 생성을 편리하게 하고자 만들어진 스크립트 파일입니다. | ||
|
||
# Feature 이름 받기 | ||
read -p "만들고자 할 Demo모듈의 이름을 작성하세요: " name | ||
|
||
|
||
# 첫 글자가 대문자인 경우 소문자로 변환하여 enum case 변수 설정 | ||
if [[ $name =~ ^[A-Z] ]]; then | ||
enum_case_name="$(tr '[:upper:]' '[:lower:]' <<< ${name:0:1})${name:1}" | ||
else | ||
enum_case_name="$name" | ||
fi | ||
|
||
# 첫 글자가 소문자인 경우에만 대문자로 변환 | ||
if [[ $name =~ ^[a-z] ]]; then | ||
name="$(tr '[:lower:]' '[:upper:]' <<< ${name:0:1})${name:1}" | ||
fi | ||
|
||
|
||
tuist scaffold Demo --name "$name" | ||
|
||
# Project.swift 파일 생성 | ||
cat <<EOF > Projects/App/$name/Project.swift | ||
import DependencyPlugin | ||
import ProjectDescription | ||
import ProjectDescriptionHelpers | ||
let project = Project.makeModule( | ||
name: "${name}Demo", | ||
product: .app, | ||
dependencies: [ | ||
], | ||
resources: ["Resources/**"], | ||
infoPlist: .extendingDefault( | ||
with: [ | ||
"UILaunchStoryboardName": "LaunchScreen", | ||
"UIApplicationSceneManifest": [ | ||
"UIApplicationSupportsMultipleScenes": false, | ||
"UISceneConfigurations": [ | ||
"UIWindowSceneSessionRoleApplication": [ | ||
[ | ||
"UISceneConfigurationName": "Default Configuration", | ||
"UISceneDelegateClassName": "$(PRODUCT_MODULE_NAME).SceneDelegate", | ||
], | ||
], | ||
], | ||
], | ||
] | ||
) | ||
) | ||
EOF |
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,24 @@ | ||
import ProjectDescription | ||
|
||
private let nameAttribute = Template.Attribute.required("name") | ||
|
||
private let template = Template( | ||
description: "A template for a new module's demo target", | ||
attributes: [ | ||
nameAttribute | ||
], | ||
items: [ | ||
.file( | ||
path: "Projects/App/\(nameAttribute)/Resources/LaunchScreen.storyboard", | ||
templatePath: "LaunchScreen.stencil" | ||
), | ||
.file( | ||
path: "Projects/App/\(nameAttribute)/Sources/Application/AppDelegate.swift", | ||
templatePath: "AppDelegate.stencil" | ||
), | ||
.file( | ||
path: "Projects/App/\(nameAttribute)/Sources/Application/SceneDelegate.swift", | ||
templatePath: "SceneDelegate.stencil" | ||
) | ||
] | ||
) |
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,13 @@ | ||
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 } | ||
let navigationController = UINavigationController() | ||
window = UIWindow(windowScene: windowScene) | ||
window?.rootViewController = navigationController | ||
window?.makeKeyAndVisible() | ||
} | ||
} |