Skip to content

Commit f21c6f5

Browse files
committed
Added Swift Package Manager Support
1 parent 34de002 commit f21c6f5

425 files changed

Lines changed: 3947 additions & 3047 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
DEVELOPER_DIR: /Applications/Xcode_26.0.1.app/Contents/Developer
99
strategy:
1010
matrix:
11-
mode: [tests, framework, life-without-cocoapods, carthage, examples-pt1, examples-pt2, examples-pt3, examples-pt4]
11+
mode: [tests, framework, life-without-cocoapods, carthage, spm-smoke-tests, examples-pt1, examples-pt2, examples-pt3, examples-pt4]
1212
include:
1313
- mode: tests
1414
name: Build and run tests
@@ -18,6 +18,8 @@ jobs:
1818
name: Build Texture as a static library
1919
- mode: carthage
2020
name: Verify that Carthage works
21+
- mode: spm-smoke-tests
22+
name: Verify that SPM smoke tests compile
2123
- mode: examples-pt1
2224
name: Build examples (examples-pt1)
2325
- mode: examples-pt2

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ playground.xcworkspace
3030
# Carthage
3131
Carthage/Checkouts
3232
Carthage/Build
33+
34+
# Swift Package Manager
35+
.swiftpm/
36+
.build/
37+
Package.resolved
38+
39+
# Examples
40+
examples/**/Podfile.lock
41+
examples_extra/**/Podfile.lock

AsyncDisplayKit.xcodeproj/project.pbxproj

Lines changed: 1705 additions & 1715 deletions
Large diffs are not rendered by default.

Package.swift

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// swift-tools-version: 6.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "Texture",
8+
defaultLocalization: "en",
9+
platforms: [
10+
.iOS(.v14),
11+
.tvOS(.v14),
12+
],
13+
products: [
14+
.library(
15+
name: "AsyncDisplayKit",
16+
type: .static,
17+
targets: [
18+
"AsyncDisplayKit"
19+
]
20+
),
21+
],
22+
traits: [
23+
Trait(name: "IGListKit", description: "Include IGListKit support"),
24+
Trait(name: "Yoga", description: "Include Yoga support"),
25+
],
26+
dependencies: [
27+
.package(url: "https://github.com/Instagram/IGListKit.git", from: "5.0.0"),
28+
.package(url: "https://github.com/facebook/yoga.git", from: "3.1.0"),
29+
.package(url: "https://github.com/pinterest/PINRemoteImage.git", from: "3.0.4"),
30+
],
31+
targets: [
32+
.target(
33+
name: "AsyncDisplayKit",
34+
dependencies: [
35+
.product(name: "PINRemoteImage", package: "PINRemoteImage"),
36+
.product(name: "IGListKit", package: "IGListKit", condition: .when(traits: ["IGListKit"])),
37+
.product(name: "IGListDiffKit", package: "IGListKit", condition: .when(traits: ["IGListKit"])),
38+
.product(name: "yoga", package: "yoga", condition: .when(traits: ["Yoga"])),
39+
],
40+
path: "Source/Texture",
41+
publicHeadersPath: "include",
42+
cSettings: [
43+
.headerSearchPath("Private"),
44+
.headerSearchPath("Private/Layout"),
45+
.define("AS_ENABLE_TEXTNODE", to: "1"),
46+
.define("AS_USE_VIDEO", to: "1"),
47+
.define("AS_USE_MAPKIT", to: "1"),
48+
.define("AS_USE_PHOTOS", to: "1"),
49+
.define("AS_USE_ASSETS_LIBRARY", to: "1"),
50+
.define("YOGA", to: "1", .when(traits: ["Yoga"])),
51+
.define("AS_IG_LIST_KIT", to: "1", .when(traits: ["IGListKit"])),
52+
.define("AS_IG_LIST_DIFF_KIT", to: "1", .when(traits: ["IGListKit"])),
53+
],
54+
linkerSettings: [
55+
.linkedFramework("AVFoundation"),
56+
.linkedFramework("CoreMedia"),
57+
.linkedFramework("CoreLocation"),
58+
.linkedFramework("MapKit"),
59+
.linkedFramework("Photos"),
60+
.linkedFramework("AssetsLibrary"),
61+
]
62+
),
63+
],
64+
cLanguageStandard: .c11,
65+
cxxLanguageStandard: .cxx11
66+
)

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,52 @@
1010

