Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Commits
c2d17ee7
Commit
c2d17ee7
authored
Aug 3, 2022
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Refactor example-app package manifest
parent
4959268b
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!102
Release 1.0.0
,
!19
Update example app
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Example/example-app/Package.swift
+172
-174
172 additions, 174 deletions
Example/example-app/Package.swift
with
172 additions
and
174 deletions
Example/example-app/Package.swift
+
172
−
174
View file @
c2d17ee7
// swift-tools-version: 5.6
import
PackageDescription
let
swiftSettings
:
[
SwiftSetting
]
=
[
// MARK: - Helpers
struct
Feature
{
var
product
:
Product
var
targets
:
[
Target
]
var
targetDependency
:
Target
.
Dependency
static
func
library
(
name
:
String
,
dependencies
:
[
Target
.
Dependency
]
=
[],
testDependencies
:
[
Target
.
Dependency
]
=
[],
swiftSettings
:
[
SwiftSetting
]
=
[
.
unsafeFlags
(
[
"-Xfrontend"
,
...
...
@@ -13,170 +23,158 @@ let swiftSettings: [SwiftSetting] = [
.
when
(
configuration
:
.
debug
)
),
]
let
package
=
Package
(
name
:
"example-app"
,
platforms
:
[
.
iOS
(
.
v15
),
],
products
:
[
.
library
(
name
:
"AppFeature"
,
targets
:
[
"AppFeature"
]
),
.
library
(
name
:
"ErrorFeature"
,
targets
:
[
"ErrorFeature"
]
),
.
library
(
name
:
"LandingFeature"
,
targets
:
[
"LandingFeature"
]
)
->
Feature
{
.
init
(
product
:
.
library
(
name
:
name
,
targets
:
[
name
]),
targets
:
[
.
target
(
name
:
name
,
dependencies
:
dependencies
,
swiftSettings
:
swiftSettings
),
.
library
(
name
:
"SessionFeature"
,
targets
:
[
"SessionFeature"
]
.
testTarget
(
name
:
"
\(
name
)
Tests"
,
dependencies
:
[
.
target
(
name
:
name
)]
+
testDependencies
,
swiftSettings
:
swiftSettings
),
],
dependencies
:
[
.
package
(
path
:
"../../"
),
// elixxir-dapps-sdk-swift
.
package
(
targetDependency
:
.
target
(
name
:
name
)
)
}
}
struct
Dependency
{
var
packageDependency
:
Package
.
Dependency
var
targetDependency
:
Target
.
Dependency
static
func
local
(
path
:
String
,
name
:
String
,
package
:
String
)
->
Dependency
{
.
init
(
packageDependency
:
.
package
(
path
:
path
),
targetDependency
:
.
product
(
name
:
name
,
package
:
package
)
)
}
static
func
external
(
url
:
String
,
version
:
Range
<
Version
>
,
name
:
String
,
package
:
String
)
->
Dependency
{
.
init
(
packageDependency
:
.
package
(
url
:
url
,
version
),
targetDependency
:
.
product
(
name
:
name
,
package
:
package
)
)
}
}
// MARK: - Manifest
extension
Dependency
{
static
let
all
:
[
Dependency
]
=
[
.
composableArchitecture
,
.
composablePresentation
,
.
elixxirDAppsSDK
,
.
keychainAccess
,
.
xcTestDynamicOverlay
,
]
static
let
composableArchitecture
=
Dependency
.
external
(
url
:
"https://github.com/pointfreeco/swift-composable-architecture.git"
,
.
upToNextMajor
(
from
:
"0.35.0"
)
),
.
package
(
url
:
"https://github.com/darrarski/swift-composable-presentation.git"
,
.
upToNextMajor
(
from
:
"0.5.2"
)
),
.
package
(
url
:
"https://github.com/kishikawakatsumi/KeychainAccess.git"
,
.
upToNextMajor
(
from
:
"4.2.2"
)
),
.
package
(
url
:
"https://github.com/pointfreeco/xctest-dynamic-overlay.git"
,
.
upToNextMajor
(
from
:
"0.3.3"
)
),
],
targets
:
[
.
target
(
name
:
"AppFeature"
,
dependencies
:
[
.
target
(
name
:
"ErrorFeature"
),
.
target
(
name
:
"LandingFeature"
),
.
target
(
name
:
"SessionFeature"
),
.
product
(
version
:
.
upToNextMajor
(
from
:
"0.38.3"
),
name
:
"ComposableArchitecture"
,
package
:
"swift-composable-architecture"
),
.
product
(
)
static
let
composablePresentation
=
Dependency
.
external
(
url
:
"https://github.com/darrarski/swift-composable-presentation.git"
,
version
:
.
upToNextMajor
(
from
:
"0.5.2"
),
name
:
"ComposablePresentation"
,
package
:
"swift-composable-presentation"
),
.
product
(
)
static
let
elixxirDAppsSDK
=
Dependency
.
local
(
path
:
"../../"
,
name
:
"ElixxirDAppsSDK"
,
package
:
"elixxir-dapps-sdk-swift"
),
.
product
(
)
static
let
keychainAccess
=
Dependency
.
external
(
url
:
"https://github.com/kishikawakatsumi/KeychainAccess.git"
,
version
:
.
upToNextMajor
(
from
:
"4.2.2"
),
name
:
"KeychainAccess"
,
package
:
"KeychainAccess"
),
.
product
(
)
static
let
xcTestDynamicOverlay
=
Dependency
.
external
(
url
:
"https://github.com/pointfreeco/xctest-dynamic-overlay.git"
,
version
:
.
upToNextMajor
(
from
:
"0.3.3"
),
name
:
"XCTestDynamicOverlay"
,
package
:
"xctest-dynamic-overlay"
),
],
swiftSettings
:
swiftSettings
),
.
testTarget
(
name
:
"AppFeatureTests"
,
)
}
extension
Feature
{
static
let
all
:
[
Feature
]
=
[
.
app
,
.
error
,
.
landing
,
.
session
,
]
static
let
app
=
Feature
.
library
(
name
:
"AppFeature"
,
dependencies
:
[
.
target
(
name
:
"AppFeature"
),
],
swiftSettings
:
swiftSettings
),
.
target
(
Feature
.
error
.
targetDependency
,
Feature
.
landing
.
targetDependency
,
Feature
.
session
.
targetDependency
,
Dependency
.
composableArchitecture
.
targetDependency
,
Dependency
.
composablePresentation
.
targetDependency
,
Dependency
.
elixxirDAppsSDK
.
targetDependency
,
Dependency
.
keychainAccess
.
targetDependency
,
Dependency
.
xcTestDynamicOverlay
.
targetDependency
,
]
)
static
let
error
=
Feature
.
library
(
name
:
"ErrorFeature"
,
dependencies
:
[
.
product
(
name
:
"ComposableArchitecture"
,
package
:
"swift-composable-architecture"
),
.
product
(
name
:
"ElixxirDAppsSDK"
,
package
:
"elixxir-dapps-sdk-swift"
),
.
product
(
name
:
"XCTestDynamicOverlay"
,
package
:
"xctest-dynamic-overlay"
),
],
swiftSettings
:
swiftSettings
),
.
testTarget
(
name
:
"ErrorFeatureTests"
,
dependencies
:
[
.
target
(
name
:
"ErrorFeature"
),
],
swiftSettings
:
swiftSettings
),
.
target
(
Dependency
.
composableArchitecture
.
targetDependency
,
Dependency
.
elixxirDAppsSDK
.
targetDependency
,
Dependency
.
xcTestDynamicOverlay
.
targetDependency
,
]
)
static
let
landing
=
Feature
.
library
(
name
:
"LandingFeature"
,
dependencies
:
[
.
target
(
name
:
"ErrorFeature"
),
.
product
(
name
:
"ComposableArchitecture"
,
package
:
"swift-composable-architecture"
),
.
product
(
name
:
"ComposablePresentation"
,
package
:
"swift-composable-presentation"
),
.
product
(
name
:
"ElixxirDAppsSDK"
,
package
:
"elixxir-dapps-sdk-swift"
),
.
product
(
name
:
"XCTestDynamicOverlay"
,
package
:
"xctest-dynamic-overlay"
),
],
swiftSettings
:
swiftSettings
),
.
testTarget
(
name
:
"LandingFeatureTests"
,
dependencies
:
[
.
target
(
name
:
"LandingFeature"
),
],
swiftSettings
:
swiftSettings
),
.
target
(
Feature
.
error
.
targetDependency
,
Dependency
.
composableArchitecture
.
targetDependency
,
Dependency
.
composablePresentation
.
targetDependency
,
Dependency
.
elixxirDAppsSDK
.
targetDependency
,
Dependency
.
xcTestDynamicOverlay
.
targetDependency
,
]
)
static
let
session
=
Feature
.
library
(
name
:
"SessionFeature"
,
dependencies
:
[
.
target
(
name
:
"ErrorFeature"
),
.
product
(
name
:
"ComposableArchitecture"
,
package
:
"swift-composable-architecture"
),
.
product
(
name
:
"ComposablePresentation"
,
package
:
"swift-composable-presentation"
),
.
product
(
name
:
"ElixxirDAppsSDK"
,
package
:
"elixxir-dapps-sdk-swift"
),
.
product
(
name
:
"XCTestDynamicOverlay"
,
package
:
"xctest-dynamic-overlay"
),
],
swiftSettings
:
swiftSettings
),
.
testTarget
(
name
:
"SessionFeatureTests"
,
dependencies
:
[
.
target
(
name
:
"SessionFeature"
),
],
swiftSettings
:
swiftSettings
),
Feature
.
error
.
targetDependency
,
Dependency
.
composableArchitecture
.
targetDependency
,
Dependency
.
composablePresentation
.
targetDependency
,
Dependency
.
elixxirDAppsSDK
.
targetDependency
,
Dependency
.
xcTestDynamicOverlay
.
targetDependency
,
]
)
}
let
package
=
Package
(
name
:
"example-app"
,
platforms
:
[
.
iOS
(
.
v15
)],
products
:
Feature
.
all
.
map
(\
.
product
),
dependencies
:
Dependency
.
all
.
map
(\
.
packageDependency
),
targets
:
Feature
.
all
.
flatMap
(\
.
targets
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment