Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ”€ :: GraphQL ์„ธํŒ… #149

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public extension TargetDependency {
}

public extension TargetDependency.SPM {
static let Apollo = TargetDependency.external(name: "Apollo")
static let Lottie = TargetDependency.external(name: "Lottie")
static let TagLayoutView = TargetDependency.external(name: "TagLayoutView")
static let NukeUI = TargetDependency.external(name: "NukeUI")
Expand Down
2 changes: 1 addition & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let settings: Settings =
configurations: configurations,
defaultSettings: .recommended)

let scripts: [TargetScript] = isCI ? [] : [.swiftLint, .needle]
let scripts: [TargetScript] = isCI ? [] : [.swiftLint, .needle, .apolloGraphQL]

let targets: [Target] = [
.init(
Expand Down
3 changes: 2 additions & 1 deletion Projects/Domain/BaseDomain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ let project = Project.makeModule(
product: .framework,
targets: [.unitTest],
externalDependencies: [
.SPM.Emdpoint
.SPM.Emdpoint,
.SPM.Apollo
],
internalDependencies: [
.Core.JwtStoreInterface,
Expand Down
25 changes: 25 additions & 0 deletions Scripts/GenerateApolloGraphQLAPI.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Don't run this during index builds
if [ $ACTION = "indexbuild" ]; then exit 0; fi

# Go to the build root and search up the chain to find the Derived Data Path where the source packages are checked out.
PROJECT_ROOT="$(dirname ${SRCROOT})"
DERIVED="$(dirname ${PROJECT_ROOT})"
DERIVED_DATA_CANDIDATE="${DERIVED}/Tuist/Dependencies/SwiftPackageManager/.build"

if [ -z "${DERIVED_DATA_CANDIDATE}" ]; then
echo >&2 "error: Couldn't find the Apollo-iOS dependency; make sure to run 'tuist fetch'"
exit 1
fi

# Grab a reference to the directory where scripts are checked out
SCRIPT_PATH="${DERIVED_DATA_CANDIDATE}/checkouts/apollo-ios/scripts"

if [ -z "${SCRIPT_PATH}" ]; then
echo >&2 "error: Couldn't find the CLI script in your checked out SPM packages; make sure to add the framework to your project."
exit 1
fi

cd "${PROJECT_ROOT}/Domain"
# Scheme๊ฐ€ ์ถ”๊ฐ€๋ ๋•Œ ์•„๋ž˜ script ๋ณต์‚ฌํ•ด์„œ ์‚ฌ์šฉ
# ${SCRIPT_PATH}"/run-bundled-codegen.sh codegen:generate --target=swift --namespace=\(namespace์ด๋ฆ„) --includes=./\(.graphql ํŒŒ์ผ๋“ค์ด ๋“ค์–ด๊ฐ€ ์žˆ๋Š” ๋””๋ ‰ํ† ๋ฆฌ ๊ฒฝ๋กœ) --localSchemaFile="\(Scheme ์ •๋ณด jsonํŒŒ์ผ ์ด๋ฆ„).json" \(Output ๊ฒฝ๋กœ)

1 change: 1 addition & 0 deletions Tuist/Dependencies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let dependencies = Dependencies(
carthage: nil,
swiftPackageManager: SwiftPackageManagerDependencies(
[
.remote(url: "https://github.com/apollographql/apollo-ios.git", requirement: .exact("1.2.0")),
.remote(url: "https://github.com/airbnb/lottie-ios.git", requirement: .exact("4.2.0")),
.remote(url: "https://github.com/giiiita/TagLayoutView.git", requirement: .branch("master")),
.remote(url: "https://github.com/kean/Nuke.git", requirement: .exact("12.1.0")),
Expand Down
5 changes: 5 additions & 0 deletions Tuist/ProjectDescriptionHelpers/Action+Template.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ public extension TargetScript {
name: "Needle",
basedOnDependencyAnalysis: false
)
static let apolloGraphQL = TargetScript.pre(
path: .relativeToRoot("Scripts/GenerateApolloGraphQLAPI.sh"),
name: "Apollo Graph QL",
basedOnDependencyAnalysis: false
)
}