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

WIP: Add a paket module #1944

Closed
wants to merge 7 commits into from
Closed
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
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN apt-get update \
gnupg2 \
curl \
wget \
zlib1g \
zlib1g-dev \
liblzma-dev \
tzdata \
Expand All @@ -46,6 +47,12 @@ RUN apt-get update \
libxmlsec1-dev \
libgeos-dev \
python3-enchant \
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu60 \
libssl1.1 \
libstdc++6 \
&& locale-gen en_US.UTF-8


Expand Down Expand Up @@ -138,6 +145,29 @@ ENV RUSTUP_HOME=/opt/rust \
PATH="${PATH}:/opt/rust/bin"
RUN export CARGO_HOME=/opt/rust ; curl https://sh.rustup.rs -sSf | sh -s -- -y

### DOTNET

ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip


# Install .NET Core SDK
RUN dotnet_sdk_version=3.1.301 \
&& curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz \
&& dotnet_sha512='dd39931df438b8c1561f9a3bdb50f72372e29e5706d3fb4c490692f04a3d55f5acc0b46b8049bc7ea34dedba63c71b4c64c57032740cbea81eef1dce41929b4e' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
# Trigger first run experience by running arbitrary cmd
&& dotnet help


### NEW NATIVE HELPERS

Expand All @@ -148,6 +178,7 @@ COPY go_modules/helpers /opt/go_modules/helpers
COPY hex/helpers /opt/hex/helpers
COPY composer/helpers /opt/composer/helpers
COPY npm_and_yarn/helpers /opt/npm_and_yarn/helpers
COPY paket/helpers /opt/paket/helpers

ENV DEPENDABOT_NATIVE_HELPERS_PATH="/opt" \
PATH="$PATH:/opt/terraform/bin:/opt/python/bin:/opt/go_modules/bin:/opt/dep/bin" \
Expand All @@ -159,4 +190,5 @@ RUN bash /opt/terraform/helpers/build /opt/terraform && \
bash /opt/go_modules/helpers/build /opt/go_modules && \
bash /opt/npm_and_yarn/helpers/build /opt/npm_and_yarn && \
bash /opt/hex/helpers/build /opt/hex && \
bash /opt/paket/helpers/build /opt/paket && \
bash /opt/composer/helpers/build /opt/composer
6 changes: 6 additions & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ COPY nuget/Gemfile \
/home/dependabot/dependabot-core/nuget/
RUN cd nuget && bundle install

RUN mkdir -p /home/dependabot/dependabot-core/paket
COPY paket/Gemfile \
paket/dependabot-paket.gemspec \
/home/dependabot/dependabot-core/paket/
RUN cd paket && bundle install

RUN mkdir -p /home/dependabot/dependabot-core/composer
COPY composer/Gemfile \
composer/dependabot-composer.gemspec \
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ RUN mkdir -p ${CODE_DIR}/bundler \
${CODE_DIR}/npm_and_yarn \
${CODE_DIR}/nuget \
${CODE_DIR}/omnibus \
${CODE_DIR}/paket \
${CODE_DIR}/python \
${CODE_DIR}/terraform

Expand All @@ -73,6 +74,7 @@ COPY maven/Gemfile maven/dependabot-maven.gemspec ${CODE_DIR}/maven/
COPY npm_and_yarn/Gemfile npm_and_yarn/dependabot-npm_and_yarn.gemspec ${CODE_DIR}/npm_and_yarn/
COPY nuget/Gemfile nuget/dependabot-nuget.gemspec ${CODE_DIR}/nuget/
COPY omnibus/Gemfile omnibus/dependabot-omnibus.gemspec ${CODE_DIR}/omnibus/
COPY paket/Gemfile paket/dependabot-paket.gemspec ${CODE_DIR}/paket/
COPY python/Gemfile python/dependabot-python.gemspec ${CODE_DIR}/python/
COPY terraform/Gemfile terraform/dependabot-terraform.gemspec ${CODE_DIR}/terraform/

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ To install the helpers for each language:
4. `cd hex/helpers && mix deps.get && cd -`
5. `cd terraform && helpers/build "$(pwd)/helpers/install-dir/terraform" && cd -`
6. `cd go_modules && helpers/build "$(pwd)/helpers/install-dir/go_modules" && cd -`
7. `cd paket && helpers/build "$(pwd)/helpers/install-dir/paket" && cd -`

