Skip to content

Commit

Permalink
fix: Add support for .net 6 runtime (closes serverless#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-bielecki committed Nov 4, 2022
1 parent f1c480f commit b483ea7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/config/runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ describe("Runtime", () => {
expect(getFunctionWorkerRuntime(Runtime.PYTHON38)).toBe("python");
expect(getFunctionWorkerRuntime(Runtime.DOTNET31)).toBe("dotnet");
expect(getFunctionWorkerRuntime(Runtime.DOTNET22)).toBe("dotnet");
expect(getFunctionWorkerRuntime(Runtime.DOTNET60)).toBe("dotnet");
});
});
8 changes: 6 additions & 2 deletions src/config/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum Runtime {
PYTHON38 = "python3.8",
DOTNET22 = "dotnet2.2",
DOTNET31 = "dotnet3.1",
DOTNET60 = "dotnet6.0",
}

export const supportedRuntimes = [
Expand All @@ -18,7 +19,8 @@ export const supportedRuntimes = [
Runtime.PYTHON37,
Runtime.PYTHON38,
Runtime.DOTNET22,
Runtime.DOTNET31
Runtime.DOTNET31,
Runtime.DOTNET60
]

export const supportedRuntimeSet = new Set(supportedRuntimes);
Expand All @@ -42,7 +44,8 @@ export enum BuildMode {

export const compiledRuntimes = new Set([
Runtime.DOTNET22,
Runtime.DOTNET31
Runtime.DOTNET31,
Runtime.DOTNET60,
]);

export function isCompiledRuntime(runtime: Runtime): boolean {
Expand Down Expand Up @@ -96,4 +99,5 @@ export const dockerImages = {
"python3.7": "PYTHON|3.7",
"python3.8": "PYTHON|3.8",
"dotnet3.1": "DOTNET|3.1",
"dotnet6.0": "DOTNET|6.0",
}
26 changes: 26 additions & 0 deletions src/services/configService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,5 +350,31 @@ export class ConfigService {
constants.tmpBuildDir
],
});

this.cliCommandFactory.registerCommand(`${Runtime.DOTNET60}-${BuildMode.RELEASE}`, {
command: "dotnet",
args: [
"build",
"--configuration",
"release",
"--framework",
"net6.0",
"--output",
constants.tmpBuildDir
],
});

this.cliCommandFactory.registerCommand(`${Runtime.DOTNET60}-${BuildMode.DEBUG}`, {
command: "dotnet",
args: [
"build",
"--configuration",
"debug",
"--framework",
"net6.0",
"--output",
constants.tmpBuildDir
],
});
}
}

0 comments on commit b483ea7

Please sign in to comment.