Skip to content

Commit c065a04

Browse files
Add Documentation and a Swift Package Index Setup (#6)
1 parent e79de90 commit c065a04

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

.spi.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# This source file is part of the TemplatePackage open source project
3+
#
4+
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
5+
#
6+
# SPDX-License-Identifier: MIT
7+
#
8+
9+
version: 1
10+
builder:
11+
configs:
12+
- platform: ios
13+
documentation_targets:
14+
- TemplatePackage

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The template repository contains a template Swift Package, including a continuou
2121
2. If your Swift Package does not provide any user interface or does not require an iOS application environment to function, you can remove the `UITests` application from the `Tests` folder. You need to update the `build-and-test.yml` GitHub Action accordingly by removing the GitHub Action that builds and tests the application, removing the dependency from the code coverage upload step, and removing the UI test `.xresult` input from the code coverage test.
2222
3. You will either need to add the [CodeCov GitHub App](https://github.com/apps/codecov) or add a codecov.io token to your [GitHub Actions Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-an-environment) following the instructions of the [Codecov GitHub Action](https://github.com/marketplace/actions/codecov#usage). The StanfordBDHG organization already has the [CodeCov GitHub App](https://github.com/apps/codecov) installed. If you do not want to cover test coverage data, you can remove the code coverage job in the `build-and-test.yml` GitHub Action.
2323
4. Adjust this README to describe your project and adjust the badges at the top to point to the correct GitHub Action of your repository and Codecov badge.
24+
5. The Swift Package template includes a Swift Package Index configuration file to automatically build the package and [host the documentation on the Swift Package Index website](https://blog.swiftpackageindex.com/posts/auto-generating-auto-hosting-and-auto-updating-docc-documentation/). Adjust the `.spi.yml` file to include all targets that you want to build documentation for. You can follow the [instructions of the Swift Package Index](https://swiftpackageindex.com/add-a-package) to include your Swift Package in the Swift Package Index.
2425

2526

2627
## Installation
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ``TemplatePackage``
2+
3+
<!--
4+
#
5+
# This source file is part of the TemplatePackage open source project
6+
#
7+
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
8+
#
9+
# SPDX-License-Identifier: MIT
10+
#
11+
-->
12+
13+
The template repository contains a template Swift Package, including a continuous integration setup.
14+
15+
## Overview
16+
17+
Please follow the steps in the README.md file to customize the code to your needs.
18+
19+
## Types
20+
21+
### Template Package
22+
23+
- ``TemplatePackage``

Sources/TemplatePackage/TemplatePackage.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
// SPDX-License-Identifier: MIT
77
//
88

9-
struct TemplatePackage {
10-
var stanford: String {
9+
/// The main type of the Swift Package template.
10+
public struct TemplatePackage {
11+
/// The Swift Package template package is provided by Stanford University.
12+
public var stanford: String {
1113
"Stanford University"
1214
}
1315
}

0 commit comments

Comments
 (0)