## Local development

Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GEMSPECS = %w(
git_submodules/dependabot-git_submodules.gemspec
github_actions/dependabot-github_actions.gemspec
nuget/dependabot-nuget.gemspec
paket/dependabot-nuget.gemspec
gradle/dependabot-gradle.gemspec
maven/dependabot-maven.gemspec
bundler/dependabot-bundler.gemspec
Expand Down
4 changes: 4 additions & 0 deletions bin/docker-dev-shell
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ docker run --rm -ti \
-v "$(pwd)/nuget/dependabot-nuget.gemspec:$CODE_DIR/nuget/dependabot-core.gemspec" \
-v "$(pwd)/nuget/lib:$CODE_DIR/nuget/lib" \
-v "$(pwd)/nuget/spec:$CODE_DIR/nuget/spec" \
-v "$(pwd)/paket/Gemfile:$CODE_DIR/paket/Gemfile" \
-v "$(pwd)/paket/dependabot-paket.gemspec:$CODE_DIR/paket/dependabot-core.gemspec" \
-v "$(pwd)/paket/lib:$CODE_DIR/paket/lib" \
-v "$(pwd)/paket/spec:$CODE_DIR/paket/spec" \
-v "$(pwd)/maven/Gemfile:$CODE_DIR/maven/Gemfile" \
-v "$(pwd)/maven/dependabot-maven.gemspec:$CODE_DIR/maven/dependabot-core.gemspec" \
-v "$(pwd)/maven/lib:$CODE_DIR/maven/lib" \
Expand Down
3 changes: 3 additions & 0 deletions bin/dry-run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# - hex
# - composer
# - nuget
# - paket
# - dep
# - go_modules
# - elm
Expand All @@ -51,6 +52,7 @@
$LOAD_PATH << "./maven/lib"
$LOAD_PATH << "./npm_and_yarn/lib"
$LOAD_PATH << "./nuget/lib"
$LOAD_PATH << "./paket/lib"
$LOAD_PATH << "./python/lib"
$LOAD_PATH << "./terraform/lib"

Expand Down Expand Up @@ -82,6 +84,7 @@
require "dependabot/maven"
require "dependabot/npm_and_yarn"
require "dependabot/nuget"
require "dependabot/paket"
require "dependabot/python"
require "dependabot/terraform"

Expand Down
1 change: 1 addition & 0 deletions omnibus/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ gem "dependabot-hex", path: "../hex"
gem "dependabot-maven", path: "../maven"
gem "dependabot-npm_and_yarn", path: "../npm_and_yarn"
gem "dependabot-nuget", path: "../nuget"
gem "dependabot-paket", path: "../paket"
gem "dependabot-python", path: "../python"
gem "dependabot-terraform", path: "../terraform"

Expand Down
1 change: 1 addition & 0 deletions omnibus/dependabot-omnibus.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "dependabot-maven", Dependabot::VERSION
spec.add_dependency "dependabot-npm_and_yarn", Dependabot::VERSION
spec.add_dependency "dependabot-nuget", Dependabot::VERSION
spec.add_dependency "dependabot-paket", Dependabot::VERSION
spec.add_dependency "dependabot-python", Dependabot::VERSION
spec.add_dependency "dependabot-terraform", Dependabot::VERSION

Expand Down
1 change: 1 addition & 0 deletions omnibus/lib/dependabot/omnibus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require "dependabot/github_actions"
require "dependabot/composer"
require "dependabot/nuget"
require "dependabot/paket"
require "dependabot/gradle"
require "dependabot/maven"
require "dependabot/hex"
Expand Down
12 changes: 12 additions & 0 deletions paket/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/.bundle/
/.env
/tmp
/dependabot-*.gem
Gemfile.lock

# Ionide cache
.ionide/
.vscode/
.yardoc

helpers/install-dir/paket
7 changes: 7 additions & 0 deletions paket/Gemfile
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
22 changes: 22 additions & 0 deletions paket/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## `dependabot-paket`

Paket support for [`dependabot-core`][core-repo].

### Running locally

1. Install native helpers
```
cd helpers && build "$(pwd)/helpers/install-dir/paket" && cd -
```

2. Install Ruby dependencies
```
$ bundle install
```

3. Run tests
```
$ bundle exec rspec spec
```

[core-repo]: https://github.com/dependabot/dependabot-core
28 changes: 28 additions & 0 deletions paket/dependabot-paket.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# frozen_string_literal: true

Gem::Specification.new do |spec|
common_gemspec =
Bundler.load_gemspec_uncached("../common/dependabot-common.gemspec")

spec.name = "dependabot-paket"
spec.summary = ".NET (Paket) support for dependabot"
spec.version = common_gemspec.version
spec.description = common_gemspec.description

spec.author = common_gemspec.author
spec.email = common_gemspec.email
spec.homepage = common_gemspec.homepage
spec.license = common_gemspec.license

spec.require_path = "lib"
spec.files = Dir["lib/**/*"]

spec.required_ruby_version = common_gemspec.required_ruby_version
spec.required_rubygems_version = common_gemspec.required_ruby_version

spec.add_dependency "dependabot-common", Dependabot::VERSION

common_gemspec.development_dependencies.each do |dep|
spec.add_development_dependency dep.name, dep.requirement.to_s
end
end
12 changes: 12 additions & 0 deletions paket/helpers/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"paket": {
"version": "5.247.3",
"commands": [
"paket"
]
}
}
}
Loading