Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deduplication of -enable-experimental-feature #1044

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/smtp_example/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Import Shared settings
import %workspace%/../../shared.bazelrc

# Import CI settings.
import %workspace%/../../ci.bazelrc

# Try to import a local.rc file; typically, written by CI
try-import %workspace%/../../local.bazelrc
45 changes: 45 additions & 0 deletions examples/smtp_example/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_binary")
load("@cgrindel_bazel_starlib//bzltidy:defs.bzl", "tidy")
load("@rules_swift_package_manager//swiftpkg:defs.bzl", "swift_update_packages")

tidy(
name = "tidy",
targets = [
":swift_update_pkgs",
":update_build_files",
],
)

# MARK: - Gazelle

# Ignore the Swift build folder
# gazelle:exclude .build

gazelle_binary(
name = "gazelle_bin",
languages = [
"@bazel_skylib_gazelle_plugin//bzl",
"@rules_swift_package_manager//gazelle",
],
)

gazelle(
name = "update_build_files",
gazelle = ":gazelle_bin",
)

swift_update_packages(
name = "swift_update_pkgs",
gazelle = ":gazelle_bin",
generate_swift_deps_for_workspace = False,
update_bzlmod_stanzas = True,
)

swift_binary(
name = "smtp_example",
srcs = ["main.swift"],
module_name = "smtp_example",
visibility = ["//visibility:public"],
deps = ["@swiftpkg_swift_smtp//:SwiftSMTP"],
)
47 changes: 47 additions & 0 deletions examples/smtp_example/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
bazel_dep(
name = "rules_swift_package_manager",
version = "0.0.0",
)
local_path_override(
module_name = "rules_swift_package_manager",
path = "../..",
)

bazel_dep(name = "cgrindel_bazel_starlib", version = "0.20.2")
bazel_dep(name = "bazel_skylib", version = "1.6.0")
bazel_dep(name = "apple_support", version = "1.9.0", repo_name = "build_bazel_apple_support")
bazel_dep(
name = "rules_swift",
version = "1.18.0",
repo_name = "build_bazel_rules_swift",
)
bazel_dep(
name = "rules_apple",
version = "3.5.1",
repo_name = "build_bazel_rules_apple",
)

bazel_dep(
name = "bazel_skylib_gazelle_plugin",
version = "1.6.0",
dev_dependency = True,
)
bazel_dep(
name = "gazelle",
version = "0.36.0",
dev_dependency = True,
repo_name = "bazel_gazelle",
)
# swift_deps START
swift_deps = use_extension(
"@rules_swift_package_manager//:extensions.bzl",
"swift_deps",
)
swift_deps.from_file(
deps_index = "//:swift_deps_index.json",
)
use_repo(
swift_deps,
"swiftpkg_swift_smtp",
)
# swift_deps END
203 changes: 203 additions & 0 deletions examples/smtp_example/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
{
"pins" : [
{
"identity" : "async-http-client",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-server/async-http-client.git",
"state" : {
"revision" : "fb308ee72f3d4c082a507033f94afa7395963ef3",
"version" : "1.21.0"
}
},
{
"identity" : "async-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/async-kit.git",
"state" : {
"revision" : "7ece208cd401687641c88367a00e3ea2b04311f1",
"version" : "1.19.0"
}
},
{
"identity" : "console-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/console-kit.git",
"state" : {
"revision" : "a31f44ebfbd15a2cc0fda705279676773ac16355",
"version" : "4.14.1"
}
},
{
"identity" : "multipart-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/multipart-kit.git",
"state" : {
"revision" : "12ee56f25bd3fc4c2d09c2aa16e69de61dc786e8",
"version" : "4.6.0"
}
},
{
"identity" : "routing-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/routing-kit.git",
"state" : {
"revision" : "2a92a7eac411a82fb3a03731be5e76773ebe1b3e",
"version" : "4.9.0"
}
},
{
"identity" : "swift-algorithms",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-algorithms.git",
"state" : {
"revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42",
"version" : "1.2.0"
}
},
{
"identity" : "swift-atomics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "cd142fd2f64be2100422d658e7411e39489da985",
"version" : "1.2.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
}
},
{
"identity" : "swift-crypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-crypto.git",
"state" : {
"revision" : "f0525da24dc3c6cbb2b6b338b65042bc91cbc4bb",
"version" : "3.3.0"
}
},
{
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types",
"state" : {
"revision" : "12358d55a3824bd5fed310b999ea8cf83a9a1a65",
"version" : "1.0.3"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5",
"version" : "1.5.4"
}
},
{
"identity" : "swift-metrics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-metrics.git",
"state" : {
"revision" : "971ba26378ab69c43737ee7ba967a896cb74c0d1",
"version" : "2.4.1"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio",
"state" : {
"revision" : "359c461e5561d22c6334828806cc25d759ca7aa6",
"version" : "2.65.0"
}
},
{
"identity" : "swift-nio-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-extras",
"state" : {
"revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63",
"version" : "1.22.0"
}
},
{
"identity" : "swift-nio-http2",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-http2.git",
"state" : {
"revision" : "c6afe04165c865faaa687b42c32ed76dfcc91076",
"version" : "1.31.0"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl",
"state" : {
"revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5",
"version" : "2.26.0"
}
},
{
"identity" : "swift-nio-transport-services",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-transport-services.git",
"state" : {
"revision" : "6cbe0ed2b394f21ab0d46b9f0c50c6be964968ce",
"version" : "1.20.1"
}
},
{
"identity" : "swift-numerics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-numerics.git",
"state" : {
"revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
"version" : "1.0.2"
}
},
{
"identity" : "swift-smtp",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sersoft-gmbh/swift-smtp",
"state" : {
"revision" : "46e9ef4c2a2808011aaf0ed62f9968da2b757a2d",
"version" : "2.10.0"
}
},
{
"identity" : "swift-system",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "025bcb1165deab2e20d4eaba79967ce73013f496",
"version" : "1.2.1"
}
},
{
"identity" : "vapor",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/vapor",
"state" : {
"revision" : "e5cb0abdadff95ef996fafd6268f2f5f8cba6325",
"version" : "4.94.1"
}
},
{
"identity" : "websocket-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/websocket-kit.git",
"state" : {
"revision" : "4232d34efa49f633ba61afde365d3896fc7f8740",
"version" : "2.15.0"
}
}
],
"version" : 2
}
10 changes: 10 additions & 0 deletions examples/smtp_example/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// swift-tools-version: 5.7

import PackageDescription

let package = Package(
name: "smtp_example",
dependencies: [
.package(url: "https://github.com/sersoft-gmbh/swift-smtp", from: "2.10.0"),
]
)
1 change: 1 addition & 0 deletions examples/smtp_example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# smtp Example
1 change: 1 addition & 0 deletions examples/smtp_example/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Intentionally blank: Using bzlmod
1 change: 1 addition & 0 deletions examples/smtp_example/WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Intentionally blank: Force bzlmod to strict mode
13 changes: 13 additions & 0 deletions examples/smtp_example/do_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail

# Use the Bazel binary specified by the integration test. Otherise, fall back
# to bazel.
bazel="${BIT_BAZEL_BINARY:-bazel}"

# Generate Swift external deps and update build files
"${bazel}" run //:tidy

# Ensure that it builds and tests pass
"${bazel}" test //...
4 changes: 4 additions & 0 deletions examples/smtp_example/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import SwiftSMTP

let configuration = Configuration.fromEnvironment()
print(configuration.server.hostname)
Loading