Skip to content

Commit

Permalink
Create project
Browse files Browse the repository at this point in the history
  • Loading branch information
pepicrft committed Jun 6, 2024
1 parent 586b66e commit 0681bb2
Show file tree
Hide file tree
Showing 7 changed files with 592 additions and 0 deletions.
107 changes: 107 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@

# Created by https://www.gitignore.io/api/swift,macos

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
.build/
.swiftpm

# CocoaPods - Refactored to standalone file

# Carthage - Refactored to standalone file

# End of https://www.gitignore.io/api/swift,macos

**/*.xcodeproj
**/*.xcworkspace
.byebug_history
*.xcarchive
tmp/
/build/

.env
.idea/
/Carthage/Checkouts
*.profraw
tuist.zip
TODO
TODO.md
mkmf.log
.rubocop-http---shopify-github-io-ruby-style-guide-rubocop-yml
generated_fixtures
.fixtures.generated.json
**/Derived/
XcodeGraph.xcworkspace
node_modules
Fixture

Tuist/Dependencies/SwiftPackageManager
Tuist/Dependencies/graph.json

# VSCode Settings
.vscode/launch.json

# Release artifacts
.bundle
33 changes: 33 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"originHash" : "a06be40e2d01bb46bff58090037df0760c10c8abdc8befeee82e7fd2056dd699",
"pins" : [
{
"identity" : "anycodable",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Flight-School/AnyCodable",
"state" : {
"revision" : "862808b2070cd908cb04f9aafe7de83d35f81b05",
"version" : "0.6.7"
}
},
{
"identity" : "mockable",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Kolos65/Mockable.git",
"state" : {
"revision" : "f931faaae32a0ef21a0dcc731e5fc8bdc7d704f9",
"version" : "0.0.8"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
"version" : "509.1.1"
}
}
],
"version" : 3
}
57 changes: 57 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// swift-tools-version:5.10

import PackageDescription

var targets: [Target] = [
.target(
name: "XcodeGraph",
dependencies: [
"AnyCodable",
"Mockable",
],
swiftSettings: [
.define("MOCKING", .when(configuration: .debug)),
]
),
.target(
name: "XcodeGraphTesting",
dependencies: [
"XcodeGraph",
"AnyCodable",
],
linkerSettings: [.linkedFramework("XCTest")]
)
]

#if TUIST
import struct ProjectDescription.PackageSettings

let packageSettings = PackageSettings(
productTypes: [
"Mockable": .staticFramework,
"MockableTest": .staticFramework,
]
)

#endif

let package = Package(
name: "tuist",
platforms: [.macOS(.v12)],
products: [
.library(
name: "XcodeGraph",
targets: ["XcodeGraph"]
),
.library(
name: "XcodeGraphTesting",
targets: ["XcodeGraphTesting"]
)

],
dependencies: [
.package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.7"),
.package(url: "https://github.com/Kolos65/Mockable.git", from: "0.0.2"),
],
targets: targets
)
123 changes: 123 additions & 0 deletions Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import ProjectDescription
import ProjectDescriptionHelpers

let baseSettings: SettingsDictionary = [:]

func debugSettings() -> SettingsDictionary {
var settings = baseSettings
settings["ENABLE_TESTABILITY"] = "YES"
return settings
}

func releaseSettings() -> SettingsDictionary {
baseSettings
}

func schemes() -> [Scheme] {
var schemes: [Scheme] = [
.scheme(
name: "Tuist-Workspace",
buildAction: .buildAction(targets: Module.allCases.flatMap(\.targets).map(\.name).sorted().map { .target($0) }),
testAction: .targets(
Module.allCases.flatMap(\.testTargets).map { .testableTarget(target: .target($0.name)) }
),
runAction: .runAction(
arguments: .arguments(
environmentVariables: [
"TUIST_CONFIG_SRCROOT": "$(SRCROOT)",
"TUIST_FRAMEWORK_SEARCH_PATHS": "$(FRAMEWORK_SEARCH_PATHS)",
]
)
)
),
.scheme(
name: "TuistAcceptanceTests",
buildAction: .buildAction(
targets: Module.allCases.flatMap(\.acceptanceTestTargets).map(\.name).sorted()
.map { .target($0) }
),
testAction: .targets(
Module.allCases.flatMap(\.acceptanceTestTargets).map { .testableTarget(target: .target($0.name)) }
),
runAction: .runAction(
arguments: .arguments(
environmentVariables: [
"TUIST_CONFIG_SRCROOT": "$(SRCROOT)",
"TUIST_FRAMEWORK_SEARCH_PATHS": "$(FRAMEWORK_SEARCH_PATHS)",
]
)
)
),
.scheme(
name: "TuistUnitTests",
buildAction: .buildAction(
targets: Module.allCases.flatMap(\.unitTestTargets).map(\.name).sorted()
.map { .target($0) }
),
testAction: .targets(
Module.allCases.flatMap(\.unitTestTargets).map { .testableTarget(target: .target($0.name)) }
),
runAction: .runAction(
arguments: .arguments(
environmentVariables: [
"TUIST_CONFIG_SRCROOT": "$(SRCROOT)",
"TUIST_FRAMEWORK_SEARCH_PATHS": "$(FRAMEWORK_SEARCH_PATHS)",
]
)
)
),
]
schemes.append(contentsOf: Module.allCases.filter(\.isRunnable).map {
.scheme(
name: $0.targetName,
buildAction: .buildAction(targets: [.target($0.targetName)]),
runAction: .runAction(
executable: .target($0.targetName),
arguments: .arguments(
environmentVariables: [
"TUIST_CONFIG_SRCROOT": "$(SRCROOT)",
"TUIST_FRAMEWORK_SEARCH_PATHS": "$(FRAMEWORK_SEARCH_PATHS)",
]
)
)
)
})

schemes.append(contentsOf: Module.allCases.compactMap(\.acceptanceTestsTargetName).map {
.scheme(
name: $0,
hidden: true,
buildAction: .buildAction(targets: [.target($0)]),
testAction: .targets([.testableTarget(target: .target($0))]),
runAction: .runAction(
arguments: .arguments(
environmentVariables: [
"TUIST_CONFIG_SRCROOT": "$(SRCROOT)",
"TUIST_FRAMEWORK_SEARCH_PATHS": "$(FRAMEWORK_SEARCH_PATHS)",
]
)
)
)
})

return schemes
}

let project = Project(
name: "XcodeGraph",
options: .options(
automaticSchemesOptions: .disabled,
textSettings: .textSettings(usesTabs: false, indentWidth: 4, tabWidth: 4)
),
settings: .settings(
configurations: [
.debug(name: "Debug", settings: debugSettings(), xcconfig: nil),
.release(name: "Release", settings: releaseSettings(), xcconfig: nil),
]
),
targets: Module.allCases.flatMap(\.targets),
schemes: schemes(),
additionalFiles: [
"README.md",
]
)
10 changes: 10 additions & 0 deletions Tuist/Config.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import ProjectDescription

let config = Config(
cloud: .cloud(
projectId: "tuist/xcodegraph",
url: "https://cloud.tuist.io",
options: [.optional]
),
swiftVersion: .init("5.10")
)
Loading

0 comments on commit 0681bb2

Please sign in to comment.