forked from dependabot/dependabot-core
-
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.
Co-authored-by: Mattt <mattt@github.com> Co-authored-by: Randall Wood <297232+rhwood@users.noreply.github.com> Co-authored-by: Tim <0xtimc@gmail.com>
- Loading branch information
1 parent
6a3a59c
commit 2cda919
Showing
36 changed files
with
352 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,6 @@ | |
|
||
"L: terraform": | ||
- terraform/**/* | ||
|
||
"L: swift": | ||
- swift/**/* |
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.bundle/ | ||
/.env | ||
/tmp | ||
/dependabot-*.gem | ||
Gemfile.lock |
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 @@ | ||
inherit_from: ../omnibus/.rubocop.yml |
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,44 @@ | ||
FROM ghcr.io/dependabot/dependabot-updater-core | ||
ARG TARGETARCH | ||
|
||
ENV PATH="${PATH}:/opt/swift/usr/bin" | ||
|
||
# OS dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
binutils \ | ||
libc6-dev \ | ||
libcurl4 \ | ||
libedit2 \ | ||
libgcc-9-dev \ | ||
libpython2.7 \ | ||
libsqlite3-0 \ | ||
libstdc++-9-dev \ | ||
libxml2 \ | ||
libz3-dev \ | ||
pkg-config \ | ||
tzdata \ | ||
uuid-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
USER dependabot | ||
|
||
# https://www.swift.org/download/ | ||
ARG SWIFT_VERSION=5.8.1 | ||
ARG SWIFT_UBUNTU_VERSION=ubuntu20.04 | ||
|
||
RUN if [ "$TARGETARCH" = "arm64" ]; then SWIFT_UBUNTU_VERSION="${SWIFT_UBUNTU_VERSION}-aarch64"; fi \ | ||
&& SWIFT_SHORT_UBUNTU_VERSION=$(echo $SWIFT_UBUNTU_VERSION | tr -d .) \ | ||
&& SWIFT_TARBALL="swift-${SWIFT_VERSION}-RELEASE-${SWIFT_UBUNTU_VERSION}.tar.gz" \ | ||
&& DOWNLOAD_URL=https://download.swift.org/swift-${SWIFT_VERSION}-release/${SWIFT_SHORT_UBUNTU_VERSION}/swift-${SWIFT_VERSION}-RELEASE/${SWIFT_TARBALL} \ | ||
&& curl --connect-timeout 15 --retry 5 "${DOWNLOAD_URL}" > "/tmp/${SWIFT_TARBALL}" \ | ||
&& curl --connect-timeout 15 --retry 5 "${DOWNLOAD_URL}.sig" > "/tmp/${SWIFT_TARBALL}.sig" \ | ||
&& sh -c 'curl --connect-timeout 15 --retry 5 https://www.swift.org/keys/all-keys.asc | gpg --import -' \ | ||
&& gpg --keyserver hkp://keyserver.ubuntu.com --refresh-keys Swift \ | ||
&& gpg --verify /tmp/${SWIFT_TARBALL}.sig \ | ||
&& mkdir /opt/swift \ | ||
&& tar -C /opt/swift -xzf /tmp/${SWIFT_TARBALL} --strip-components 1 | ||
|
||
COPY --chown=dependabot:dependabot swift $DEPENDABOT_HOME/swift | ||
COPY --chown=dependabot:dependabot common $DEPENDABOT_HOME/common | ||
COPY --chown=dependabot:dependabot updater $DEPENDABOT_HOME/dependabot-updater |
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,7 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "dependabot-common", path: "../common" | ||
|
||
gemspec |
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,18 @@ | ||
## `dependabot-swift` | ||
|
||
Swift Package Manager support for [`dependabot-core`][core-repo]. | ||
|
||
### Running locally | ||
|
||
1. Start a development shell | ||
|
||
``` | ||
$ bin/docker-dev-shell swift | ||
``` | ||
|
||
2. Run tests | ||
``` | ||
[dependabot-core-dev] ~/dependabot-core $ cd swift && rspec | ||
``` | ||
|
||
[core-repo]: https://github.com/dependabot/dependabot-core |
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,35 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
common_gemspec = | ||
Bundler.load_gemspec_uncached("../common/dependabot-common.gemspec") | ||
|
||
spec.name = "dependabot-swift" | ||
spec.summary = "Provides Dependabot support for Swift" | ||
spec.description = "Dependabot-Swift provides support for bumping Swift packages via Dependabot. " \ | ||
"If you want support for multiple package managers, you probably want the meta-gem " \ | ||
"dependabot-omnibus." | ||
|
||
spec.author = common_gemspec.author | ||
spec.email = common_gemspec.email | ||
spec.homepage = common_gemspec.homepage | ||
spec.license = common_gemspec.license | ||
|
||
spec.metadata = { | ||
"bug_tracker_uri" => common_gemspec.metadata["bug_tracker_uri"], | ||
"changelog_uri" => common_gemspec.metadata["changelog_uri"] | ||
} | ||
|
||
spec.version = common_gemspec.version | ||
spec.required_ruby_version = common_gemspec.required_ruby_version | ||
spec.required_rubygems_version = common_gemspec.required_ruby_version | ||
|
||
spec.require_path = "lib" | ||
spec.files = Dir["lib/**/*"] | ||
|
||
spec.add_dependency "dependabot-common", Dependabot::VERSION | ||
|
||
common_gemspec.development_dependencies.each do |dep| | ||
spec.add_development_dependency dep.name, *dep.requirement.as_list | ||
end | ||
end |
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,22 @@ | ||
# frozen_string_literal: true | ||
|
||
# These all need to be required so the various classes can be registered in a | ||
# lookup table of package manager names to concrete classes. | ||
require "dependabot/swift/file_fetcher" | ||
require "dependabot/swift/file_parser" | ||
require "dependabot/swift/update_checker" | ||
require "dependabot/swift/file_updater" | ||
require "dependabot/swift/metadata_finder" | ||
require "dependabot/swift/requirement" | ||
require "dependabot/swift/version" | ||
|
||
require "dependabot/pull_request_creator/labeler" | ||
Dependabot::PullRequestCreator::Labeler. | ||
register_label_details("swift", name: "swift_package_manager", colour: "F05138") | ||
|
||
require "dependabot/dependency" | ||
Dependabot::Dependency. | ||
register_production_check("swift", ->(_) { true }) | ||
|
||
require "dependabot/utils" | ||
Dependabot::Utils.register_always_clone("swift") |
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,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/file_fetchers" | ||
require "dependabot/file_fetchers/base" | ||
|
||
module Dependabot | ||
module Swift | ||
class FileFetcher < Dependabot::FileFetchers::Base | ||
def self.required_files_in?(filenames) | ||
raise NotImplementedError | ||
end | ||
|
||
def self.required_files_message | ||
raise NotImplementedError | ||
end | ||
|
||
private | ||
|
||
def fetch_files | ||
raise NotImplementedError | ||
end | ||
end | ||
end | ||
end | ||
|
||
Dependabot::FileFetchers. | ||
register("swift", Dependabot::Swift::FileFetcher) |
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,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/file_parsers" | ||
require "dependabot/file_parsers/base" | ||
|
||
module Dependabot | ||
module Swift | ||
class FileParser < Dependabot::FileParsers::Base | ||
def parse | ||
raise NotImplementedError | ||
end | ||
|
||
private | ||
|
||
def check_required_files | ||
raise NotImplementedError | ||
end | ||
end | ||
end | ||
end | ||
|
||
Dependabot::FileParsers. | ||
register("swift", Dependabot::Swift::FileParser) |
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/file_updaters" | ||
require "dependabot/file_updaters/base" | ||
|
||
module Dependabot | ||
module Swift | ||
class FileUpdater < Dependabot::FileUpdaters::Base | ||
def self.updated_files_regex | ||
raise NotImplementedError | ||
end | ||
|
||
def updated_dependency_files | ||
raise NotImplementedError | ||
end | ||
end | ||
end | ||
end | ||
|
||
Dependabot::FileUpdaters. | ||
register("swift", Dependabot::Swift::FileUpdater) |
Oops, something went wrong.