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
11 changes: 11 additions & 0 deletions .autover/changes/b30ca600-2c50-4ed1-91d0-610f711b9d88.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Projects": [
{
"Name": "Amazon.Lambda.Tools",
"Type": "Minor",
"ChangelogMessages": [
"Add support for packaging and deploying C# file-based Lambda functions"
]
}
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

**/node_modules/
**/TestGenerations/
**/artifacts/

**/.vscode
**/.idea
Expand Down
12 changes: 10 additions & 2 deletions aws-extensions-for-dotnet-cli.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32228.430
# Visual Studio Version 18
VisualStudioVersion = 18.3.11222.16 d18.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5EA2C7D-846F-4266-8423-EFC4BA0FE4B6}"
EndProject
Expand Down Expand Up @@ -69,6 +69,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestIntegerFunction", "test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFunctionBuildProps", "testapps\TestFunctionBuildProps\TestFunctionBuildProps\TestFunctionBuildProps.csproj", "{AFA71B8E-F0AA-4704-8C4E-C11130F82B13}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SingleFileLambdaFunctions", "SingleFileLambdaFunctions", "{5711F48F-5491-4C8A-92B2-4D6D849483B5}"
ProjectSection(SolutionItems) = preProject
testapps\SingleFileLambdaFunctions\serverless.template = testapps\SingleFileLambdaFunctions\serverless.template
testapps\SingleFileLambdaFunctions\ToUpperFunctionImplicitAOT.cs = testapps\SingleFileLambdaFunctions\ToUpperFunctionImplicitAOT.cs
testapps\SingleFileLambdaFunctions\ToUpperFunctionNoAOT.cs = testapps\SingleFileLambdaFunctions\ToUpperFunctionNoAOT.cs
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -207,6 +214,7 @@ Global
{69FFA03C-D29F-40E0-9E7F-572D5E10AF77} = {BB3CF729-8213-4DDD-85AE-A5E7754F3944}
{D7F1DFA4-066B-469C-B04C-DF032CF152C1} = {BB3CF729-8213-4DDD-85AE-A5E7754F3944}
{AFA71B8E-F0AA-4704-8C4E-C11130F82B13} = {BB3CF729-8213-4DDD-85AE-A5E7754F3944}
{5711F48F-5491-4C8A-92B2-4D6D849483B5} = {BB3CF729-8213-4DDD-85AE-A5E7754F3944}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DBFC70D6-49A2-40A1-AB08-5D9504AB7112}
Expand Down
5 changes: 3 additions & 2 deletions buildtools/ci.buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ env:
DOTNET_RUNNING_IN_CONTAINER: "true"
phases:
install:
runtime-versions:
dotnet: 8.x
commands:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since CodeBuild doesn't natively support .NET 10 yet I had to update the buildspec to install .NET 10 from MSFT to run the new unit tests that require .NET 10.

- curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 10.0
- dotnet new globaljson --sdk-version 10.0.0 --roll-forward minor
build:
commands:
- dotnet test --verbosity normal test/Amazon.Common.DotNetCli.Tools.Test/Amazon.Common.DotNetCli.Tools.Test.csproj --configuration Release --logger trx --results-directory ./testresults
Expand Down
18 changes: 16 additions & 2 deletions src/Amazon.Common.DotNetCli.Tools/Commands/BaseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,17 @@ public abstract class BaseCommand<TDefaultConfig> : ICommand
public BaseCommand(IToolLogger logger, string workingDirectory)
{
this.Logger = logger;
this.WorkingDirectory = workingDirectory;

// In case working directory was set to a file then use the parent directory as the working directory.
// This can happen in the C# single file scenario.
if (File.Exists(workingDirectory))
{
this.WorkingDirectory = Directory.GetParent(workingDirectory).FullName;
}
else
{
this.WorkingDirectory = workingDirectory;
}
}

public BaseCommand(IToolLogger logger, string workingDirectory, IList<CommandOption> possibleOptions, string[] args)
Expand Down Expand Up @@ -756,7 +766,11 @@ private int WaitForIndexResponse(int min, int max)


public IToolLogger Logger { get; protected set; }
public string WorkingDirectory { get; set; }
public string WorkingDirectory
{
get;
set;
}

protected string GetUserAgentString()
{
Expand Down
Loading