Skip to content

Commit 2c8513c

Browse files
authored
Merge pull request #1 from libnativeapi/example-app
Add ExampleApp
2 parents 4395985 + 47094bd commit 2c8513c

File tree

10 files changed

+1417
-0
lines changed

10 files changed

+1417
-0
lines changed

Examples/ExampleApp/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc
9+
10+
.shaft

Examples/ExampleApp/.swift-format

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"lineLength": 100,
4+
"indentation": {
5+
"spaces": 4
6+
},
7+
"maximumBlankLines": 1,
8+
"respectsExistingLineBreaks": true,
9+
"lineBreakBeforeControlFlowKeywords": false,
10+
"lineBreakBeforeEachArgument": true
11+
}

Examples/ExampleApp/Package.resolved

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/ExampleApp/Package.swift

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// swift-tools-version: 5.9
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: "ExampleApp",
8+
9+
platforms: [
10+
.macOS(.v14),
11+
.iOS(.v13),
12+
.tvOS(.v13),
13+
],
14+
15+
dependencies: [
16+
.package(
17+
url: "https://github.com/ShaftUI/Shaft",
18+
branch: "main"
19+
),
20+
.package(url: "https://github.com/ShaftUI/SwiftReload.git", branch: "main"),
21+
.package(path: "../../"), // nativeapi-swift
22+
],
23+
24+
targets: [
25+
.executableTarget(
26+
name: "ExampleApp",
27+
dependencies: [
28+
"SwiftReload",
29+
.product(name: "Shaft", package: "Shaft"),
30+
.product(name: "ShaftSetup", package: "Shaft"),
31+
.product(name: "NativeAPI", package: "nativeapi-swift"),
32+
],
33+
swiftSettings: [
34+
.interoperabilityMode(.Cxx), // This is necessary to use the Skia renderer
35+
.unsafeFlags(
36+
["-Xfrontend", "-enable-private-imports"],
37+
.when(configuration: .debug)
38+
),
39+
.unsafeFlags(
40+
["-Xfrontend", "-enable-implicit-dynamic"],
41+
.when(configuration: .debug)
42+
),
43+
],
44+
linkerSettings: [
45+
.unsafeFlags(
46+
["-Xlinker", "--export-dynamic"],
47+
.when(platforms: [.linux, .android], configuration: .debug)
48+
)
49+
]
50+
)
51+
],
52+
cxxLanguageStandard: .cxx17 // This is necessary to use the Skia renderer
53+
)

Examples/ExampleApp/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ExampleApp
2+
3+
```sh
4+
swift run
5+
```

0 commit comments

Comments
 (0)