1111
[![Version](https://img.shields.io/cocoapods/v/Texture.svg)](http://cocoapods.org/pods/Texture)
1212
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-59C939.svg?style=flat)](https://github.com/Carthage/Carthage)
13+
[![Swift Package Manager](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://swift.org/package-manager/)
1314
[![License](https://img.shields.io/cocoapods/l/Texture.svg)](https://github.com/texturegroup/texture/blob/master/LICENSE)
1415

1516
## Installation
1617

17-
Texture is available via CocoaPods or Carthage. See our [Installation](http://texturegroup.org/docs/installation.html) guide for instructions.
18+
Texture is available via CocoaPods, Carthage, or Swift Package Manager. See our [Installation](http://texturegroup.org/docs/installation.html) guide for instructions.
19+
20+
### Swift Package Manager
21+
22+
Add Texture to your `Package.swift`:
23+
24+
```swift
25+
dependencies: [
26+
.package(url: "https://github.com/texturegroup/texture.git", from: "3.0.0")
27+
]
28+
```
29+
30+
Then add `AsyncDisplayKit` as a dependency of your target:
31+
32+
```swift
33+
.target(
34+
name: "MyApp",
35+
dependencies: [
36+
.product(name: "AsyncDisplayKit", package: "texture")
37+
]
38+
)
39+
```
40+
41+
#### Optional traits
42+
43+
Texture supports SPM traits to opt into optional integrations:
44+
45+
| Trait | Description |
46+
|-------|-------------|
47+
| `IGListKit` | Enables [IGListKit](https://github.com/Instagram/IGListKit) integration (`AS_IG_LIST_KIT`) |
48+
| `Yoga` | Enables [Yoga](https://github.com/facebook/yoga) layout engine support |
49+
50+
Enable traits in your dependency declaration:
51+
52+
```swift
53+
.package(
54+
url: "https://github.com/texturegroup/texture.git",
55+
from: "3.0.0",
56+
traits: ["IGListKit", "Yoga"]
57+
)
58+
```
1859

1960
## Performance Gains
2061

Source/AsyncDisplayKit.h

Lines changed: 0 additions & 130 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
77
//
88

9-
#import <AsyncDisplayKit/ASAvailability.h>
9+
#import "ASAvailability.h"
1010
#import "ASButtonNode+Yoga.h"
11-
#import <AsyncDisplayKit/ASButtonNode+Private.h>
12-
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
13-
#import <AsyncDisplayKit/ASStackLayoutSpecUtilities.h>
11+
#import "ASButtonNode+Private.h"
12+
#import "ASDisplayNodeInternal.h"
13+
#import "ASStackLayoutSpecUtilities.h"
1414

1515
#if YOGA
1616
static void ASButtonNodeResolveHorizontalAlignmentForStyle(ASLayoutElementStyle *style, ASStackLayoutDirection _direction, ASHorizontalAlignment _horizontalAlignment, ASStackLayoutJustifyContent _justifyContent, ASStackLayoutAlignItems _alignItems) {
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
88
//
99

10-
#import <AsyncDisplayKit/ASButtonNode+Private.h>
11-
#import <AsyncDisplayKit/ASButtonNode+Yoga.h>
12-
#import <AsyncDisplayKit/ASStackLayoutSpec.h>
13-
#import <AsyncDisplayKit/ASThread.h>
14-
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
15-
#import <AsyncDisplayKit/ASBackgroundLayoutSpec.h>
16-
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
10+
#import "ASButtonNode+Private.h"
11+
#import "ASButtonNode+Yoga.h"
12+
#import "ASStackLayoutSpec.h"
13+
#import "ASThread.h"
14+
#import "ASDisplayNode+Subclasses.h"
15+
#import "ASBackgroundLayoutSpec.h"
16+
#import "ASInsetLayoutSpec.h"
1717

1818
@implementation ASButtonNode
1919

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
88
//
99

10-
#import <AsyncDisplayKit/ASCellNode+Internal.h>
11-
12-
#import <AsyncDisplayKit/ASEqualityHelpers.h>
13-
#import <AsyncDisplayKit/ASInternalHelpers.h>
14-
#import <AsyncDisplayKit/ASDisplayNode+FrameworkPrivate.h>
15-
#import <AsyncDisplayKit/ASCollectionView+Undeprecated.h>
16-
#import <AsyncDisplayKit/ASCollectionElement.h>
17-
#import <AsyncDisplayKit/ASTableView+Undeprecated.h>
18-
#import <AsyncDisplayKit/_ASDisplayView.h>
19-
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
20-
#import <AsyncDisplayKit/ASTextNode.h>
21-
#import <AsyncDisplayKit/ASCollectionNode.h>
22-
23-
#import <AsyncDisplayKit/ASDKViewController.h>
24-
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
25-
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
10+
#import "ASCellNode+Internal.h"
11+
12+
#import "ASEqualityHelpers.h"
13+
#import "ASInternalHelpers.h"
14+
#import "ASDisplayNode+FrameworkPrivate.h"
15+
#import "ASCollectionView+Undeprecated.h"
16+
#import "ASCollectionElement.h"
17+
#import "ASTableView+Undeprecated.h"
18+
#import "_ASDisplayView.h"
19+
#import "ASDisplayNode+Subclasses.h"
20+
#import "ASTextNode.h"
21+
#import "ASCollectionNode.h"
22+
23+
#import "ASDKViewController.h"
24+
#import "ASInsetLayoutSpec.h"
25+
#import "ASDisplayNodeInternal.h"
2626

2727
#pragma mark -
2828
#pragma mark ASCellNode

0 commit comments

Comments
 (0)