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

added Google Protobuf files for Akka.CQRS #9

Merged
merged 8 commits into from
May 23, 2019
Merged
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 build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,38 @@ Target "NBench" <| fun _ ->

projects |> Seq.iter runSingleProject

//--------------------------------------------------------------------------------
// Serialization
//--------------------------------------------------------------------------------
Target "Protobuf" <| fun _ ->

let protocPath =
if isWindows then findToolInSubPath "protoc.exe" "tools/Google.Protobuf.Tools/tools/windows_x64"
elif isMacOS then findToolInSubPath "protoc" "tools/Google.Protobuf.Tools/tools/macosx_x64"
else findToolInSubPath "protoc" "tools/Google.Protobuf.Tools/tools/linux_x64"

let protoFiles = [
("Akka.Cqrs.proto", "/src/Akka.CQRS/Serialization/Proto/")
("Akka.Cqrs.Pricing.proto", "/src/Akka.CQRS.Pricing/Serialization/Proto") ]

printfn "Using proto.exe: %s" protocPath

let runProtobuf assembly =
let protoName, destinationPath = assembly
let args = StringBuilder()
|> append (sprintf "-I=%s" (__SOURCE_DIRECTORY__ @@ "/src/protobuf/") )
|> append (sprintf "--csharp_out=internal_access:%s" (__SOURCE_DIRECTORY__ @@ destinationPath))
|> append "--csharp_opt=file_extension=.g.cs"
|> append (__SOURCE_DIRECTORY__ @@ "/src/protobuf" @@ protoName)
|> toText

let result = ExecProcess(fun info ->
info.FileName <- protocPath
info.WorkingDirectory <- (Path.GetDirectoryName (FullName protocPath))
info.Arguments <- args) (System.TimeSpan.FromMinutes 45.0) (* Reasonably long-running task. *)
if result <> 0 then failwithf "protoc failed. %s %s" protocPath args

protoFiles |> Seq.iter (runProtobuf)

//--------------------------------------------------------------------------------
// Code signing targets
Expand Down
14 changes: 14 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@ if (!(Test-Path $DocfxExePath)) {
}
}

###########################################################################
# Google.Protobuf.Tools
###########################################################################

# Make sure Google.Protobuf.Tools has been installed.
$ProtobufExePath = Join-Path $ToolPath "Google.Protobuf.Tools/tools/windows_x64/protoc.exe"
if (!(Test-Path $ProtobufExePath)) {
Write-Host "Installing Google.Protobuf.Tools..."
Invoke-Expression "&`"$NugetPath`" install Google.Protobuf.Tools -ExcludeVersion -Version $ProtobufVersion -OutputDirectory `"$ToolPath`"" | Out-Null;
if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring Google.Protobuf.Tools from NuGet."
}
}

###########################################################################
# SignTool
###########################################################################
Expand Down
36 changes: 0 additions & 36 deletions src/Akka.CQRS.Pricing/Commands/GetPriceHistory.cs

This file was deleted.

Loading