Skip to content

Commit

Permalink
Fix snapshotty github action (#2016)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz authored Feb 24, 2023
1 parent a3f1d60 commit 22f7e69
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .ci/windows/testnet461.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:: This script runs the tests and stored them in an xml file defined in the
:: LogFilePath property
::
dotnet publish -c Release test\Elastic.Apm.Tests --framework net461 -o outtestnet461
dotnet publish -c Release test\Elastic.Apm.Tests --framework net461 --property:PublishDir=..\..\outtestnet461

dotnet test outtestnet461\Elastic.Apm.Tests.dll ^
--logger:"junit;LogFilePath=test\junit-{framework}-{assembly}.xml;MethodFormat=Class;FailureBodyFormat=Verbose" ^
Expand Down
6 changes: 3 additions & 3 deletions build/scripts/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module Build =
"-c"; "Release"
"-f"; framework
"-v"; "q"
"-o"; output
$"--property:PublishDir=%s{output}"
"--nologo"; "--force"]
)
)
Expand Down Expand Up @@ -174,7 +174,7 @@ module Build =
|> Path.GetFullPath

printfn "Publishing %s %s..." proj framework
DotNet.Exec ["publish" ; proj; "-c"; "Release"; "-f"; framework; "-v"; "q"; "--nologo"; "-o"; output]
DotNet.Exec ["publish" ; proj; "-c"; "Release"; "-f"; framework; "-v"; "q"; "--nologo"; $"--property:PublishDir=%s{output}"]
)
)

Expand All @@ -186,7 +186,7 @@ module Build =
/// Packages projects into nuget packages
let Pack (canary:bool) =
let arguments =
let a = ["pack" ; Paths.Solution; "-c"; "Release"; "-o"; Paths.NugetOutput]
let a = ["pack" ; Paths.Solution; "-c"; "Release"; $"--property:PackageOutputPath=%s{Paths.NugetOutput}"]
if canary then List.append a ["--version-suffix"; versionSuffix]
else a
DotNet.Exec arguments
Expand Down
5 changes: 4 additions & 1 deletion build/scripts/Paths.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ module Paths =
let SampleFolder = "sample"

let BuildOutputFolder = sprintf "%s/output" BuildFolder
let PublishOutputFolder = sprintf "../../%s/output" BuildFolder

/// A path to a folder in the build output folder
let BuildOutput folder = sprintf "%s/%s" BuildOutputFolder folder
/// Used by --property:PublishDir relative to csproject
let PublishDir folder = sprintf "../../%s" <| BuildOutput folder

let NugetOutput = sprintf "%s/_packages" BuildOutputFolder
let NugetOutput = sprintf "%s/_packages" PublishOutputFolder

/// All .NET Core and .NET Framework projects
let Solution = "ElasticApmAgent.sln"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private void Publish(string targetFramework, string outputDirectory, string msBu
var processInfo = new ProcessStartInfo
{
FileName = "dotnet",
Arguments = $"publish -c Release -f {targetFramework} -o {outputDirectory} {msBuildProperties}",
Arguments = $"publish -c Release -f {targetFramework} --property:PublishDir={outputDirectory} {msBuildProperties}",
WorkingDirectory = _projectDirectory
};

Expand Down
2 changes: 1 addition & 1 deletion test/Elastic.Apm.StartupHook.Tests/DotnetProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void Publish()
var processInfo = new ProcessStartInfo
{
FileName = "dotnet",
Arguments = $"publish -c Release -o {_publishDirectory}",
Arguments = $"publish -c Release --property:PublishDir={_publishDirectory}",
WorkingDirectory = Directory
};

Expand Down
2 changes: 1 addition & 1 deletion test/Elastic.Apm.StartupHook.Tests/SampleApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void Publish(string projectDirectory, string targetFramework)
var processInfo = new ProcessStartInfo
{
FileName = "dotnet",
Arguments = $"publish -c Release -f {targetFramework} -o {Path.Combine(_publishDirectory, targetFramework)}",
Arguments = $"publish -c Release -f {targetFramework} --property:PublishDir={Path.Combine(_publishDirectory, targetFramework)}",
WorkingDirectory = projectDirectory
};

Expand Down

0 comments on commit 22f7e69

Please sign in to comment.