-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow a client to select the release/version for SwiftFormat (#42)
Upgraded rules_spm to 0.7.0. Upgraded bazel-starlib to 0.3.0. Removed obsolete src update code. Allow a client to select a specific version of SwiftFormat.
- Loading branch information
Showing
12 changed files
with
121 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!-- Generated with Stardoc, Do Not Edit! --> | ||
# Repository Rules and Macros | ||
|
||
The rules and macros described below are used to configure and download | ||
dependencies for rules_swiftformat. | ||
|
||
On this page: | ||
|
||
* [swiftformat_load_package](#swiftformat_load_package) | ||
|
||
|
||
<a id="#swiftformat_load_package"></a> | ||
|
||
## swiftformat_load_package | ||
|
||
<pre> | ||
swiftformat_load_package(<a href="#swiftformat_load_package-version">version</a>) | ||
</pre> | ||
|
||
Loads SwiftFormat using Swift Package Manager via `rules_spm`. | ||
|
||
If a version is not specified, Swift Package Manager will be configured to load the latest release. | ||
|
||
|
||
**PARAMETERS** | ||
|
||
|
||
| Name | Description | Default Value | | ||
| :------------- | :------------- | :------------- | | ||
| <a id="swiftformat_load_package-version"></a>version | Optional. A valid semver <code>string</code> for SwiftFormat. | <code>None</code> | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") | ||
load("@cgrindel_rules_spm//spm:spm.bzl", "spm_pkg", "spm_repositories") | ||
load("@cgrindel_rules_spm//spm:defs.bzl", "spm_pkg", "spm_repositories") | ||
|
||
def swiftformat_load_package(version = None): | ||
"""Loads SwiftFormat using Swift Package Manager via `rules_spm`. | ||
If a version is not specified, Swift Package Manager will be configured to \ | ||
load the latest release. | ||
Args: | ||
version: Optional. A valid semver `string` for SwiftFormat. | ||
""" | ||
spm_pkg_args = { | ||
"url": "https://github.com/nicklockwood/SwiftFormat.git", | ||
"products": ["swiftformat"], | ||
} | ||
if version == None: | ||
# Load the latest 0.x.x version of SwiftFormat. | ||
spm_pkg_args["from_version"] = "0.0.0" | ||
else: | ||
# Load the specified version of SwiftFormat | ||
spm_pkg_args["exact_version"] = version | ||
|
||
def swiftformat_load_package(): | ||
maybe( | ||
spm_repositories, | ||
name = "swiftformat_repos", | ||
dependencies = [ | ||
spm_pkg( | ||
"https://github.com/nicklockwood/SwiftFormat.git", | ||
from_version = "0.0.0", | ||
products = ["swiftformat"], | ||
), | ||
spm_pkg(**spm_pkg_args), | ||
], | ||
platforms = [".macOS(.v10_12)"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters