Skip to content
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
2 changes: 2 additions & 0 deletions src/cli/install-tool/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { DockerInstallService } from '../tools/docker';
import { BuildxInstallService } from '../tools/docker/buildx';
import { DockerComposeInstallService } from '../tools/docker/compose';
import { DotnetInstallService } from '../tools/dotnet';
import { PaketInstallService } from '../tools/dotnet/paket';
import { ErlangInstallService } from '../tools/erlang';
import { ElixirInstallService } from '../tools/erlang/elixir';
import { FlutterInstallService } from '../tools/flutter';
Expand Down Expand Up @@ -143,6 +144,7 @@ async function prepareInstallContainer(): Promise<Container> {
container.bind(INSTALL_TOOL_TOKEN).to(MavenInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(NixInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(NodeInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(PaketInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(PhpInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(PixiInstallService);
container.bind(INSTALL_TOOL_TOKEN).to(PowershellInstallService);
Expand Down
34 changes: 34 additions & 0 deletions src/cli/tools/dotnet/paket.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { join } from 'node:path';
import { execa } from 'execa';
import { injectFromHierarchy, injectable } from 'inversify';
import { BaseInstallService } from '../../install-tool/base-install.service';

@injectable()
@injectFromHierarchy()
export class PaketInstallService extends BaseInstallService {
readonly name = 'paket';

override async install(version: string): Promise<void> {
const toolPath = this.pathSvc.toolPath(this.name);

const dotnet = join(this.pathSvc.toolPath('dotnet'), 'dotnet');
await execa(dotnet, [
'tool',
'install',
'--tool-path',
toolPath,
this.name,
'--version',
version,
]);
}

override async link(_version: string): Promise<void> {
const src = this.pathSvc.toolPath(this.name);
await this.shellwrapper({ srcDir: src, extraToolEnvs: ['dotnet'] });
}

override async test(_version: string): Promise<void> {
await execa(this.name, ['--version'], { stdio: ['inherit', 'inherit', 1] });
}
}
1 change: 1 addition & 0 deletions src/cli/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const NoPrepareTools = [
'maven',
'nix',
'npm',
'paket',
'pdm',
'pip-tools',
'pipenv',
Expand Down
14 changes: 14 additions & 0 deletions test/dotnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ RUN set -ex; \
dotnet add package Newtonsoft.Json --version 12.0.3; \
dotnet restore --force-evaluate

#--------------------------------------
# test: paket
#--------------------------------------
FROM build AS test-others

# renovate: datasource=nuget packageName=Paket
RUN install-tool paket 9.0.2

WORKDIR /test
RUN set -ex; \
ls -la; env; \
paket init

#--------------------------------------
# final
#--------------------------------------
Expand All @@ -138,3 +151,4 @@ COPY --from=testa /.dummy /.dummy
COPY --from=testb /.dummy /.dummy
COPY --from=testc /.dummy /.dummy
COPY --from=testd /.dummy /.dummy
COPY --from=test-others /.dummy /.dummy
17 changes: 17 additions & 0 deletions test/dotnet/Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,26 @@ FROM base AS test-dotnet
# renovate: datasource=dotnet packageName=dotnet-sdk
RUN install-tool dotnet 10.0.100

#--------------------------------------
# test: paket
#--------------------------------------
FROM base AS test-others

# renovate: datasource=dotnet packageName=dotnet-sdk
RUN install-tool dotnet 10.0.100

# renovate: datasource=nuget packageName=Paket
RUN install-tool paket 9.0.2

WORKDIR /test
RUN set -ex; \
ls -la; env; \
paket init

#--------------------------------------
# Image: final
#--------------------------------------
FROM base

COPY --from=test-dotnet /.dummy /.dummy
COPY --from=test-others /.dummy /.dummy