-
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.
[CAT-201] Xcode FileTemplate 추가 (#23)
- Loading branch information
1 parent
eb8b3ec
commit 44ce8ef
Showing
8 changed files
with
176 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
FileTemplate/TCA.xctemplate/Default/___FILEBASENAME___Core.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,30 @@ | ||
//___FILEHEADER___ | ||
|
||
import ComposableArchitecture | ||
|
||
@Reducer | ||
struct ___VARIABLE_productName___Core { | ||
@ObservableState | ||
struct State: Equatable { | ||
<#properties#> | ||
} | ||
|
||
enum Action { | ||
<#case#> | ||
} | ||
|
||
<#@Dependency() var#> | ||
|
||
init() {} | ||
|
||
var body: some ReducerOf<Self> { | ||
Reduce(self.core) | ||
} | ||
|
||
private func core(state: inout State, action: Action) -> EffectOf<Self> { | ||
switch action { | ||
case <#pattern#>: | ||
<#code#> | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
FileTemplate/TCA.xctemplate/Default/___FILEBASENAME___View.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,19 @@ | ||
//___FILEHEADER___ | ||
|
||
import SwiftUI | ||
|
||
import DesignSystem | ||
|
||
import ComposableArchitecture | ||
|
||
struct ___FILEBASENAME___: View { | ||
@Bindable var store: StoreOf<___VARIABLE_productName___Core> | ||
|
||
init(store: StoreOf<___VARIABLE_productName___Core>) { | ||
self.store = store | ||
} | ||
|
||
var body: some View { | ||
<#code#> | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
FileTemplate/TCA.xctemplate/Public/___FILEBASENAME___Core.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,30 @@ | ||
//___FILEHEADER___ | ||
|
||
import ComposableArchitecture | ||
|
||
@Reducer | ||
public struct ___VARIABLE_productName___Core { | ||
@ObservableState | ||
public struct State: Equatable { | ||
<#properties#> | ||
} | ||
|
||
public enum Action { | ||
<#case#> | ||
} | ||
|
||
<#@Dependency() var#> | ||
|
||
public init() {} | ||
|
||
public var body: some ReducerOf<Self> { | ||
Reduce(self.core) | ||
} | ||
|
||
private func core(state: inout State, action: Action) -> EffectOf<Self> { | ||
switch action { | ||
case <#pattern#>: | ||
<#code#> | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
FileTemplate/TCA.xctemplate/Public/___FILEBASENAME___View.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,19 @@ | ||
//___FILEHEADER___ | ||
|
||
import SwiftUI | ||
|
||
import DesignSystem | ||
|
||
import ComposableArchitecture | ||
|
||
public struct ___FILEBASENAME___: View { | ||
@Bindable var store: StoreOf<___VARIABLE_productName___Core> | ||
|
||
public init(store: StoreOf<___VARIABLE_productName___Core>) { | ||
self.store = store | ||
} | ||
|
||
public var body: some View { | ||
<#code#> | ||
} | ||
} |
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,57 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Kind</key> | ||
<string>Xcode.IDEFoundation.TextSubstitutionFileTemplateKind</string> | ||
<key>Summary</key> | ||
<string>TCA file template</string> | ||
<key>Description</key> | ||
<string>TCA file template</string> | ||
<key>SortOrder</key> | ||
<string>1</string> | ||
<key>AllowedTypes</key> | ||
<array> | ||
<string>public.swift-source</string> | ||
</array> | ||
<key>DefaultCompletionName</key> | ||
<string>View</string> | ||
<key>MainTemplateFiles</key> | ||
<string>___FILEBASENAME___.swift</string> | ||
<key>Platforms</key> | ||
<array> | ||
<string>com.apple.platform.iphoneos</string> | ||
</array> | ||
<key>Options</key> | ||
<array> | ||
<dict> | ||
<key>Identifier</key> | ||
<string>productName</string> | ||
<key>Required</key> | ||
<string>true</string> | ||
<key>Name</key> | ||
<string>{Name}View, {Name}Core</string> | ||
<key>Description</key> | ||
<string></string> | ||
<key>Type</key> | ||
<string>text</string> | ||
<key>NotPersisted</key> | ||
<string>true</string> | ||
</dict> | ||
<dict> | ||
<key>Identifier</key> | ||
<string>Public</string> | ||
<key>Required</key> | ||
<string>false</string> | ||
<key>Name</key> | ||
<string>Make Public</string> | ||
<key>Description</key> | ||
<string></string> | ||
<key>Type</key> | ||
<string>checkbox</string> | ||
<key>NotPersisted</key> | ||
<string>true</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</plist> |
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,19 @@ | ||
#!/usr/bin/env sh | ||
|
||
XCODE_TEMPLATE_DIR=$HOME'/Library/Developer/Xcode/Templates/File Templates/PomoNyang' | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
xcodeTemplate () { | ||
echo "==> Copying up templates..." | ||
|
||
if [ -d "$XCODE_TEMPLATE_DIR" ]; then | ||
rm -R "$XCODE_TEMPLATE_DIR" | ||
fi | ||
mkdir -p "$XCODE_TEMPLATE_DIR" | ||
|
||
cp -R $SCRIPT_DIR/*.xctemplate "$XCODE_TEMPLATE_DIR" | ||
} | ||
|
||
xcodeTemplate | ||
|
||
echo "==> ... success!" |
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 |
---|---|---|
|
@@ -48,4 +48,4 @@ graph: | |
|
||
.PHONY: template | ||
template: | ||
sh file_template/install_template.sh | ||
sh FileTemplate/install_template.sh |
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