mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +01:00
More WIP
This commit is contained in:
parent
388209b3f2
commit
e9c65f6719
5
.gitignore
vendored
5
.gitignore
vendored
@ -332,3 +332,8 @@ ASALocalRun/
|
||||
.mfractor/
|
||||
.vscode/tasks.json
|
||||
.vscode/launch.json
|
||||
|
||||
# Capnp code behind
|
||||
.capnp.cs
|
||||
/globalPackages
|
||||
*.cs
|
||||
|
@ -4,6 +4,8 @@
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -31,6 +33,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
|
||||
|
@ -8,6 +8,8 @@
|
||||
<LangVersion>7.1</LangVersion>
|
||||
|
||||
<OutputType>Library</OutputType>
|
||||
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@ -15,6 +17,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
|
||||
|
@ -7,6 +7,7 @@
|
||||
<AssemblyName>Capnp.Net.Runtime</AssemblyName>
|
||||
<PackageId>Capnp.Net.Runtime</PackageId>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageOutputPath>..\bin\$(Configuration)</PackageOutputPath>
|
||||
<Authors>Christian Köllner and contributors</Authors>
|
||||
<Description>A Cap'n Proto implementation for .NET Standard & Core</Description>
|
||||
<Product>capnproto-dotnetcore</Product>
|
||||
@ -17,17 +18,14 @@
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<RepositoryType>Git</RepositoryType>
|
||||
<PackageTags>capnp "Cap'n Proto" RPC serialization cerealization</PackageTags>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.0-local$([System.DateTime]::UtcNow.ToString(yyMMddHHmm))</Version>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<DocumentationFile></DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
@ -17,7 +17,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CapnpC.CSharp.MsBuild.Gener
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CapnpC.CSharp.Generator", "CapnpC.CSharp.Generator\CapnpC.CSharp.Generator.csproj", "{C3A3BB49-356E-4762-A190-76D877BE18F7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CapnpC.CSharp.MsBuild.Generation.Tests", "CapnpC.CSharp.MsBuild.Generation.Tests\CapnpC.CSharp.MsBuild.Generation.Tests.csproj", "{EF05AD68-DE31-448E-B88D-4144F928ED5D}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CapnpC.CSharp.MsBuild.Generation.Tests", "CapnpC.CSharp.MsBuild.Generation.Tests\CapnpC.CSharp.MsBuild.Generation.Tests.csproj", "{EF05AD68-DE31-448E-B88D-4144F928ED5D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -5,6 +5,8 @@
|
||||
<RootNamespace>CapnpC.CSharp.Generator.Tests</RootNamespace>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -61,6 +63,7 @@
|
||||
<Generator>SpecFlowSingleFileGenerator</Generator>
|
||||
<LastGenOutput>CodeGenerator.feature.cs</LastGenOutput>
|
||||
<Generator Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"></Generator>
|
||||
<Generator Condition="'$(Configuration)|$(Platform)'=='ReleaseTest|AnyCPU'"></Generator>
|
||||
</SpecFlowFeatureFiles>
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;netcoreapp2.1</TargetFrameworks>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -45,9 +45,10 @@ namespace CapnpC.CSharp.Generator
|
||||
/// Invokes "capnp.exe -o-" with given additional arguments and redirects the output to the C# generator backend.
|
||||
/// </summary>
|
||||
/// <param name="arguments">additional command line arguments</param>
|
||||
/// <param name="workingDirectory">optional working directory</param>
|
||||
/// <returns>generation result</returns>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="arguments"/>is null</exception>
|
||||
public static GenerationResult InvokeCapnpAndGenerate(IEnumerable<string> arguments)
|
||||
public static GenerationResult InvokeCapnpAndGenerate(IEnumerable<string> arguments, string workingDirectory = null)
|
||||
{
|
||||
if (arguments == null)
|
||||
throw new ArgumentNullException(nameof(arguments));
|
||||
@ -64,6 +65,10 @@ namespace CapnpC.CSharp.Generator
|
||||
compiler.StartInfo.UseShellExecute = false;
|
||||
compiler.StartInfo.RedirectStandardOutput = true;
|
||||
compiler.StartInfo.RedirectStandardError = true;
|
||||
if (!string.IsNullOrWhiteSpace(workingDirectory))
|
||||
{
|
||||
compiler.StartInfo.WorkingDirectory = workingDirectory;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -4,6 +4,8 @@
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -13,8 +13,10 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
}
|
||||
|
||||
|
||||
public CsFileGeneratorResult GenerateCodeBehindFile(string capnpFile)
|
||||
public CsFileGeneratorResult GenerateCodeBehindFile(CapnpGenJob job)
|
||||
{
|
||||
string capnpFile = job.CapnpPath;
|
||||
|
||||
// Works around a weird capnp.exe behavior: When the input file is empty, it will spit out an exception dump
|
||||
// instead of a parse error. But the parse error is nice because it contains a generated ID. We want the parse error!
|
||||
// Workaround: Generate a temporary file that contains a single line break (such that it is not empty...)
|
||||
@ -27,7 +29,15 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
File.WriteAllText(tempFile, Environment.NewLine);
|
||||
try
|
||||
{
|
||||
return GenerateCodeBehindFile(tempFile);
|
||||
var jobCopy = new CapnpGenJob()
|
||||
{
|
||||
CapnpPath = tempFile,
|
||||
WorkingDirectory = job.WorkingDirectory
|
||||
};
|
||||
|
||||
jobCopy.AdditionalArguments.AddRange(job.AdditionalArguments);
|
||||
|
||||
return GenerateCodeBehindFile(jobCopy);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -39,7 +49,11 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
{
|
||||
}
|
||||
|
||||
var result = CapnpCompilation.InvokeCapnpAndGenerate(new string[] { capnpFile });
|
||||
var args = new List<string>();
|
||||
args.AddRange(job.AdditionalArguments);
|
||||
args.Add(capnpFile);
|
||||
|
||||
var result = CapnpCompilation.InvokeCapnpAndGenerate(args, job.WorkingDirectory);
|
||||
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
|
||||
namespace CapnpC.CSharp.MsBuild.Generation
|
||||
@ -18,10 +19,8 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
|
||||
public IEnumerable<string> GenerateFilesForProject(
|
||||
string projectPath,
|
||||
List<string> capnpFiles,
|
||||
string projectFolder,
|
||||
string workingDirectory,
|
||||
string additionalOptions)
|
||||
List<CapnpGenJob> capnpFiles,
|
||||
string projectFolder)
|
||||
{
|
||||
using (var capnpCodeBehindGenerator = new CapnpCodeBehindGenerator())
|
||||
{
|
||||
@ -34,9 +33,14 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
yield break;
|
||||
}
|
||||
|
||||
foreach (var capnpFile in capnpFiles)
|
||||
foreach (var genJob in capnpFiles)
|
||||
{
|
||||
var generatorResult = capnpCodeBehindGenerator.GenerateCodeBehindFile(capnpFile);
|
||||
Log.LogMessage(MessageImportance.Normal, "Generate {0}, working dir = {1}, options = {2}",
|
||||
genJob.CapnpPath,
|
||||
genJob.WorkingDirectory,
|
||||
string.Join(" ", genJob.AdditionalArguments));
|
||||
|
||||
var generatorResult = capnpCodeBehindGenerator.GenerateCodeBehindFile(genJob);
|
||||
|
||||
if (!generatorResult.Success)
|
||||
{
|
||||
@ -55,7 +59,7 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
subcategory: null,
|
||||
errorCode: null,
|
||||
helpKeyword: null,
|
||||
file: capnpFile,
|
||||
file: genJob.CapnpPath,
|
||||
lineNumber: message.Line,
|
||||
columnNumber: message.Column,
|
||||
endLineNumber: message.Line,
|
||||
|
@ -11,19 +11,22 @@
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<Version>1.0.0</Version>
|
||||
|
||||
<Version>1.0-local$([System.DateTime]::UtcNow.ToString(yyMMddHHmm))</Version>
|
||||
|
||||
<NuspecFile>$(MSBuildThisFileDirectory)CapnpC.CSharp.MsBuild.Generation.nuspec</NuspecFile>
|
||||
<NuspecProperties>version=$(Version);configuration=$(Configuration)</NuspecProperties>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageOutputPath>..\bin\$(Configuration)</PackageOutputPath>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Composition" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.SDK" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.SDK.Tools" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Threading" />
|
||||
<PackageReference Include="Microsoft.Xaml" />
|
||||
<PackageReference Include="System.Collections.Immutable" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -41,7 +44,8 @@
|
||||
<PackageReference Update="Microsoft.VisualStudio.ProjectSystem" Version="15.8.243" />
|
||||
<PackageReference Update="Microsoft.VisualStudio.ProjectSystem.SDK" Version="15.8.243" />
|
||||
<PackageReference Update="Microsoft.VisualStudio.ProjectSystem.SDK.Tools" Version="15.8.243" />
|
||||
<PackageReference Update="Microsoft.VisualStudio.Threading" Version="15.8.132" />
|
||||
<PackageReference Update="Microsoft.VisualStudio.Threading" Version="16.3.52" />
|
||||
<PackageReference Update="Microsoft.Xaml" Version="4.0.0.1" />
|
||||
<PackageReference Update="System.Collections.Immutable" Version="1.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -103,4 +107,8 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="rmdir /s /q $(SolutionDir)MsBuildGenerationTest\obj" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
@ -25,13 +25,43 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
|
||||
public ITaskItem[] CapnpFiles { get; set; }
|
||||
|
||||
public string WorkingDirectory { get; set; }
|
||||
|
||||
public string AdditionalOptions { get; set; }
|
||||
|
||||
[Output]
|
||||
public ITaskItem[] GeneratedFiles { get; private set; }
|
||||
|
||||
static CapnpGenJob ToGenJob(ITaskItem item)
|
||||
{
|
||||
var job = new CapnpGenJob()
|
||||
{
|
||||
CapnpPath = item.GetMetadata("FullPath"),
|
||||
WorkingDirectory = item.GetMetadata("WorkingDirectory")
|
||||
};
|
||||
|
||||
string importPaths = item.GetMetadata("ImportPaths");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(importPaths))
|
||||
{
|
||||
job.AdditionalArguments.AddRange(importPaths.Split(new char[] { ';' },
|
||||
StringSplitOptions.RemoveEmptyEntries).Select(p => $"-I\"{p.TrimEnd('\\')}\""));
|
||||
}
|
||||
|
||||
string sourcePrefix = item.GetMetadata("SourcePrefix");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(sourcePrefix))
|
||||
{
|
||||
job.AdditionalArguments.Add(sourcePrefix);
|
||||
}
|
||||
|
||||
|
||||
string verbose = item.GetMetadata("Verbose");
|
||||
|
||||
if ("true".Equals(verbose, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
job.AdditionalArguments.Add("--verbose");
|
||||
}
|
||||
|
||||
return job;
|
||||
}
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
try
|
||||
@ -56,16 +86,14 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
|
||||
var generator = CodeBehindGenerator ?? new CapnpFileCodeBehindGenerator(Log);
|
||||
|
||||
Log.LogWithNameTag(Log.LogMessage, "Starting GenerateFeatureFileCodeBehind");
|
||||
Log.LogWithNameTag(Log.LogMessage, "Starting GenerateCapnpFileCodeBehind");
|
||||
|
||||
var capnpFiles = CapnpFiles?.Select(i => i.ItemSpec).ToList() ?? new List<string>();
|
||||
var capnpFiles = CapnpFiles?.Select(ToGenJob).ToList() ?? new List<CapnpGenJob>();
|
||||
|
||||
var generatedFiles = generator.GenerateFilesForProject(
|
||||
ProjectPath,
|
||||
capnpFiles,
|
||||
ProjectFolder,
|
||||
WorkingDirectory,
|
||||
AdditionalOptions);
|
||||
ProjectFolder);
|
||||
|
||||
GeneratedFiles = generatedFiles.Select(file => new TaskItem { ItemSpec = file }).ToArray();
|
||||
|
||||
|
@ -4,6 +4,6 @@ namespace CapnpC.CSharp.MsBuild.Generation
|
||||
{
|
||||
public interface ICapnpcCsharpGenerator
|
||||
{
|
||||
IEnumerable<string> GenerateFilesForProject(string projectPath, List<string> capnpFiles, string projectFolder, string workingDirectory, string additionalOptions);
|
||||
IEnumerable<string> GenerateFilesForProject(string projectPath, List<CapnpGenJob> jobs, string projectFolder);
|
||||
}
|
||||
}
|
@ -27,17 +27,20 @@
|
||||
|
||||
<StringProperty Name="DependentUpon" Visible="false" />
|
||||
<StringProperty Name="Link" Visible="false" />
|
||||
<StringProperty Name="Generator" Visible="true" DisplayName="Custom Tool"/>
|
||||
<!--<StringProperty Name="Generator" Visible="true" DisplayName="Custom Tool"/>-->
|
||||
|
||||
<!--<StringProperty Name="WorkingDirectory" DisplayName="Working Directory" ReadOnly="false" Category="Misc">
|
||||
<StringProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" ItemType="WorkingDirectory" PersistedName="WorkingDirectory" />
|
||||
</StringProperty.DataSource>
|
||||
</StringProperty>
|
||||
<!--<BoolProperty Name="Exclude" DisplayName="Exclude from build" Category="Misc" Visible="True"
|
||||
Description="Whether to skip code generation for this item"/>-->
|
||||
|
||||
<StringProperty Name="AdditionalOptions" DisplayName="Additional command line options" ReadOnly="false" Category="Misc">
|
||||
<StringProperty.DataSource>
|
||||
<DataSource Persistence="ProjectFile" ItemType="AdditionalOptions" PersistedName="AdditionalOptions" />
|
||||
</StringProperty.DataSource>
|
||||
</StringProperty>-->
|
||||
<StringProperty Name="WorkingDirectory" DisplayName="Working Directory" ReadOnly="false" Category="Misc" Visible="True"
|
||||
Subtype="Folder" Description="Working directory for capnp"/>
|
||||
|
||||
<StringListProperty Name="ImportPaths" DisplayName="Import Paths" Category="Misc" Visible="True" Subtype="Folder"
|
||||
Description="List of directories searched for non-relative imports (ones that start with a '/')"/>
|
||||
|
||||
<StringProperty Name="SourcePrefix" DisplayName="Source Prefix" Switch="src-prefix" SwitchPrefix="--" Category="Misc" Visible="True"
|
||||
Description="If a file specified for compilation starts with the specified prefix, remove the prefix for the purpose of deciding the names of output files."/>
|
||||
|
||||
<BoolProperty Name="Verbose" DisplayName="Verbose" Switch="verbose" SwitchPrefix="--" Category="Misc" Visible="True"
|
||||
Description="Log informational messages to stderr; useful for debugging."/>
|
||||
</Rule>
|
@ -47,6 +47,7 @@
|
||||
<CapnpFiles Include="**\*.capnp" >
|
||||
<CodeBehindFile>%(RelativeDir)%(Filename).capnp.cs</CodeBehindFile>
|
||||
<Visible>$(UsingMicrosoftNETSdk)</Visible>
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
</CapnpFiles>
|
||||
|
||||
<!-- obsolete codebehind files, scenarios:
|
||||
|
31
MsBuildGenerationTest/AddressBook.capnp
Normal file
31
MsBuildGenerationTest/AddressBook.capnp
Normal file
@ -0,0 +1,31 @@
|
||||
@0xebf92c49b1687ddb;
|
||||
|
||||
struct Person {
|
||||
id @0 :UInt32;
|
||||
name @1 :Text;
|
||||
email @2 :Text;
|
||||
phones @3 :List(PhoneNumber);
|
||||
|
||||
struct PhoneNumber {
|
||||
number @0 :Text;
|
||||
type @1 :Type;
|
||||
|
||||
enum Type {
|
||||
mobile @0;
|
||||
home @1;
|
||||
work @2;
|
||||
}
|
||||
}
|
||||
|
||||
employment :union {
|
||||
unemployed @4 :Void;
|
||||
employer @5 :Text;
|
||||
school @6 :Text;
|
||||
selfEmployed @7 :Void;
|
||||
# We assume that a person is only one of these.
|
||||
}
|
||||
}
|
||||
|
||||
struct AddressBook {
|
||||
people @0 :List(Person);
|
||||
}
|
56
MsBuildGenerationTest/MsBuildGenerationTest.csproj
Normal file
56
MsBuildGenerationTest/MsBuildGenerationTest.csproj
Normal file
@ -0,0 +1,56 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CapnpFiles Remove="capnp\persistent.capnp" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Capnp.Net.Runtime" Version="1.0-local*" />
|
||||
<PackageReference Include="CapnpC.CSharp.MsBuild.Generation" Version="1.0-local*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CapnpFiles Update="capnp\c++.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<Verbose Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">true</Verbose>
|
||||
</CapnpFiles>
|
||||
<CapnpFiles Update="capnp\compat\json-test.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<ImportPaths>$(ProjectDir);%(ImportPaths)</ImportPaths>
|
||||
</CapnpFiles>
|
||||
<CapnpFiles Update="capnp\compat\json.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<ImportPaths>$(ProjectDir);%(ImportPaths)</ImportPaths>
|
||||
</CapnpFiles>
|
||||
<CapnpFiles Update="capnp\rpc-twoparty.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<ImportPaths>$(ProjectDir);%(ImportPaths)</ImportPaths>
|
||||
</CapnpFiles>
|
||||
<CapnpFiles Update="capnp\rpc.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<ImportPaths>$(ProjectDir);%(ImportPaths)</ImportPaths>
|
||||
</CapnpFiles>
|
||||
<CapnpFiles Update="capnp\schema.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<ImportPaths>$(ProjectDir);%(ImportPaths)</ImportPaths>
|
||||
</CapnpFiles>
|
||||
<CapnpFiles Update="capnp\test-import.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<ImportPaths>$(ProjectDir);%(ImportPaths)</ImportPaths>
|
||||
</CapnpFiles>
|
||||
<CapnpFiles Update="capnp\test-import2.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<ImportPaths>$(ProjectDir);%(ImportPaths)</ImportPaths>
|
||||
</CapnpFiles>
|
||||
<CapnpFiles Update="capnp\test.capnp">
|
||||
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||
<ImportPaths>$(ProjectDir);%(ImportPaths)</ImportPaths>
|
||||
</CapnpFiles>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
25
MsBuildGenerationTest/MsBuildGenerationTest.sln
Normal file
25
MsBuildGenerationTest/MsBuildGenerationTest.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29306.81
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsBuildGenerationTest", "MsBuildGenerationTest.csproj", "{D2CFBABF-7028-4761-9B24-6054008F41A0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D2CFBABF-7028-4761-9B24-6054008F41A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D2CFBABF-7028-4761-9B24-6054008F41A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D2CFBABF-7028-4761-9B24-6054008F41A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D2CFBABF-7028-4761-9B24-6054008F41A0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {76182204-2E1A-4AEF-AB7B-13725C36FFF2}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
26
MsBuildGenerationTest/capnp/c++.capnp
Normal file
26
MsBuildGenerationTest/capnp/c++.capnp
Normal file
@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0xbdf87d7bb8304e81;
|
||||
$namespace("capnp::annotations");
|
||||
|
||||
annotation namespace(file): Text;
|
||||
annotation name(field, enumerant, struct, enum, interface, method, param, group, union): Text;
|
116
MsBuildGenerationTest/capnp/compat/json-test.capnp
Normal file
116
MsBuildGenerationTest/capnp/compat/json-test.capnp
Normal file
@ -0,0 +1,116 @@
|
||||
# Copyright (c) 2018 Cloudflare, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0xc9d405cf4333e4c9;
|
||||
|
||||
using Json = import "/capnp/compat/json.capnp";
|
||||
|
||||
$import "/capnp/c++.capnp".namespace("capnp");
|
||||
|
||||
struct TestJsonAnnotations {
|
||||
someField @0 :Text $Json.name("names-can_contain!anything Really");
|
||||
|
||||
aGroup :group $Json.flatten() {
|
||||
flatFoo @1 :UInt32;
|
||||
flatBar @2 :Text;
|
||||
flatBaz :group $Json.name("renamed-flatBaz") {
|
||||
hello @3 :Bool;
|
||||
}
|
||||
doubleFlat :group $Json.flatten() {
|
||||
flatQux @4 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
prefixedGroup :group $Json.flatten(prefix = "pfx.") {
|
||||
foo @5 :Text;
|
||||
bar @6 :UInt32 $Json.name("renamed-bar");
|
||||
baz :group {
|
||||
hello @7 :Bool;
|
||||
}
|
||||
morePrefix :group $Json.flatten(prefix = "xfp.") {
|
||||
qux @8 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
aUnion :union $Json.flatten() $Json.discriminator(name = "union-type") {
|
||||
foo :group $Json.flatten() {
|
||||
fooMember @9 :Text;
|
||||
multiMember @10 :UInt32;
|
||||
}
|
||||
bar :group $Json.flatten() $Json.name("renamed-bar") {
|
||||
barMember @11 :UInt32;
|
||||
multiMember @12 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
dependency @13 :TestJsonAnnotations2;
|
||||
# To test that dependencies are loaded even if not flattened.
|
||||
|
||||
simpleGroup :group {
|
||||
# To test that group types are loaded even if not flattened.
|
||||
grault @14 :Text $Json.name("renamed-grault");
|
||||
}
|
||||
|
||||
enums @15 :List(TestJsonAnnotatedEnum);
|
||||
|
||||
innerJson @16 :Json.Value;
|
||||
|
||||
customFieldHandler @17 :Text;
|
||||
|
||||
testBase64 @18 :Data $Json.base64;
|
||||
testHex @19 :Data $Json.hex;
|
||||
|
||||
bUnion :union $Json.flatten() $Json.discriminator(valueName = "bValue") {
|
||||
foo @20 :Text;
|
||||
bar @21 :UInt32 $Json.name("renamed-bar");
|
||||
}
|
||||
|
||||
externalUnion @22 :TestJsonAnnotations3;
|
||||
|
||||
unionWithVoid :union $Json.discriminator(name = "type") {
|
||||
intValue @23 :UInt32;
|
||||
voidValue @24 :Void;
|
||||
textValue @25 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestJsonAnnotations2 {
|
||||
foo @0 :Text $Json.name("renamed-foo");
|
||||
cycle @1 :TestJsonAnnotations;
|
||||
}
|
||||
|
||||
struct TestJsonAnnotations3 $Json.discriminator(name = "type") {
|
||||
union {
|
||||
foo @0 :UInt32;
|
||||
bar @1 :TestFlattenedStruct $Json.flatten();
|
||||
}
|
||||
}
|
||||
|
||||
struct TestFlattenedStruct {
|
||||
value @0 :Text;
|
||||
}
|
||||
|
||||
enum TestJsonAnnotatedEnum {
|
||||
foo @0;
|
||||
bar @1 $Json.name("renamed-bar");
|
||||
baz @2 $Json.name("renamed-baz");
|
||||
qux @3;
|
||||
}
|
112
MsBuildGenerationTest/capnp/compat/json.capnp
Normal file
112
MsBuildGenerationTest/capnp/compat/json.capnp
Normal file
@ -0,0 +1,112 @@
|
||||
# Copyright (c) 2015 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0x8ef99297a43a5e34;
|
||||
|
||||
$import "/capnp/c++.capnp".namespace("capnp::json");
|
||||
|
||||
struct Value {
|
||||
union {
|
||||
null @0 :Void;
|
||||
boolean @1 :Bool;
|
||||
number @2 :Float64;
|
||||
string @3 :Text;
|
||||
array @4 :List(Value);
|
||||
object @5 :List(Field);
|
||||
# Standard JSON values.
|
||||
|
||||
call @6 :Call;
|
||||
# Non-standard: A "function call", applying a named function (named by a single identifier)
|
||||
# to a parameter list. Examples:
|
||||
#
|
||||
# BinData(0, "Zm9vCg==")
|
||||
# ISODate("2015-04-15T08:44:50.218Z")
|
||||
#
|
||||
# Mongo DB users will recognize the above as exactly the syntax Mongo uses to represent BSON
|
||||
# "binary" and "date" types in text, since JSON has no analog of these. This is basically the
|
||||
# reason this extension exists. We do NOT recommend using `call` unless you specifically need
|
||||
# to be compatible with some silly format that uses this syntax.
|
||||
}
|
||||
|
||||
struct Field {
|
||||
name @0 :Text;
|
||||
value @1 :Value;
|
||||
}
|
||||
|
||||
struct Call {
|
||||
function @0 :Text;
|
||||
params @1 :List(Value);
|
||||
}
|
||||
}
|
||||
|
||||
# ========================================================================================
|
||||
# Annotations to control parsing. Typical usage:
|
||||
#
|
||||
# using Json = import "/capnp/compat/json.capnp";
|
||||
#
|
||||
# And then later on:
|
||||
#
|
||||
# myField @0 :Text $Json.name("my_field");
|
||||
|
||||
annotation name @0xfa5b1fd61c2e7c3d (field, enumerant, method, group, union): Text;
|
||||
# Define an alternative name to use when encoding the given item in JSON. This can be used, for
|
||||
# example, to use snake_case names where needed, even though Cap'n Proto uses strictly camelCase.
|
||||
#
|
||||
# (However, because JSON is derived from JavaScript, you *should* use camelCase names when
|
||||
# defining JSON-based APIs. But, when supporting a pre-existing API you may not have a choice.)
|
||||
|
||||
annotation flatten @0x82d3e852af0336bf (field, group, union): FlattenOptions;
|
||||
# Specifies that an aggregate field should be flattened into its parent.
|
||||
#
|
||||
# In order to flatten a member of a union, the union (or, for an anonymous union, the parent
|
||||
# struct type) must have the $jsonDiscriminator annotation.
|
||||
#
|
||||
# TODO(someday): Maybe support "flattening" a List(Value.Field) as a way to support unknown JSON
|
||||
# fields?
|
||||
|
||||
struct FlattenOptions {
|
||||
prefix @0 :Text = "";
|
||||
# Optional: Adds the given prefix to flattened field names.
|
||||
}
|
||||
|
||||
annotation discriminator @0xcfa794e8d19a0162 (struct, union): DiscriminatorOptions;
|
||||
# Specifies that a union's variant will be decided not by which fields are present, but instead
|
||||
# by a special discriminator field. The value of the discriminator field is a string naming which
|
||||
# variant is active. This allows the members of the union to have the $jsonFlatten annotation, or
|
||||
# to all have the same name.
|
||||
|
||||
struct DiscriminatorOptions {
|
||||
name @0 :Text;
|
||||
# The name of the discriminator field. Defaults to matching the name of the union.
|
||||
|
||||
valueName @1 :Text;
|
||||
# If non-null, specifies that the union's value shall have the given field name, rather than the
|
||||
# value's name. In this case the union's variant can only be determined by looking at the
|
||||
# discriminant field, not by inspecting which value field is present.
|
||||
#
|
||||
# It is an error to use `valueName` while also declaring some variants as $flatten.
|
||||
}
|
||||
|
||||
annotation base64 @0xd7d879450a253e4b (field): Void;
|
||||
# Place on a field of type `Data` to indicate that its JSON representation is a Base64 string.
|
||||
|
||||
annotation hex @0xf061e22f0ae5c7b5 (field): Void;
|
||||
# Place on a field of type `Data` to indicate that its JSON representation is a hex string.
|
139
MsBuildGenerationTest/capnp/persistent.capnp
Normal file
139
MsBuildGenerationTest/capnp/persistent.capnp
Normal file
@ -0,0 +1,139 @@
|
||||
# Copyright (c) 2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0xb8630836983feed7;
|
||||
|
||||
$import "/capnp/c++.capnp".namespace("capnp");
|
||||
|
||||
interface Persistent@0xc8cb212fcd9f5691(SturdyRef, Owner) {
|
||||
# Interface implemented by capabilities that outlive a single connection. A client may save()
|
||||
# the capability, producing a SturdyRef. The SturdyRef can be stored to disk, then later used to
|
||||
# obtain a new reference to the capability on a future connection.
|
||||
#
|
||||
# The exact format of SturdyRef depends on the "realm" in which the SturdyRef appears. A "realm"
|
||||
# is an abstract space in which all SturdyRefs have the same format and refer to the same set of
|
||||
# resources. Every vat is in exactly one realm. All capability clients within that vat must
|
||||
# produce SturdyRefs of the format appropriate for the realm.
|
||||
#
|
||||
# Similarly, every VatNetwork also resides in a particular realm. Usually, a vat's "realm"
|
||||
# corresponds to the realm of its main VatNetwork. However, a Vat can in fact communicate over
|
||||
# a VatNetwork in a different realm -- in this case, all SturdyRefs need to be transformed when
|
||||
# coming or going through said VatNetwork. The RPC system has hooks for registering
|
||||
# transformation callbacks for this purpose.
|
||||
#
|
||||
# Since the format of SturdyRef is realm-dependent, it is not defined here. An application should
|
||||
# choose an appropriate realm for itself as part of its design. Note that under Sandstorm, every
|
||||
# application exists in its own realm and is therefore free to define its own SturdyRef format;
|
||||
# the Sandstorm platform handles translating between realms.
|
||||
#
|
||||
# Note that whether a capability is persistent is often orthogonal to its type. In these cases,
|
||||
# the capability's interface should NOT inherit `Persistent`; instead, just perform a cast at
|
||||
# runtime. It's not type-safe, but trying to be type-safe in these cases will likely lead to
|
||||
# tears. In cases where a particular interface only makes sense on persistent capabilities, it
|
||||
# still should not explicitly inherit Persistent because the `SturdyRef` and `Owner` types will
|
||||
# vary between realms (they may even be different at the call site than they are on the
|
||||
# implementation). Instead, mark persistent interfaces with the $persistent annotation (defined
|
||||
# below).
|
||||
#
|
||||
# Sealing
|
||||
# -------
|
||||
#
|
||||
# As an added security measure, SturdyRefs may be "sealed" to a particular owner, such that
|
||||
# if the SturdyRef itself leaks to a third party, that party cannot actually restore it because
|
||||
# they are not the owner. To restore a sealed capability, you must first prove to its host that
|
||||
# you are the rightful owner. The precise mechanism for this authentication is defined by the
|
||||
# realm.
|
||||
#
|
||||
# Sealing is a defense-in-depth mechanism meant to mitigate damage in the case of catastrophic
|
||||
# attacks. For example, say an attacker temporarily gains read access to a database full of
|
||||
# SturdyRefs: it would be unfortunate if it were then necessary to revoke every single reference
|
||||
# in the database to prevent the attacker from using them.
|
||||
#
|
||||
# In general, an "owner" is a course-grained identity. Because capability-based security is still
|
||||
# the primary mechanism of security, it is not necessary nor desirable to have a separate "owner"
|
||||
# identity for every single process or object; that is exactly what capabilities are supposed to
|
||||
# avoid! Instead, it makes sense for an "owner" to literally identify the owner of the machines
|
||||
# where the capability is stored. If untrusted third parties are able to run arbitrary code on
|
||||
# said machines, then the sandbox for that code should be designed using Distributed Confinement
|
||||
# such that the third-party code never sees the bits of the SturdyRefs and cannot directly
|
||||
# exercise the owner's power to restore refs. See:
|
||||
#
|
||||
# http://www.erights.org/elib/capability/dist-confine.html
|
||||
#
|
||||
# Resist the urge to represent an Owner as a simple public key. The whole point of sealing is to
|
||||
# defend against leaked-storage attacks. Such attacks can easily result in the owner's private
|
||||
# key being stolen as well. A better solution is for `Owner` to contain a simple globally unique
|
||||
# identifier for the owner, and for everyone to separately maintain a mapping of owner IDs to
|
||||
# public keys. If an owner's private key is compromised, then humans will need to communicate
|
||||
# and agree on a replacement public key, then update the mapping.
|
||||
#
|
||||
# As a concrete example, an `Owner` could simply contain a domain name, and restoring a SturdyRef
|
||||
# would require signing a request using the domain's private key. Authenticating this key could
|
||||
# be accomplished through certificate authorities or web-of-trust techniques.
|
||||
|
||||
save @0 SaveParams -> SaveResults;
|
||||
# Save a capability persistently so that it can be restored by a future connection. Not all
|
||||
# capabilities can be saved -- application interfaces should define which capabilities support
|
||||
# this and which do not.
|
||||
|
||||
struct SaveParams {
|
||||
sealFor @0 :Owner;
|
||||
# Seal the SturdyRef so that it can only be restored by the specified Owner. This is meant
|
||||
# to mitigate damage when a SturdyRef is leaked. See comments above.
|
||||
#
|
||||
# Leaving this value null may or may not be allowed; it is up to the realm to decide. If a
|
||||
# realm does allow a null owner, this should indicate that anyone is allowed to restore the
|
||||
# ref.
|
||||
}
|
||||
struct SaveResults {
|
||||
sturdyRef @0 :SturdyRef;
|
||||
}
|
||||
}
|
||||
|
||||
interface RealmGateway(InternalRef, ExternalRef, InternalOwner, ExternalOwner) {
|
||||
# Interface invoked when a SturdyRef is about to cross realms. The RPC system supports providing
|
||||
# a RealmGateway as a callback hook when setting up RPC over some VatNetwork.
|
||||
|
||||
import @0 (cap :Persistent(ExternalRef, ExternalOwner),
|
||||
params :Persistent(InternalRef, InternalOwner).SaveParams)
|
||||
-> Persistent(InternalRef, InternalOwner).SaveResults;
|
||||
# Given an external capability, save it and return an internal reference. Used when someone
|
||||
# inside the realm tries to save a capability from outside the realm.
|
||||
|
||||
export @1 (cap :Persistent(InternalRef, InternalOwner),
|
||||
params :Persistent(ExternalRef, ExternalOwner).SaveParams)
|
||||
-> Persistent(ExternalRef, ExternalOwner).SaveResults;
|
||||
# Given an internal capability, save it and return an external reference. Used when someone
|
||||
# outside the realm tries to save a capability from inside the realm.
|
||||
}
|
||||
|
||||
annotation persistent(interface, field) :Void;
|
||||
# Apply this annotation to interfaces for objects that will always be persistent, instead of
|
||||
# extending the Persistent capability, since the correct type parameters to Persistent depend on
|
||||
# the realm, which is orthogonal to the interface type and therefore should not be defined
|
||||
# along-side it.
|
||||
#
|
||||
# You may also apply this annotation to a capability-typed field which will always contain a
|
||||
# persistent capability, but where the capability's interface itself is not already marked
|
||||
# persistent.
|
||||
#
|
||||
# Note that absence of the $persistent annotation doesn't mean a capability of that type isn't
|
||||
# persistent; it just means not *all* such capabilities are persistent.
|
169
MsBuildGenerationTest/capnp/rpc-twoparty.capnp
Normal file
169
MsBuildGenerationTest/capnp/rpc-twoparty.capnp
Normal file
@ -0,0 +1,169 @@
|
||||
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0xa184c7885cdaf2a1;
|
||||
# This file defines the "network-specific parameters" in rpc.capnp to support a network consisting
|
||||
# of two vats. Each of these vats may in fact be in communication with other vats, but any
|
||||
# capabilities they forward must be proxied. Thus, to each end of the connection, all capabilities
|
||||
# received from the other end appear to live in a single vat.
|
||||
#
|
||||
# Two notable use cases for this model include:
|
||||
# - Regular client-server communications, where a remote client machine (perhaps living on an end
|
||||
# user's personal device) connects to a server. The server may be part of a cluster, and may
|
||||
# call on other servers in the cluster to help service the user's request. It may even obtain
|
||||
# capabilities from these other servers which it passes on to the user. To simplify network
|
||||
# common traversal problems (e.g. if the user is behind a firewall), it is probably desirable to
|
||||
# multiplex all communications between the server cluster and the client over the original
|
||||
# connection rather than form new ones. This connection should use the two-party protocol, as
|
||||
# the client has no interest in knowing about additional servers.
|
||||
# - Applications running in a sandbox. A supervisor process may execute a confined application
|
||||
# such that all of the confined app's communications with the outside world must pass through
|
||||
# the supervisor. In this case, the connection between the confined app and the supervisor might
|
||||
# as well use the two-party protocol, because the confined app is intentionally prevented from
|
||||
# talking to any other vat anyway. Any external resources will be proxied through the supervisor,
|
||||
# and so to the contained app will appear as if they were hosted by the supervisor itself.
|
||||
#
|
||||
# Since there are only two vats in this network, there is never a need for three-way introductions,
|
||||
# so level 3 is free. Moreover, because it is never necessary to form new connections, the
|
||||
# two-party protocol can be used easily anywhere where a two-way byte stream exists, without regard
|
||||
# to where that byte stream goes or how it was initiated. This makes the two-party runtime library
|
||||
# highly reusable.
|
||||
#
|
||||
# Joins (level 4) _could_ be needed in cases where one or both vats are participating in other
|
||||
# networks that use joins. For instance, if Alice and Bob are speaking through the two-party
|
||||
# protocol, and Bob is also participating on another network, Bob may send Alice two or more
|
||||
# proxied capabilities which, unbeknownst to Bob at the time, are in fact pointing at the same
|
||||
# remote object. Alice may then request to join these capabilities, at which point Bob will have
|
||||
# to forward the join to the other network. Note, however, that if Alice is _not_ participating on
|
||||
# any other network, then Alice will never need to _receive_ a Join, because Alice would always
|
||||
# know when two locally-hosted capabilities are the same and would never export a redundant alias
|
||||
# to Bob. So, Alice can respond to all incoming joins with an error, and only needs to implement
|
||||
# outgoing joins if she herself desires to use this feature. Also, outgoing joins are relatively
|
||||
# easy to implement in this scenario.
|
||||
#
|
||||
# What all this means is that a level 4 implementation of the confined network is barely more
|
||||
# complicated than a level 2 implementation. However, such an implementation allows the "client"
|
||||
# or "confined" app to access the server's/supervisor's network with equal functionality to any
|
||||
# native participant. In other words, an application which implements only the two-party protocol
|
||||
# can be paired with a proxy app in order to participate in any network.
|
||||
#
|
||||
# So, when implementing Cap'n Proto in a new language, it makes sense to implement only the
|
||||
# two-party protocol initially, and then pair applications with an appropriate proxy written in
|
||||
# C++, rather than implement other parameterizations of the RPC protocol directly.
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("capnp::rpc::twoparty");
|
||||
|
||||
# Note: SturdyRef is not specified here. It is up to the application to define semantics of
|
||||
# SturdyRefs if desired.
|
||||
|
||||
enum Side {
|
||||
server @0;
|
||||
# The object lives on the "server" or "supervisor" end of the connection. Only the
|
||||
# server/supervisor knows how to interpret the ref; to the client, it is opaque.
|
||||
#
|
||||
# Note that containers intending to implement strong confinement should rewrite SturdyRefs
|
||||
# received from the external network before passing them on to the confined app. The confined
|
||||
# app thus does not ever receive the raw bits of the SturdyRef (which it could perhaps
|
||||
# maliciously leak), but instead receives only a thing that it can pass back to the container
|
||||
# later to restore the ref. See:
|
||||
# http://www.erights.org/elib/capability/dist-confine.html
|
||||
|
||||
client @1;
|
||||
# The object lives on the "client" or "confined app" end of the connection. Only the client
|
||||
# knows how to interpret the ref; to the server/supervisor, it is opaque. Most clients do not
|
||||
# actually know how to persist capabilities at all, so use of this is unusual.
|
||||
}
|
||||
|
||||
struct VatId {
|
||||
side @0 :Side;
|
||||
}
|
||||
|
||||
struct ProvisionId {
|
||||
# Only used for joins, since three-way introductions never happen on a two-party network.
|
||||
|
||||
joinId @0 :UInt32;
|
||||
# The ID from `JoinKeyPart`.
|
||||
}
|
||||
|
||||
struct RecipientId {}
|
||||
# Never used, because there are only two parties.
|
||||
|
||||
struct ThirdPartyCapId {}
|
||||
# Never used, because there is no third party.
|
||||
|
||||
struct JoinKeyPart {
|
||||
# Joins in the two-party case are simplified by a few observations.
|
||||
#
|
||||
# First, on a two-party network, a Join only ever makes sense if the receiving end is also
|
||||
# connected to other networks. A vat which is not connected to any other network can safely
|
||||
# reject all joins.
|
||||
#
|
||||
# Second, since a two-party connection bisects the network -- there can be no other connections
|
||||
# between the networks at either end of the connection -- if one part of a join crosses the
|
||||
# connection, then _all_ parts must cross it. Therefore, a vat which is receiving a Join request
|
||||
# off some other network which needs to be forwarded across the two-party connection can
|
||||
# collect all the parts on its end and only forward them across the two-party connection when all
|
||||
# have been received.
|
||||
#
|
||||
# For example, imagine that Alice and Bob are vats connected over a two-party connection, and
|
||||
# each is also connected to other networks. At some point, Alice receives one part of a Join
|
||||
# request off her network. The request is addressed to a capability that Alice received from
|
||||
# Bob and is proxying to her other network. Alice goes ahead and responds to the Join part as
|
||||
# if she hosted the capability locally (this is important so that if not all the Join parts end
|
||||
# up at Alice, the original sender can detect the failed Join without hanging). As other parts
|
||||
# trickle in, Alice verifies that each part is addressed to a capability from Bob and continues
|
||||
# to respond to each one. Once the complete set of join parts is received, Alice checks if they
|
||||
# were all for the exact same capability. If so, she doesn't need to send anything to Bob at
|
||||
# all. Otherwise, she collects the set of capabilities (from Bob) to which the join parts were
|
||||
# addressed and essentially initiates a _new_ Join request on those capabilities to Bob. Alice
|
||||
# does not forward the Join parts she received herself, but essentially forwards the Join as a
|
||||
# whole.
|
||||
#
|
||||
# On Bob's end, since he knows that Alice will always send all parts of a Join together, he
|
||||
# simply waits until he's received them all, then performs a join on the respective capabilities
|
||||
# as if it had been requested locally.
|
||||
|
||||
joinId @0 :UInt32;
|
||||
# A number identifying this join, chosen by the sender. May be reused once `Finish` messages are
|
||||
# sent corresponding to all of the `Join` messages.
|
||||
|
||||
partCount @1 :UInt16;
|
||||
# The number of capabilities to be joined.
|
||||
|
||||
partNum @2 :UInt16;
|
||||
# Which part this request targets -- a number in the range [0, partCount).
|
||||
}
|
||||
|
||||
struct JoinResult {
|
||||
joinId @0 :UInt32;
|
||||
# Matches `JoinKeyPart`.
|
||||
|
||||
succeeded @1 :Bool;
|
||||
# All JoinResults in the set will have the same value for `succeeded`. The receiver actually
|
||||
# implements the join by waiting for all the `JoinKeyParts` and then performing its own join on
|
||||
# them, then going back and answering all the join requests afterwards.
|
||||
|
||||
cap @2 :AnyPointer;
|
||||
# One of the JoinResults will have a non-null `cap` which is the joined capability.
|
||||
#
|
||||
# TODO(cleanup): Change `AnyPointer` to `Capability` when that is supported.
|
||||
}
|
1409
MsBuildGenerationTest/capnp/rpc.capnp
Normal file
1409
MsBuildGenerationTest/capnp/rpc.capnp
Normal file
File diff suppressed because it is too large
Load Diff
529
MsBuildGenerationTest/capnp/schema.capnp
Normal file
529
MsBuildGenerationTest/capnp/schema.capnp
Normal file
@ -0,0 +1,529 @@
|
||||
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
|
||||
@0xa93fc509624c72d9;
|
||||
$Cxx.namespace("capnp::schema");
|
||||
|
||||
using Id = UInt64;
|
||||
# The globally-unique ID of a file, type, or annotation.
|
||||
|
||||
struct Node {
|
||||
id @0 :Id;
|
||||
|
||||
displayName @1 :Text;
|
||||
# Name to present to humans to identify this Node. You should not attempt to parse this. Its
|
||||
# format could change. It is not guaranteed to be unique.
|
||||
#
|
||||
# (On Zooko's triangle, this is the node's nickname.)
|
||||
|
||||
displayNamePrefixLength @2 :UInt32;
|
||||
# If you want a shorter version of `displayName` (just naming this node, without its surrounding
|
||||
# scope), chop off this many characters from the beginning of `displayName`.
|
||||
|
||||
scopeId @3 :Id;
|
||||
# ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back
|
||||
# at this node, but robust code should avoid relying on this (and, in fact, group nodes are not
|
||||
# listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is
|
||||
# zero if the node has no parent, which is normally only the case with files, but should be
|
||||
# allowed for any kind of node (in order to make runtime type generation easier).
|
||||
|
||||
parameters @32 :List(Parameter);
|
||||
# If this node is parameterized (generic), the list of parameters. Empty for non-generic types.
|
||||
|
||||
isGeneric @33 :Bool;
|
||||
# True if this node is generic, meaning that it or one of its parent scopes has a non-empty
|
||||
# `parameters`.
|
||||
|
||||
struct Parameter {
|
||||
# Information about one of the node's parameters.
|
||||
|
||||
name @0 :Text;
|
||||
}
|
||||
|
||||
nestedNodes @4 :List(NestedNode);
|
||||
# List of nodes nested within this node, along with the names under which they were declared.
|
||||
|
||||
struct NestedNode {
|
||||
name @0 :Text;
|
||||
# Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically.
|
||||
#
|
||||
# (On Zooko's triangle, this is the node's petname according to its parent scope.)
|
||||
|
||||
id @1 :Id;
|
||||
# ID of the nested node. Typically, the target node's scopeId points back to this node, but
|
||||
# robust code should avoid relying on this.
|
||||
}
|
||||
|
||||
annotations @5 :List(Annotation);
|
||||
# Annotations applied to this node.
|
||||
|
||||
union {
|
||||
# Info specific to each kind of node.
|
||||
|
||||
file @6 :Void;
|
||||
|
||||
struct :group {
|
||||
dataWordCount @7 :UInt16;
|
||||
# Size of the data section, in words.
|
||||
|
||||
pointerCount @8 :UInt16;
|
||||
# Size of the pointer section, in pointers (which are one word each).
|
||||
|
||||
preferredListEncoding @9 :ElementSize;
|
||||
# The preferred element size to use when encoding a list of this struct. If this is anything
|
||||
# other than `inlineComposite` then the struct is one word or less in size and is a candidate
|
||||
# for list packing optimization.
|
||||
|
||||
isGroup @10 :Bool;
|
||||
# If true, then this "struct" node is actually not an independent node, but merely represents
|
||||
# some named union or group within a particular parent struct. This node's scopeId refers
|
||||
# to the parent struct, which may itself be a union/group in yet another struct.
|
||||
#
|
||||
# All group nodes share the same dataWordCount and pointerCount as the top-level
|
||||
# struct, and their fields live in the same ordinal and offset spaces as all other fields in
|
||||
# the struct.
|
||||
#
|
||||
# Note that a named union is considered a special kind of group -- in fact, a named union
|
||||
# is exactly equivalent to a group that contains nothing but an unnamed union.
|
||||
|
||||
discriminantCount @11 :UInt16;
|
||||
# Number of fields in this struct which are members of an anonymous union, and thus may
|
||||
# overlap. If this is non-zero, then a 16-bit discriminant is present indicating which
|
||||
# of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be
|
||||
# two or more.
|
||||
#
|
||||
# Note that the fields of an unnamed union are considered fields of the scope containing the
|
||||
# union -- an unnamed union is not its own group. So, a top-level struct may contain a
|
||||
# non-zero discriminant count. Named unions, on the other hand, are equivalent to groups
|
||||
# containing unnamed unions. So, a named union has its own independent schema node, with
|
||||
# `isGroup` = true.
|
||||
|
||||
discriminantOffset @12 :UInt32;
|
||||
# If `discriminantCount` is non-zero, this is the offset of the union discriminant, in
|
||||
# multiples of 16 bits.
|
||||
|
||||
fields @13 :List(Field);
|
||||
# Fields defined within this scope (either the struct's top-level fields, or the fields of
|
||||
# a particular group; see `isGroup`).
|
||||
#
|
||||
# The fields are sorted by ordinal number, but note that because groups share the same
|
||||
# ordinal space, the field's index in this list is not necessarily exactly its ordinal.
|
||||
# On the other hand, the field's position in this list does remain the same even as the
|
||||
# protocol evolves, since it is not possible to insert or remove an earlier ordinal.
|
||||
# Therefore, for most use cases, if you want to identify a field by number, it may make the
|
||||
# most sense to use the field's index in this list rather than its ordinal.
|
||||
}
|
||||
|
||||
enum :group {
|
||||
enumerants@14 :List(Enumerant);
|
||||
# Enumerants ordered by numeric value (ordinal).
|
||||
}
|
||||
|
||||
interface :group {
|
||||
methods @15 :List(Method);
|
||||
# Methods ordered by ordinal.
|
||||
|
||||
superclasses @31 :List(Superclass);
|
||||
# Superclasses of this interface.
|
||||
}
|
||||
|
||||
const :group {
|
||||
type @16 :Type;
|
||||
value @17 :Value;
|
||||
}
|
||||
|
||||
annotation :group {
|
||||
type @18 :Type;
|
||||
|
||||
targetsFile @19 :Bool;
|
||||
targetsConst @20 :Bool;
|
||||
targetsEnum @21 :Bool;
|
||||
targetsEnumerant @22 :Bool;
|
||||
targetsStruct @23 :Bool;
|
||||
targetsField @24 :Bool;
|
||||
targetsUnion @25 :Bool;
|
||||
targetsGroup @26 :Bool;
|
||||
targetsInterface @27 :Bool;
|
||||
targetsMethod @28 :Bool;
|
||||
targetsParam @29 :Bool;
|
||||
targetsAnnotation @30 :Bool;
|
||||
}
|
||||
}
|
||||
|
||||
struct SourceInfo {
|
||||
# Additional information about a node which is not needed at runtime, but may be useful for
|
||||
# documentation or debugging purposes. This is kept in a separate struct to make sure it
|
||||
# doesn't accidentally get included in contexts where it is not needed. The
|
||||
# `CodeGeneratorRequest` includes this information in a separate array.
|
||||
|
||||
id @0 :Id;
|
||||
# ID of the Node which this info describes.
|
||||
|
||||
docComment @1 :Text;
|
||||
# The top-level doc comment for the Node.
|
||||
|
||||
members @2 :List(Member);
|
||||
# Information about each member -- i.e. fields (for structs), enumerants (for enums), or
|
||||
# methods (for interfaces).
|
||||
#
|
||||
# This list is the same length and order as the corresponding list in the Node, i.e.
|
||||
# Node.struct.fields, Node.enum.enumerants, or Node.interface.methods.
|
||||
|
||||
struct Member {
|
||||
docComment @0 :Text;
|
||||
# Doc comment on the member.
|
||||
}
|
||||
|
||||
# TODO(someday): Record location of the declaration in the original source code.
|
||||
}
|
||||
}
|
||||
|
||||
struct Field {
|
||||
# Schema for a field of a struct.
|
||||
|
||||
name @0 :Text;
|
||||
|
||||
codeOrder @1 :UInt16;
|
||||
# Indicates where this member appeared in the code, relative to other members.
|
||||
# Code ordering may have semantic relevance -- programmers tend to place related fields
|
||||
# together. So, using code ordering makes sense in human-readable formats where ordering is
|
||||
# otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum
|
||||
# value is count(members) - 1. Fields that are members of a union are only ordered relative to
|
||||
# the other members of that union, so the maximum value there is count(union.members).
|
||||
|
||||
annotations @2 :List(Annotation);
|
||||
|
||||
const noDiscriminant :UInt16 = 0xffff;
|
||||
|
||||
discriminantValue @3 :UInt16 = Field.noDiscriminant;
|
||||
# If the field is in a union, this is the value which the union's discriminant should take when
|
||||
# the field is active. If the field is not in a union, this is 0xffff.
|
||||
|
||||
union {
|
||||
slot :group {
|
||||
# A regular, non-group, non-fixed-list field.
|
||||
|
||||
offset @4 :UInt32;
|
||||
# Offset, in units of the field's size, from the beginning of the section in which the field
|
||||
# resides. E.g. for a UInt32 field, multiply this by 4 to get the byte offset from the
|
||||
# beginning of the data section.
|
||||
|
||||
type @5 :Type;
|
||||
defaultValue @6 :Value;
|
||||
|
||||
hadExplicitDefault @10 :Bool;
|
||||
# Whether the default value was specified explicitly. Non-explicit default values are always
|
||||
# zero or empty values. Usually, whether the default value was explicit shouldn't matter.
|
||||
# The main use case for this flag is for structs representing method parameters:
|
||||
# explicitly-defaulted parameters may be allowed to be omitted when calling the method.
|
||||
}
|
||||
|
||||
group :group {
|
||||
# A group.
|
||||
|
||||
typeId @7 :Id;
|
||||
# The ID of the group's node.
|
||||
}
|
||||
}
|
||||
|
||||
ordinal :union {
|
||||
implicit @8 :Void;
|
||||
explicit @9 :UInt16;
|
||||
# The original ordinal number given to the field. You probably should NOT use this; if you need
|
||||
# a numeric identifier for a field, use its position within the field array for its scope.
|
||||
# The ordinal is given here mainly just so that the original schema text can be reproduced given
|
||||
# the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.
|
||||
}
|
||||
}
|
||||
|
||||
struct Enumerant {
|
||||
# Schema for member of an enum.
|
||||
|
||||
name @0 :Text;
|
||||
|
||||
codeOrder @1 :UInt16;
|
||||
# Specifies order in which the enumerants were declared in the code.
|
||||
# Like Struct.Field.codeOrder.
|
||||
|
||||
annotations @2 :List(Annotation);
|
||||
}
|
||||
|
||||
struct Superclass {
|
||||
id @0 :Id;
|
||||
brand @1 :Brand;
|
||||
}
|
||||
|
||||
struct Method {
|
||||
# Schema for method of an interface.
|
||||
|
||||
name @0 :Text;
|
||||
|
||||
codeOrder @1 :UInt16;
|
||||
# Specifies order in which the methods were declared in the code.
|
||||
# Like Struct.Field.codeOrder.
|
||||
|
||||
implicitParameters @7 :List(Node.Parameter);
|
||||
# The parameters listed in [] (typically, type / generic parameters), whose bindings are intended
|
||||
# to be inferred rather than specified explicitly, although not all languages support this.
|
||||
|
||||
paramStructType @2 :Id;
|
||||
# ID of the parameter struct type. If a named parameter list was specified in the method
|
||||
# declaration (rather than a single struct parameter type) then a corresponding struct type is
|
||||
# auto-generated. Such an auto-generated type will not be listed in the interface's
|
||||
# `nestedNodes` and its `scopeId` will be zero -- it is completely detached from the namespace.
|
||||
# (Awkwardly, it does of course inherit generic parameters from the method's scope, which makes
|
||||
# this a situation where you can't just climb the scope chain to find where a particular
|
||||
# generic parameter was introduced. Making the `scopeId` zero was a mistake.)
|
||||
|
||||
paramBrand @5 :Brand;
|
||||
# Brand of param struct type.
|
||||
|
||||
resultStructType @3 :Id;
|
||||
# ID of the return struct type; similar to `paramStructType`.
|
||||
|
||||
resultBrand @6 :Brand;
|
||||
# Brand of result struct type.
|
||||
|
||||
annotations @4 :List(Annotation);
|
||||
}
|
||||
|
||||
struct Type {
|
||||
# Represents a type expression.
|
||||
|
||||
union {
|
||||
# The ordinals intentionally match those of Value.
|
||||
|
||||
void @0 :Void;
|
||||
bool @1 :Void;
|
||||
int8 @2 :Void;
|
||||
int16 @3 :Void;
|
||||
int32 @4 :Void;
|
||||
int64 @5 :Void;
|
||||
uint8 @6 :Void;
|
||||
uint16 @7 :Void;
|
||||
uint32 @8 :Void;
|
||||
uint64 @9 :Void;
|
||||
float32 @10 :Void;
|
||||
float64 @11 :Void;
|
||||
text @12 :Void;
|
||||
data @13 :Void;
|
||||
|
||||
list :group {
|
||||
elementType @14 :Type;
|
||||
}
|
||||
|
||||
enum :group {
|
||||
typeId @15 :Id;
|
||||
brand @21 :Brand;
|
||||
}
|
||||
struct :group {
|
||||
typeId @16 :Id;
|
||||
brand @22 :Brand;
|
||||
}
|
||||
interface :group {
|
||||
typeId @17 :Id;
|
||||
brand @23 :Brand;
|
||||
}
|
||||
|
||||
anyPointer :union {
|
||||
unconstrained :union {
|
||||
# A regular AnyPointer.
|
||||
#
|
||||
# The name "unconstrained" means as opposed to constraining it to match a type parameter.
|
||||
# In retrospect this name is probably a poor choice given that it may still be constrained
|
||||
# to be a struct, list, or capability.
|
||||
|
||||
anyKind @18 :Void; # truly AnyPointer
|
||||
struct @25 :Void; # AnyStruct
|
||||
list @26 :Void; # AnyList
|
||||
capability @27 :Void; # Capability
|
||||
}
|
||||
|
||||
parameter :group {
|
||||
# This is actually a reference to a type parameter defined within this scope.
|
||||
|
||||
scopeId @19 :Id;
|
||||
# ID of the generic type whose parameter we're referencing. This should be a parent of the
|
||||
# current scope.
|
||||
|
||||
parameterIndex @20 :UInt16;
|
||||
# Index of the parameter within the generic type's parameter list.
|
||||
}
|
||||
|
||||
implicitMethodParameter :group {
|
||||
# This is actually a reference to an implicit (generic) parameter of a method. The only
|
||||
# legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.
|
||||
|
||||
parameterIndex @24 :UInt16;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Brand {
|
||||
# Specifies bindings for parameters of generics. Since these bindings turn a generic into a
|
||||
# non-generic, we call it the "brand".
|
||||
|
||||
scopes @0 :List(Scope);
|
||||
# For each of the target type and each of its parent scopes, a parameterization may be included
|
||||
# in this list. If no parameterization is included for a particular relevant scope, then either
|
||||
# that scope has no parameters or all parameters should be considered to be `AnyPointer`.
|
||||
|
||||
struct Scope {
|
||||
scopeId @0 :Id;
|
||||
# ID of the scope to which these params apply.
|
||||
|
||||
union {
|
||||
bind @1 :List(Binding);
|
||||
# List of parameter bindings.
|
||||
|
||||
inherit @2 :Void;
|
||||
# The place where this Brand appears is actually within this scope or a sub-scope,
|
||||
# and the bindings for this scope should be inherited from the reference point.
|
||||
}
|
||||
}
|
||||
|
||||
struct Binding {
|
||||
union {
|
||||
unbound @0 :Void;
|
||||
type @1 :Type;
|
||||
|
||||
# TODO(someday): Allow non-type parameters? Unsure if useful.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Value {
|
||||
# Represents a value, e.g. a field default value, constant value, or annotation value.
|
||||
|
||||
union {
|
||||
# The ordinals intentionally match those of Type.
|
||||
|
||||
void @0 :Void;
|
||||
bool @1 :Bool;
|
||||
int8 @2 :Int8;
|
||||
int16 @3 :Int16;
|
||||
int32 @4 :Int32;
|
||||
int64 @5 :Int64;
|
||||
uint8 @6 :UInt8;
|
||||
uint16 @7 :UInt16;
|
||||
uint32 @8 :UInt32;
|
||||
uint64 @9 :UInt64;
|
||||
float32 @10 :Float32;
|
||||
float64 @11 :Float64;
|
||||
text @12 :Text;
|
||||
data @13 :Data;
|
||||
|
||||
list @14 :AnyPointer;
|
||||
|
||||
enum @15 :UInt16;
|
||||
struct @16 :AnyPointer;
|
||||
|
||||
interface @17 :Void;
|
||||
# The only interface value that can be represented statically is "null", whose methods always
|
||||
# throw exceptions.
|
||||
|
||||
anyPointer @18 :AnyPointer;
|
||||
}
|
||||
}
|
||||
|
||||
struct Annotation {
|
||||
# Describes an annotation applied to a declaration. Note AnnotationNode describes the
|
||||
# annotation's declaration, while this describes a use of the annotation.
|
||||
|
||||
id @0 :Id;
|
||||
# ID of the annotation node.
|
||||
|
||||
brand @2 :Brand;
|
||||
# Brand of the annotation.
|
||||
#
|
||||
# Note that the annotation itself is not allowed to be parameterized, but its scope might be.
|
||||
|
||||
value @1 :Value;
|
||||
}
|
||||
|
||||
enum ElementSize {
|
||||
# Possible element sizes for encoded lists. These correspond exactly to the possible values of
|
||||
# the 3-bit element size component of a list pointer.
|
||||
|
||||
empty @0; # aka "void", but that's a keyword.
|
||||
bit @1;
|
||||
byte @2;
|
||||
twoBytes @3;
|
||||
fourBytes @4;
|
||||
eightBytes @5;
|
||||
pointer @6;
|
||||
inlineComposite @7;
|
||||
}
|
||||
|
||||
struct CapnpVersion {
|
||||
major @0 :UInt16;
|
||||
minor @1 :UInt8;
|
||||
micro @2 :UInt8;
|
||||
}
|
||||
|
||||
struct CodeGeneratorRequest {
|
||||
capnpVersion @2 :CapnpVersion;
|
||||
# Version of the `capnp` executable. Generally, code generators should ignore this, but the code
|
||||
# generators that ship with `capnp` itself will print a warning if this mismatches since that
|
||||
# probably indicates something is misconfigured.
|
||||
#
|
||||
# The first version of 'capnp' to set this was 0.6.0. So, if it's missing, the compiler version
|
||||
# is older than that.
|
||||
|
||||
nodes @0 :List(Node);
|
||||
# All nodes parsed by the compiler, including for the files on the command line and their
|
||||
# imports.
|
||||
|
||||
sourceInfo @3 :List(Node.SourceInfo);
|
||||
# Information about the original source code for each node, where available. This array may be
|
||||
# omitted or may be missing some nodes if no info is available for them.
|
||||
|
||||
requestedFiles @1 :List(RequestedFile);
|
||||
# Files which were listed on the command line.
|
||||
|
||||
struct RequestedFile {
|
||||
id @0 :Id;
|
||||
# ID of the file.
|
||||
|
||||
filename @1 :Text;
|
||||
# Name of the file as it appeared on the command-line (minus the src-prefix). You may use
|
||||
# this to decide where to write the output.
|
||||
|
||||
imports @2 :List(Import);
|
||||
# List of all imported paths seen in this file.
|
||||
|
||||
struct Import {
|
||||
id @0 :Id;
|
||||
# ID of the imported file.
|
||||
|
||||
name @1 :Text;
|
||||
# Name which *this* file used to refer to the foreign file. This may be a relative name.
|
||||
# This information is provided because it might be useful for code generation, e.g. to
|
||||
# generate #include directives in C++. We don't put this in Node.file because this
|
||||
# information is only meaningful at compile time anyway.
|
||||
#
|
||||
# (On Zooko's triangle, this is the import's petname according to the importing file.)
|
||||
}
|
||||
}
|
||||
}
|
28
MsBuildGenerationTest/capnp/test-import.capnp
Normal file
28
MsBuildGenerationTest/capnp/test-import.capnp
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0xf36d7b330303c66e;
|
||||
|
||||
using Test = import "test.capnp";
|
||||
|
||||
struct TestImport {
|
||||
field @0 :Test.TestAllTypes;
|
||||
}
|
32
MsBuildGenerationTest/capnp/test-import2.capnp
Normal file
32
MsBuildGenerationTest/capnp/test-import2.capnp
Normal file
@ -0,0 +1,32 @@
|
||||
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0xc64a3bf0338a124a;
|
||||
|
||||
using Import1 = import "/capnp/schema.capnp";
|
||||
using Import2 = import "test-import.capnp";
|
||||
using Import3 = import "test.capnp";
|
||||
|
||||
struct TestImport2 {
|
||||
foo @0 :Import3.TestAllTypes;
|
||||
bar @1 :Import1.Node;
|
||||
baz @2 :Import2.TestImport;
|
||||
}
|
969
MsBuildGenerationTest/capnp/test.capnp
Normal file
969
MsBuildGenerationTest/capnp/test.capnp
Normal file
@ -0,0 +1,969 @@
|
||||
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
@0xd508eebdc2dc42b8;
|
||||
|
||||
using Cxx = import "c++.capnp";
|
||||
|
||||
# Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified
|
||||
# names for stuff in the capnproto namespace.
|
||||
$Cxx.namespace("capnproto_test::capnp::test");
|
||||
|
||||
enum TestEnum {
|
||||
foo @0;
|
||||
bar @1;
|
||||
baz @2;
|
||||
qux @3;
|
||||
quux @4;
|
||||
corge @5;
|
||||
grault @6;
|
||||
garply @7;
|
||||
}
|
||||
|
||||
struct TestAllTypes {
|
||||
voidField @0 : Void;
|
||||
boolField @1 : Bool;
|
||||
int8Field @2 : Int8;
|
||||
int16Field @3 : Int16;
|
||||
int32Field @4 : Int32;
|
||||
int64Field @5 : Int64;
|
||||
uInt8Field @6 : UInt8;
|
||||
uInt16Field @7 : UInt16;
|
||||
uInt32Field @8 : UInt32;
|
||||
uInt64Field @9 : UInt64;
|
||||
float32Field @10 : Float32;
|
||||
float64Field @11 : Float64;
|
||||
textField @12 : Text;
|
||||
dataField @13 : Data;
|
||||
structField @14 : TestAllTypes;
|
||||
enumField @15 : TestEnum;
|
||||
interfaceField @16 : Void; # TODO
|
||||
|
||||
voidList @17 : List(Void);
|
||||
boolList @18 : List(Bool);
|
||||
int8List @19 : List(Int8);
|
||||
int16List @20 : List(Int16);
|
||||
int32List @21 : List(Int32);
|
||||
int64List @22 : List(Int64);
|
||||
uInt8List @23 : List(UInt8);
|
||||
uInt16List @24 : List(UInt16);
|
||||
uInt32List @25 : List(UInt32);
|
||||
uInt64List @26 : List(UInt64);
|
||||
float32List @27 : List(Float32);
|
||||
float64List @28 : List(Float64);
|
||||
textList @29 : List(Text);
|
||||
dataList @30 : List(Data);
|
||||
structList @31 : List(TestAllTypes);
|
||||
enumList @32 : List(TestEnum);
|
||||
interfaceList @33 : List(Void); # TODO
|
||||
}
|
||||
|
||||
struct TestDefaults {
|
||||
voidField @0 : Void = void;
|
||||
boolField @1 : Bool = true;
|
||||
int8Field @2 : Int8 = -123;
|
||||
int16Field @3 : Int16 = -12345;
|
||||
int32Field @4 : Int32 = -12345678;
|
||||
int64Field @5 : Int64 = -123456789012345;
|
||||
uInt8Field @6 : UInt8 = 234;
|
||||
uInt16Field @7 : UInt16 = 45678;
|
||||
uInt32Field @8 : UInt32 = 3456789012;
|
||||
uInt64Field @9 : UInt64 = 12345678901234567890;
|
||||
float32Field @10 : Float32 = 1234.5;
|
||||
float64Field @11 : Float64 = -123e45;
|
||||
textField @12 : Text = "foo";
|
||||
dataField @13 : Data = 0x"62 61 72"; # "bar"
|
||||
structField @14 : TestAllTypes = (
|
||||
voidField = void,
|
||||
boolField = true,
|
||||
int8Field = -12,
|
||||
int16Field = 3456,
|
||||
int32Field = -78901234,
|
||||
int64Field = 56789012345678,
|
||||
uInt8Field = 90,
|
||||
uInt16Field = 1234,
|
||||
uInt32Field = 56789012,
|
||||
uInt64Field = 345678901234567890,
|
||||
float32Field = -1.25e-10,
|
||||
float64Field = 345,
|
||||
textField = "baz",
|
||||
dataField = "qux",
|
||||
structField = (
|
||||
textField = "nested",
|
||||
structField = (textField = "really nested")),
|
||||
enumField = baz,
|
||||
# interfaceField can't have a default
|
||||
|
||||
voidList = [void, void, void],
|
||||
boolList = [false, true, false, true, true],
|
||||
int8List = [12, -34, -0x80, 0x7f],
|
||||
int16List = [1234, -5678, -0x8000, 0x7fff],
|
||||
int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],
|
||||
int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],
|
||||
uInt8List = [12, 34, 0, 0xff],
|
||||
uInt16List = [1234, 5678, 0, 0xffff],
|
||||
uInt32List = [12345678, 90123456, 0, 0xffffffff],
|
||||
uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],
|
||||
float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],
|
||||
float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],
|
||||
textList = ["quux", "corge", "grault"],
|
||||
dataList = ["garply", "waldo", "fred"],
|
||||
structList = [
|
||||
(textField = "x " "structlist"
|
||||
" 1"),
|
||||
(textField = "x structlist 2"),
|
||||
(textField = "x structlist 3")],
|
||||
enumList = [qux, bar, grault]
|
||||
# interfaceList can't have a default
|
||||
);
|
||||
enumField @15 : TestEnum = corge;
|
||||
interfaceField @16 : Void; # TODO
|
||||
|
||||
voidList @17 : List(Void) = [void, void, void, void, void, void];
|
||||
boolList @18 : List(Bool) = [true, false, false, true];
|
||||
int8List @19 : List(Int8) = [111, -111];
|
||||
int16List @20 : List(Int16) = [11111, -11111];
|
||||
int32List @21 : List(Int32) = [111111111, -111111111];
|
||||
int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111];
|
||||
uInt8List @23 : List(UInt8) = [111, 222] ;
|
||||
uInt16List @24 : List(UInt16) = [33333, 44444];
|
||||
uInt32List @25 : List(UInt32) = [3333333333];
|
||||
uInt64List @26 : List(UInt64) = [11111111111111111111];
|
||||
float32List @27 : List(Float32) = [5555.5, inf, -inf, nan];
|
||||
float64List @28 : List(Float64) = [7777.75, inf, -inf, nan];
|
||||
textList @29 : List(Text) = ["plugh", "xyzzy", "thud"];
|
||||
dataList @30 : List(Data) = ["oops", "exhausted", "rfc3092"];
|
||||
structList @31 : List(TestAllTypes) = [
|
||||
(textField = "structlist 1"),
|
||||
(textField = "structlist 2"),
|
||||
(textField = "structlist 3")];
|
||||
enumList @32 : List(TestEnum) = [foo, garply];
|
||||
interfaceList @33 : List(Void); # TODO
|
||||
}
|
||||
|
||||
struct TestAnyPointer {
|
||||
anyPointerField @0 :AnyPointer;
|
||||
|
||||
# Do not add any other fields here! Some tests rely on anyPointerField being the last pointer
|
||||
# in the struct.
|
||||
}
|
||||
|
||||
struct TestAnyOthers {
|
||||
anyStructField @0 :AnyStruct;
|
||||
anyListField @1 :AnyList;
|
||||
capabilityField @2 :Capability;
|
||||
}
|
||||
|
||||
struct TestOutOfOrder {
|
||||
foo @3 :Text;
|
||||
bar @2 :Text;
|
||||
baz @8 :Text;
|
||||
qux @0 :Text;
|
||||
quux @6 :Text;
|
||||
corge @4 :Text;
|
||||
grault @1 :Text;
|
||||
garply @7 :Text;
|
||||
waldo @5 :Text;
|
||||
}
|
||||
|
||||
struct TestUnion {
|
||||
union0 @0! :union {
|
||||
# Pack union 0 under ideal conditions: there is no unused padding space prior to it.
|
||||
u0f0s0 @4: Void;
|
||||
u0f0s1 @5: Bool;
|
||||
u0f0s8 @6: Int8;
|
||||
u0f0s16 @7: Int16;
|
||||
u0f0s32 @8: Int32;
|
||||
u0f0s64 @9: Int64;
|
||||
u0f0sp @10: Text;
|
||||
|
||||
# Pack more stuff into union0 -- should go in same space.
|
||||
u0f1s0 @11: Void;
|
||||
u0f1s1 @12: Bool;
|
||||
u0f1s8 @13: Int8;
|
||||
u0f1s16 @14: Int16;
|
||||
u0f1s32 @15: Int32;
|
||||
u0f1s64 @16: Int64;
|
||||
u0f1sp @17: Text;
|
||||
}
|
||||
|
||||
# Pack one bit in order to make pathological situation for union1.
|
||||
bit0 @18: Bool;
|
||||
|
||||
union1 @1! :union {
|
||||
# Pack pathologically bad case. Each field takes up new space.
|
||||
u1f0s0 @19: Void;
|
||||
u1f0s1 @20: Bool;
|
||||
u1f1s1 @21: Bool;
|
||||
u1f0s8 @22: Int8;
|
||||
u1f1s8 @23: Int8;
|
||||
u1f0s16 @24: Int16;
|
||||
u1f1s16 @25: Int16;
|
||||
u1f0s32 @26: Int32;
|
||||
u1f1s32 @27: Int32;
|
||||
u1f0s64 @28: Int64;
|
||||
u1f1s64 @29: Int64;
|
||||
u1f0sp @30: Text;
|
||||
u1f1sp @31: Text;
|
||||
|
||||
# Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*.
|
||||
u1f2s0 @32: Void;
|
||||
u1f2s1 @33: Bool;
|
||||
u1f2s8 @34: Int8;
|
||||
u1f2s16 @35: Int16;
|
||||
u1f2s32 @36: Int32;
|
||||
u1f2s64 @37: Int64;
|
||||
u1f2sp @38: Text;
|
||||
}
|
||||
|
||||
# Fill in the rest of that bitfield from earlier.
|
||||
bit2 @39: Bool;
|
||||
bit3 @40: Bool;
|
||||
bit4 @41: Bool;
|
||||
bit5 @42: Bool;
|
||||
bit6 @43: Bool;
|
||||
bit7 @44: Bool;
|
||||
|
||||
# Interleave two unions to be really annoying.
|
||||
# Also declare in reverse order to make sure union discriminant values are sorted by field number
|
||||
# and not by declaration order.
|
||||
union2 @2! :union {
|
||||
u2f0s64 @54: Int64;
|
||||
u2f0s32 @52: Int32;
|
||||
u2f0s16 @50: Int16;
|
||||
u2f0s8 @47: Int8;
|
||||
u2f0s1 @45: Bool;
|
||||
}
|
||||
|
||||
union3 @3! :union {
|
||||
u3f0s64 @55: Int64;
|
||||
u3f0s32 @53: Int32;
|
||||
u3f0s16 @51: Int16;
|
||||
u3f0s8 @48: Int8;
|
||||
u3f0s1 @46: Bool;
|
||||
}
|
||||
|
||||
byte0 @49: UInt8;
|
||||
}
|
||||
|
||||
struct TestUnnamedUnion {
|
||||
before @0 :Text;
|
||||
|
||||
union {
|
||||
foo @1 :UInt16;
|
||||
bar @3 :UInt32;
|
||||
}
|
||||
|
||||
middle @2 :UInt16;
|
||||
|
||||
after @4 :Text;
|
||||
}
|
||||
|
||||
struct TestUnionInUnion {
|
||||
# There is no reason to ever do this.
|
||||
outer :union {
|
||||
inner :union {
|
||||
foo @0 :Int32;
|
||||
bar @1 :Int32;
|
||||
}
|
||||
baz @2 :Int32;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestGroups {
|
||||
groups :union {
|
||||
foo :group {
|
||||
corge @0 :Int32;
|
||||
grault @2 :Int64;
|
||||
garply @8 :Text;
|
||||
}
|
||||
bar :group {
|
||||
corge @3 :Int32;
|
||||
grault @4 :Text;
|
||||
garply @5 :Int64;
|
||||
}
|
||||
baz :group {
|
||||
corge @1 :Int32;
|
||||
grault @6 :Text;
|
||||
garply @7 :Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TestInterleavedGroups {
|
||||
group1 :group {
|
||||
foo @0 :UInt32;
|
||||
bar @2 :UInt64;
|
||||
union {
|
||||
qux @4 :UInt16;
|
||||
corge :group {
|
||||
grault @6 :UInt64;
|
||||
garply @8 :UInt16;
|
||||
plugh @14 :Text;
|
||||
xyzzy @16 :Text;
|
||||
}
|
||||
|
||||
fred @12 :Text;
|
||||
}
|
||||
|
||||
waldo @10 :Text;
|
||||
}
|
||||
|
||||
group2 :group {
|
||||
foo @1 :UInt32;
|
||||
bar @3 :UInt64;
|
||||
union {
|
||||
qux @5 :UInt16;
|
||||
corge :group {
|
||||
grault @7 :UInt64;
|
||||
garply @9 :UInt16;
|
||||
plugh @15 :Text;
|
||||
xyzzy @17 :Text;
|
||||
}
|
||||
|
||||
fred @13 :Text;
|
||||
}
|
||||
|
||||
waldo @11 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestUnionDefaults {
|
||||
s16s8s64s8Set @0 :TestUnion =
|
||||
(union0 = (u0f0s16 = 321), union1 = (u1f0s8 = 123), union2 = (u2f0s64 = 12345678901234567),
|
||||
union3 = (u3f0s8 = 55));
|
||||
s0sps1s32Set @1 :TestUnion =
|
||||
(union0 = (u0f1s0 = void), union1 = (u1f0sp = "foo"), union2 = (u2f0s1 = true),
|
||||
union3 = (u3f0s32 = 12345678));
|
||||
|
||||
unnamed1 @2 :TestUnnamedUnion = (foo = 123);
|
||||
unnamed2 @3 :TestUnnamedUnion = (bar = 321, before = "foo", after = "bar");
|
||||
}
|
||||
|
||||
struct TestNestedTypes {
|
||||
enum NestedEnum {
|
||||
foo @0;
|
||||
bar @1;
|
||||
}
|
||||
|
||||
struct NestedStruct {
|
||||
enum NestedEnum {
|
||||
baz @0;
|
||||
qux @1;
|
||||
quux @2;
|
||||
}
|
||||
|
||||
outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar;
|
||||
innerNestedEnum @1 :NestedEnum = quux;
|
||||
}
|
||||
|
||||
nestedStruct @0 :NestedStruct;
|
||||
|
||||
outerNestedEnum @1 :NestedEnum = bar;
|
||||
innerNestedEnum @2 :NestedStruct.NestedEnum = quux;
|
||||
}
|
||||
|
||||
struct TestUsing {
|
||||
using OuterNestedEnum = TestNestedTypes.NestedEnum;
|
||||
using TestNestedTypes.NestedStruct.NestedEnum;
|
||||
|
||||
outerNestedEnum @1 :OuterNestedEnum = bar;
|
||||
innerNestedEnum @0 :NestedEnum = quux;
|
||||
}
|
||||
|
||||
struct TestLists {
|
||||
# Small structs, when encoded as list, will be encoded as primitive lists rather than struct
|
||||
# lists, to save space.
|
||||
struct Struct0 { f @0 :Void; }
|
||||
struct Struct1 { f @0 :Bool; }
|
||||
struct Struct8 { f @0 :UInt8; }
|
||||
struct Struct16 { f @0 :UInt16; }
|
||||
struct Struct32 { f @0 :UInt32; }
|
||||
struct Struct64 { f @0 :UInt64; }
|
||||
struct StructP { f @0 :Text; }
|
||||
|
||||
# Versions of the above which cannot be encoded as primitive lists.
|
||||
struct Struct0c { f @0 :Void; pad @1 :Text; }
|
||||
struct Struct1c { f @0 :Bool; pad @1 :Text; }
|
||||
struct Struct8c { f @0 :UInt8; pad @1 :Text; }
|
||||
struct Struct16c { f @0 :UInt16; pad @1 :Text; }
|
||||
struct Struct32c { f @0 :UInt32; pad @1 :Text; }
|
||||
struct Struct64c { f @0 :UInt64; pad @1 :Text; }
|
||||
struct StructPc { f @0 :Text; pad @1 :UInt64; }
|
||||
|
||||
list0 @0 :List(Struct0);
|
||||
list1 @1 :List(Struct1);
|
||||
list8 @2 :List(Struct8);
|
||||
list16 @3 :List(Struct16);
|
||||
list32 @4 :List(Struct32);
|
||||
list64 @5 :List(Struct64);
|
||||
listP @6 :List(StructP);
|
||||
|
||||
int32ListList @7 :List(List(Int32));
|
||||
textListList @8 :List(List(Text));
|
||||
structListList @9 :List(List(TestAllTypes));
|
||||
}
|
||||
|
||||
struct TestFieldZeroIsBit {
|
||||
bit @0 :Bool;
|
||||
secondBit @1 :Bool = true;
|
||||
thirdField @2 :UInt8 = 123;
|
||||
}
|
||||
|
||||
struct TestListDefaults {
|
||||
lists @0 :TestLists = (
|
||||
list0 = [(f = void), (f = void)],
|
||||
list1 = [(f = true), (f = false), (f = true), (f = true)],
|
||||
list8 = [(f = 123), (f = 45)],
|
||||
list16 = [(f = 12345), (f = 6789)],
|
||||
list32 = [(f = 123456789), (f = 234567890)],
|
||||
list64 = [(f = 1234567890123456), (f = 2345678901234567)],
|
||||
listP = [(f = "foo"), (f = "bar")],
|
||||
int32ListList = [[1, 2, 3], [4, 5], [12341234]],
|
||||
textListList = [["foo", "bar"], ["baz"], ["qux", "corge"]],
|
||||
structListList = [[(int32Field = 123), (int32Field = 456)], [(int32Field = 789)]]);
|
||||
}
|
||||
|
||||
struct TestLateUnion {
|
||||
# Test what happens if the unions are not the first ordinals in the struct. At one point this
|
||||
# was broken for the dynamic API.
|
||||
|
||||
foo @0 :Int32;
|
||||
bar @1 :Text;
|
||||
baz @2 :Int16;
|
||||
|
||||
theUnion @3! :union {
|
||||
qux @4 :Text;
|
||||
corge @5 :List(Int32);
|
||||
grault @6 :Float32;
|
||||
}
|
||||
|
||||
anotherUnion @7! :union {
|
||||
qux @8 :Text;
|
||||
corge @9 :List(Int32);
|
||||
grault @10 :Float32;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestOldVersion {
|
||||
# A subset of TestNewVersion.
|
||||
old1 @0 :Int64;
|
||||
old2 @1 :Text;
|
||||
old3 @2 :TestOldVersion;
|
||||
}
|
||||
|
||||
struct TestNewVersion {
|
||||
# A superset of TestOldVersion.
|
||||
old1 @0 :Int64;
|
||||
old2 @1 :Text;
|
||||
old3 @2 :TestNewVersion;
|
||||
new1 @3 :Int64 = 987;
|
||||
new2 @4 :Text = "baz";
|
||||
}
|
||||
|
||||
struct TestOldUnionVersion {
|
||||
union {
|
||||
a @0 :Void;
|
||||
b @1 :UInt64;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestNewUnionVersion {
|
||||
union {
|
||||
a :union {
|
||||
a0 @0 :Void;
|
||||
a1 @2 :UInt64;
|
||||
}
|
||||
b @1 :UInt64;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestStructUnion {
|
||||
un @0! :union {
|
||||
struct @1 :SomeStruct;
|
||||
object @2 :TestAnyPointer;
|
||||
}
|
||||
|
||||
struct SomeStruct {
|
||||
someText @0 :Text;
|
||||
moreText @1 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestPrintInlineStructs {
|
||||
someText @0 :Text;
|
||||
|
||||
structList @1 :List(InlineStruct);
|
||||
struct InlineStruct {
|
||||
int32Field @0 :Int32;
|
||||
textField @1 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestWholeFloatDefault {
|
||||
# At one point, these failed to compile in C++ because it would produce literals like "123f",
|
||||
# which is not valid; it needs to be "123.0f".
|
||||
field @0 :Float32 = 123;
|
||||
bigField @1 :Float32 = 2e30;
|
||||
const constant :Float32 = 456;
|
||||
const bigConstant :Float32 = 4e30;
|
||||
}
|
||||
|
||||
struct TestGenerics(Foo, Bar) {
|
||||
foo @0 :Foo;
|
||||
rev @1 :TestGenerics(Bar, Foo);
|
||||
|
||||
union {
|
||||
uv @2:Void;
|
||||
ug :group {
|
||||
ugfoo @3:Int32;
|
||||
}
|
||||
}
|
||||
|
||||
list @4 :List(Inner);
|
||||
# At one time this failed to compile with MSVC due to poor expression SFINAE support.
|
||||
|
||||
struct Inner {
|
||||
foo @0 :Foo;
|
||||
bar @1 :Bar;
|
||||
}
|
||||
|
||||
struct Inner2(Baz) {
|
||||
bar @0 :Bar;
|
||||
baz @1 :Baz;
|
||||
innerBound @2 :Inner;
|
||||
innerUnbound @3 :TestGenerics.Inner;
|
||||
|
||||
struct DeepNest(Qux) {
|
||||
foo @0 :Foo;
|
||||
bar @1 :Bar;
|
||||
baz @2 :Baz;
|
||||
qux @3 :Qux;
|
||||
|
||||
interface DeepNestInterface(Quux) {
|
||||
# At one time this failed to compile.
|
||||
call @0 () -> ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface Interface(Qux) {
|
||||
call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));
|
||||
}
|
||||
|
||||
annotation ann(struct) :Foo;
|
||||
|
||||
using AliasFoo = Foo;
|
||||
using AliasInner = Inner;
|
||||
using AliasInner2 = Inner2;
|
||||
using AliasInner2Text = Inner2(Text);
|
||||
using AliasRev = TestGenerics(Bar, Foo);
|
||||
|
||||
struct UseAliases {
|
||||
foo @0 :AliasFoo;
|
||||
inner @1 :AliasInner;
|
||||
inner2 @2 :AliasInner2;
|
||||
inner2Bind @3 :AliasInner2(Text);
|
||||
inner2Text @4 :AliasInner2Text;
|
||||
revFoo @5 :AliasRev.AliasFoo;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestGenericsWrapper(Foo, Bar) {
|
||||
value @0 :TestGenerics(Foo, Bar);
|
||||
}
|
||||
|
||||
struct TestGenericsWrapper2 {
|
||||
value @0 :TestGenericsWrapper(Text, TestAllTypes);
|
||||
}
|
||||
|
||||
interface TestImplicitMethodParams {
|
||||
call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);
|
||||
}
|
||||
|
||||
interface TestImplicitMethodParamsInGeneric(V) {
|
||||
call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U);
|
||||
}
|
||||
|
||||
struct TestGenericsUnion(Foo, Bar) {
|
||||
# At one point this failed to compile.
|
||||
|
||||
union {
|
||||
foo @0 :Foo;
|
||||
bar @1 :Bar;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestUseGenerics $TestGenerics(Text, Data).ann("foo") {
|
||||
basic @0 :TestGenerics(TestAllTypes, TestAnyPointer);
|
||||
inner @1 :TestGenerics(TestAllTypes, TestAnyPointer).Inner;
|
||||
inner2 @2 :TestGenerics(TestAllTypes, TestAnyPointer).Inner2(Text);
|
||||
unspecified @3 :TestGenerics;
|
||||
unspecifiedInner @4 :TestGenerics.Inner2(Text);
|
||||
wrapper @8 :TestGenericsWrapper(TestAllTypes, TestAnyPointer);
|
||||
cap @18 :TestGenerics(TestInterface, Text);
|
||||
genericCap @19 :TestGenerics(TestAllTypes, List(UInt32)).Interface(Data);
|
||||
|
||||
default @5 :TestGenerics(TestAllTypes, Text) =
|
||||
(foo = (int16Field = 123), rev = (foo = "text", rev = (foo = (int16Field = 321))));
|
||||
defaultInner @6 :TestGenerics(TestAllTypes, Text).Inner =
|
||||
(foo = (int16Field = 123), bar = "text");
|
||||
defaultUser @7 :TestUseGenerics = (basic = (foo = (int16Field = 123)));
|
||||
defaultWrapper @9 :TestGenericsWrapper(Text, TestAllTypes) =
|
||||
(value = (foo = "text", rev = (foo = (int16Field = 321))));
|
||||
defaultWrapper2 @10 :TestGenericsWrapper2 =
|
||||
(value = (value = (foo = "text", rev = (foo = (int16Field = 321)))));
|
||||
|
||||
aliasFoo @11 :TestGenerics(TestAllTypes, TestAnyPointer).AliasFoo = (int16Field = 123);
|
||||
aliasInner @12 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner
|
||||
= (foo = (int16Field = 123));
|
||||
aliasInner2 @13 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2
|
||||
= (innerBound = (foo = (int16Field = 123)));
|
||||
aliasInner2Bind @14 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2(List(UInt32))
|
||||
= (baz = [12, 34], innerBound = (foo = (int16Field = 123)));
|
||||
aliasInner2Text @15 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2Text
|
||||
= (baz = "text", innerBound = (foo = (int16Field = 123)));
|
||||
aliasRev @16 :TestGenerics(TestAnyPointer, Text).AliasRev.AliasFoo = "text";
|
||||
|
||||
useAliases @17 :TestGenerics(TestAllTypes, List(UInt32)).UseAliases = (
|
||||
foo = (int16Field = 123),
|
||||
inner = (foo = (int16Field = 123)),
|
||||
inner2 = (innerBound = (foo = (int16Field = 123))),
|
||||
inner2Bind = (baz = "text", innerBound = (foo = (int16Field = 123))),
|
||||
inner2Text = (baz = "text", innerBound = (foo = (int16Field = 123))),
|
||||
revFoo = [12, 34, 56]);
|
||||
}
|
||||
|
||||
struct TestEmptyStruct {}
|
||||
|
||||
struct TestConstants {
|
||||
const voidConst :Void = void;
|
||||
const boolConst :Bool = true;
|
||||
const int8Const :Int8 = -123;
|
||||
const int16Const :Int16 = -12345;
|
||||
const int32Const :Int32 = -12345678;
|
||||
const int64Const :Int64 = -123456789012345;
|
||||
const uint8Const :UInt8 = 234;
|
||||
const uint16Const :UInt16 = 45678;
|
||||
const uint32Const :UInt32 = 3456789012;
|
||||
const uint64Const :UInt64 = 12345678901234567890;
|
||||
const float32Const :Float32 = 1234.5;
|
||||
const float64Const :Float64 = -123e45;
|
||||
const textConst :Text = "foo";
|
||||
const dataConst :Data = "bar";
|
||||
const structConst :TestAllTypes = (
|
||||
voidField = void,
|
||||
boolField = true,
|
||||
int8Field = -12,
|
||||
int16Field = 3456,
|
||||
int32Field = -78901234,
|
||||
int64Field = 56789012345678,
|
||||
uInt8Field = 90,
|
||||
uInt16Field = 1234,
|
||||
uInt32Field = 56789012,
|
||||
uInt64Field = 345678901234567890,
|
||||
float32Field = -1.25e-10,
|
||||
float64Field = 345,
|
||||
textField = "baz",
|
||||
dataField = "qux",
|
||||
structField = (
|
||||
textField = "nested",
|
||||
structField = (textField = "really nested")),
|
||||
enumField = baz,
|
||||
# interfaceField can't have a default
|
||||
|
||||
voidList = [void, void, void],
|
||||
boolList = [false, true, false, true, true],
|
||||
int8List = [12, -34, -0x80, 0x7f],
|
||||
int16List = [1234, -5678, -0x8000, 0x7fff],
|
||||
int32List = [12345678, -90123456, -0x80000000, 0x7fffffff],
|
||||
int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff],
|
||||
uInt8List = [12, 34, 0, 0xff],
|
||||
uInt16List = [1234, 5678, 0, 0xffff],
|
||||
uInt32List = [12345678, 90123456, 0, 0xffffffff],
|
||||
uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff],
|
||||
float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],
|
||||
float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],
|
||||
textList = ["quux", "corge", "grault"],
|
||||
dataList = ["garply", "waldo", "fred"],
|
||||
structList = [
|
||||
(textField = "x " "structlist"
|
||||
" 1"),
|
||||
(textField = "x structlist 2"),
|
||||
(textField = "x structlist 3")],
|
||||
enumList = [qux, bar, grault]
|
||||
# interfaceList can't have a default
|
||||
);
|
||||
const enumConst :TestEnum = corge;
|
||||
|
||||
const voidListConst :List(Void) = [void, void, void, void, void, void];
|
||||
const boolListConst :List(Bool) = [true, false, false, true];
|
||||
const int8ListConst :List(Int8) = [111, -111];
|
||||
const int16ListConst :List(Int16) = [11111, -11111];
|
||||
const int32ListConst :List(Int32) = [111111111, -111111111];
|
||||
const int64ListConst :List(Int64) = [1111111111111111111, -1111111111111111111];
|
||||
const uint8ListConst :List(UInt8) = [111, 222] ;
|
||||
const uint16ListConst :List(UInt16) = [33333, 44444];
|
||||
const uint32ListConst :List(UInt32) = [3333333333];
|
||||
const uint64ListConst :List(UInt64) = [11111111111111111111];
|
||||
const float32ListConst :List(Float32) = [5555.5, inf, -inf, nan];
|
||||
const float64ListConst :List(Float64) = [7777.75, inf, -inf, nan];
|
||||
const textListConst :List(Text) = ["plugh", "xyzzy", "thud"];
|
||||
const dataListConst :List(Data) = ["oops", "exhausted", "rfc3092"];
|
||||
const structListConst :List(TestAllTypes) = [
|
||||
(textField = "structlist 1"),
|
||||
(textField = "structlist 2"),
|
||||
(textField = "structlist 3")];
|
||||
const enumListConst :List(TestEnum) = [foo, garply];
|
||||
}
|
||||
|
||||
const globalInt :UInt32 = 12345;
|
||||
const globalText :Text = "foobar";
|
||||
const globalStruct :TestAllTypes = (int32Field = 54321);
|
||||
const globalPrintableStruct :TestPrintInlineStructs = (someText = "foo");
|
||||
const derivedConstant :TestAllTypes = (
|
||||
uInt32Field = .globalInt,
|
||||
textField = TestConstants.textConst,
|
||||
structField = TestConstants.structConst,
|
||||
int16List = TestConstants.int16ListConst,
|
||||
structList = TestConstants.structListConst);
|
||||
|
||||
const genericConstant :TestGenerics(TestAllTypes, Text) =
|
||||
(foo = (int16Field = 123), rev = (foo = "text", rev = (foo = (int16Field = 321))));
|
||||
|
||||
const embeddedData :Data = embed "testdata/packed";
|
||||
const embeddedText :Text = embed "testdata/short.txt";
|
||||
const embeddedStruct :TestAllTypes = embed "testdata/binary";
|
||||
|
||||
const nonAsciiText :Text = "♫ é ✓";
|
||||
|
||||
struct TestAnyPointerConstants {
|
||||
anyKindAsStruct @0 :AnyPointer;
|
||||
anyStructAsStruct @1 :AnyStruct;
|
||||
anyKindAsList @2 :AnyPointer;
|
||||
anyListAsList @3 :AnyList;
|
||||
|
||||
}
|
||||
|
||||
const anyPointerConstants :TestAnyPointerConstants = (
|
||||
anyKindAsStruct = TestConstants.structConst,
|
||||
anyStructAsStruct = TestConstants.structConst,
|
||||
anyKindAsList = TestConstants.int32ListConst,
|
||||
anyListAsList = TestConstants.int32ListConst,
|
||||
);
|
||||
|
||||
interface TestInterface {
|
||||
foo @0 (i :UInt32, j :Bool) -> (x :Text);
|
||||
bar @1 () -> ();
|
||||
baz @2 (s: TestAllTypes);
|
||||
}
|
||||
|
||||
interface TestExtends extends(TestInterface) {
|
||||
qux @0 ();
|
||||
corge @1 TestAllTypes -> ();
|
||||
grault @2 () -> TestAllTypes;
|
||||
}
|
||||
|
||||
interface TestExtends2 extends(TestExtends) {}
|
||||
|
||||
interface TestPipeline {
|
||||
getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box);
|
||||
testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> ();
|
||||
getAnyCap @2 (n: UInt32, inCap :Capability) -> (s: Text, outBox :AnyBox);
|
||||
|
||||
struct Box {
|
||||
cap @0 :TestInterface;
|
||||
}
|
||||
struct AnyBox {
|
||||
cap @0 :Capability;
|
||||
}
|
||||
}
|
||||
|
||||
interface TestCallOrder {
|
||||
getCallSequence @0 (expected: UInt32) -> (n: UInt32);
|
||||
# First call returns 0, next returns 1, ...
|
||||
#
|
||||
# The input `expected` is ignored but useful for disambiguating debug logs.
|
||||
}
|
||||
|
||||
interface TestTailCallee {
|
||||
struct TailResult {
|
||||
i @0 :UInt32;
|
||||
t @1 :Text;
|
||||
c @2 :TestCallOrder;
|
||||
}
|
||||
|
||||
foo @0 (i :Int32, t :Text) -> TailResult;
|
||||
}
|
||||
|
||||
interface TestTailCaller {
|
||||
foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult;
|
||||
}
|
||||
|
||||
interface TestHandle {}
|
||||
|
||||
interface TestMoreStuff extends(TestCallOrder) {
|
||||
# Catch-all type that contains lots of testing methods.
|
||||
|
||||
callFoo @0 (cap :TestInterface) -> (s: Text);
|
||||
# Call `cap.foo()`, check the result, and return "bar".
|
||||
|
||||
callFooWhenResolved @1 (cap :TestInterface) -> (s: Text);
|
||||
# Like callFoo but waits for `cap` to resolve first.
|
||||
|
||||
neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface);
|
||||
# Doesn't return. You should cancel it.
|
||||
|
||||
hold @3 (cap :TestInterface) -> ();
|
||||
# Returns immediately but holds on to the capability.
|
||||
|
||||
callHeld @4 () -> (s: Text);
|
||||
# Calls the capability previously held using `hold` (and keeps holding it).
|
||||
|
||||
getHeld @5 () -> (cap :TestInterface);
|
||||
# Returns the capability previously held using `hold` (and keeps holding it).
|
||||
|
||||
echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder);
|
||||
# Just returns the input cap.
|
||||
|
||||
expectCancel @7 (cap :TestInterface) -> ();
|
||||
# evalLater()-loops forever, holding `cap`. Must be canceled.
|
||||
|
||||
methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = "foo") -> (d :Text, e :Text = "bar");
|
||||
|
||||
methodWithNullDefault @12 (a :Text, b :TestInterface = null);
|
||||
|
||||
getHandle @9 () -> (handle :TestHandle);
|
||||
# Get a new handle. Tests have an out-of-band way to check the current number of live handles, so
|
||||
# this can be used to test garbage collection.
|
||||
|
||||
getNull @10 () -> (nullCap :TestMoreStuff);
|
||||
# Always returns a null capability.
|
||||
|
||||
getEnormousString @11 () -> (str :Text);
|
||||
# Attempts to return an 100MB string. Should always fail.
|
||||
}
|
||||
|
||||
interface TestMembrane {
|
||||
makeThing @0 () -> (thing :Thing);
|
||||
callPassThrough @1 (thing :Thing, tailCall :Bool) -> Result;
|
||||
callIntercept @2 (thing :Thing, tailCall :Bool) -> Result;
|
||||
loopback @3 (thing :Thing) -> (thing :Thing);
|
||||
|
||||
waitForever @4 ();
|
||||
|
||||
interface Thing {
|
||||
passThrough @0 () -> Result;
|
||||
intercept @1 () -> Result;
|
||||
}
|
||||
|
||||
struct Result {
|
||||
text @0 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestContainMembrane {
|
||||
cap @0 :TestMembrane.Thing;
|
||||
list @1 :List(TestMembrane.Thing);
|
||||
}
|
||||
|
||||
struct TestTransferCap {
|
||||
list @0 :List(Element);
|
||||
struct Element {
|
||||
text @0 :Text;
|
||||
cap @1 :TestInterface;
|
||||
}
|
||||
}
|
||||
|
||||
interface TestKeywordMethods {
|
||||
delete @0 ();
|
||||
class @1 ();
|
||||
void @2 ();
|
||||
return @3 ();
|
||||
}
|
||||
|
||||
interface TestAuthenticatedBootstrap(VatId) {
|
||||
getCallerId @0 () -> (caller :VatId);
|
||||
}
|
||||
|
||||
struct TestSturdyRef {
|
||||
hostId @0 :TestSturdyRefHostId;
|
||||
objectId @1 :AnyPointer;
|
||||
}
|
||||
|
||||
struct TestSturdyRefHostId {
|
||||
host @0 :Text;
|
||||
}
|
||||
|
||||
struct TestSturdyRefObjectId {
|
||||
tag @0 :Tag;
|
||||
enum Tag {
|
||||
testInterface @0;
|
||||
testExtends @1;
|
||||
testPipeline @2;
|
||||
testTailCallee @3;
|
||||
testTailCaller @4;
|
||||
testMoreStuff @5;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestProvisionId {}
|
||||
struct TestRecipientId {}
|
||||
struct TestThirdPartyCapId {}
|
||||
struct TestJoinResult {}
|
||||
|
||||
struct TestNameAnnotation $Cxx.name("RenamedStruct") {
|
||||
union {
|
||||
badFieldName @0 :Bool $Cxx.name("goodFieldName");
|
||||
bar @1 :Int8;
|
||||
}
|
||||
|
||||
enum BadlyNamedEnum $Cxx.name("RenamedEnum") {
|
||||
foo @0;
|
||||
bar @1;
|
||||
baz @2 $Cxx.name("qux");
|
||||
}
|
||||
|
||||
anotherBadFieldName @2 :BadlyNamedEnum $Cxx.name("anotherGoodFieldName");
|
||||
|
||||
struct NestedStruct $Cxx.name("RenamedNestedStruct") {
|
||||
badNestedFieldName @0 :Bool $Cxx.name("goodNestedFieldName");
|
||||
anotherBadNestedFieldName @1 :NestedStruct $Cxx.name("anotherGoodNestedFieldName");
|
||||
|
||||
enum DeeplyNestedEnum $Cxx.name("RenamedDeeplyNestedEnum") {
|
||||
quux @0;
|
||||
corge @1;
|
||||
grault @2 $Cxx.name("garply");
|
||||
}
|
||||
}
|
||||
|
||||
badlyNamedUnion :union $Cxx.name("renamedUnion") {
|
||||
badlyNamedGroup :group $Cxx.name("renamedGroup") {
|
||||
foo @3 :Void;
|
||||
bar @4 :Void;
|
||||
}
|
||||
baz @5 :NestedStruct $Cxx.name("qux");
|
||||
}
|
||||
}
|
||||
|
||||
interface TestNameAnnotationInterface $Cxx.name("RenamedInterface") {
|
||||
badlyNamedMethod @0 (badlyNamedParam :UInt8 $Cxx.name("renamedParam")) $Cxx.name("renamedMethod");
|
||||
}
|
BIN
MsBuildGenerationTest/capnp/testdata/annotated-json.binary
vendored
Normal file
BIN
MsBuildGenerationTest/capnp/testdata/annotated-json.binary
vendored
Normal file
Binary file not shown.
22
MsBuildGenerationTest/capnp/testdata/annotated.json
vendored
Normal file
22
MsBuildGenerationTest/capnp/testdata/annotated.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{ "names-can_contain!anything Really": "foo",
|
||||
"flatFoo": 123,
|
||||
"flatBar": "abc",
|
||||
"renamed-flatBaz": {"hello": true},
|
||||
"flatQux": "cba",
|
||||
"pfx.foo": "this is a long string in order to force multi-line pretty printing",
|
||||
"pfx.renamed-bar": 321,
|
||||
"pfx.baz": {"hello": true},
|
||||
"pfx.xfp.qux": "fed",
|
||||
"union-type": "renamed-bar",
|
||||
"barMember": 789,
|
||||
"multiMember": "ghi",
|
||||
"dependency": {"renamed-foo": "corge"},
|
||||
"simpleGroup": {"renamed-grault": "garply"},
|
||||
"enums": ["qux", "renamed-bar", "foo", "renamed-baz"],
|
||||
"innerJson": [123, "hello", {"object": true}],
|
||||
"testBase64": "ZnJlZA==",
|
||||
"testHex": "706c756768",
|
||||
"bUnion": "renamed-bar",
|
||||
"bValue": 678,
|
||||
"externalUnion": {"type": "bar", "value": "cba"},
|
||||
"unionWithVoid": {"type": "voidValue"} }
|
BIN
MsBuildGenerationTest/capnp/testdata/binary
vendored
Normal file
BIN
MsBuildGenerationTest/capnp/testdata/binary
vendored
Normal file
Binary file not shown.
161
MsBuildGenerationTest/capnp/testdata/errors.capnp.nobuild
vendored
Normal file
161
MsBuildGenerationTest/capnp/testdata/errors.capnp.nobuild
vendored
Normal file
@ -0,0 +1,161 @@
|
||||
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
# This file is intended to test that various error cases are detected as errors. The error
|
||||
# output is matched against a golden file. The file name has the .nobuild extension to make
|
||||
# sure that a build system which automatically builds .capnp files does not try to build this one.
|
||||
|
||||
#
|
||||
|
||||
@0xccd0890aa4926a9b;
|
||||
# Can't really test the missing-ID error because the output is intentionally unpredictable.
|
||||
|
||||
const notType :Int32 = 123;
|
||||
annotation notFieldAnnotation(struct) :Int32;
|
||||
annotation fieldAnnotation(field) :Int32;
|
||||
|
||||
struct Foo {
|
||||
dupName @0 :Int32;
|
||||
dupName @1 :Int32;
|
||||
dupNumber1 @2 :Int32;
|
||||
dupNumber2 @2 :Int32;
|
||||
|
||||
missingNumber @4 :Int32;
|
||||
next @5 :Int32;
|
||||
|
||||
emptyUnion :union {}
|
||||
emptyGroup :group {}
|
||||
|
||||
singletonUnion :union {
|
||||
field @6 :Int32;
|
||||
}
|
||||
|
||||
union {
|
||||
dupName @7 :Int32;
|
||||
f8 @8 :Int32;
|
||||
}
|
||||
union {
|
||||
f9 @9 :Int32;
|
||||
f10 @10 :Int32;
|
||||
}
|
||||
|
||||
struct wrongTypeStyle {}
|
||||
WrongFieldStyle @11 :Int32;
|
||||
under_score @12 :Int32;
|
||||
|
||||
containsStruct :group {
|
||||
f13 @13 :Int32;
|
||||
struct CantNestHere {}
|
||||
}
|
||||
|
||||
retroUnion @16! :union {
|
||||
f14 @14 :Int32;
|
||||
f15 @15 :Int32;
|
||||
}
|
||||
|
||||
missingColonAndEclamation @18 union {
|
||||
f19 @19 :Int32;
|
||||
f20 @20 :Int32;
|
||||
}
|
||||
|
||||
missingExclamation @21 :union {
|
||||
f22 @22 :Int32;
|
||||
f23 @23 :Int32;
|
||||
}
|
||||
|
||||
missingColon @24! union {
|
||||
f19 @25 :Int32;
|
||||
f20 @26 :Int32;
|
||||
}
|
||||
|
||||
unnamedInNamed :union {
|
||||
f27 @27 :Int32;
|
||||
f28 @28 :Int32;
|
||||
union {
|
||||
# content is ignored
|
||||
}
|
||||
}
|
||||
|
||||
listWithoutParam @31 :List;
|
||||
listWithTooManyParams @32 :List(Int32, Int64);
|
||||
listAnyPointer @33 :List(AnyPointer);
|
||||
notAType @34 :notType;
|
||||
noParams @35 :Foo(Int32);
|
||||
|
||||
defaultOutOfRange @36 :Int16 = 1234567;
|
||||
defaultOutOfRange2 @37 :UInt16 = -1;
|
||||
defaultWrongType @38 :Text = 123;
|
||||
defaultWrongType2 @39 :Text = [123];
|
||||
defaultWrongType3 @40 :Text = (foo = 123, bar = 456);
|
||||
defaultTooBigToBeNegative @41 :Int64 = -0x8000000000000001;
|
||||
defaultNotConstant @42 :Int32 = .Foo;
|
||||
defaultConstantNotQualified @43 :Int32 = notType;
|
||||
|
||||
notAnnotation @44 :Int32 $Foo(123);
|
||||
badAnnotation @45 :Int32 $notFieldAnnotation(123);
|
||||
notVoidAnnotation @46 :Int32 $fieldAnnotation;
|
||||
|
||||
undefinedImport @17 :import "noshuchfile.capnp".Bar;
|
||||
undefinedAbsolute @47 : .NoSuch;
|
||||
undefinedRelative @29 :NoSuch;
|
||||
undefinedMember @30 :Foo.NoSuch;
|
||||
}
|
||||
|
||||
struct Bar {
|
||||
x @3 :Text;
|
||||
someGroup :group {
|
||||
defaultMissingFieldName @2 :Bar = (x = "abcd", 456);
|
||||
defaultNoSuchField @0 :Bar = (nosuchfield = 123);
|
||||
defaultGroupMismatch @1 :Bar = (someGroup = 123);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
using Bar;
|
||||
|
||||
enum DupEnumerants {
|
||||
dupName @0;
|
||||
dupName @1;
|
||||
dupNumber1 @2;
|
||||
dupNumber2 @2;
|
||||
}
|
||||
|
||||
const recursive: UInt32 = .recursive;
|
||||
|
||||
struct Generic(T, U) {
|
||||
}
|
||||
|
||||
struct UseGeneric {
|
||||
tooFew @0 :Generic(Text);
|
||||
tooMany @1 :Generic(Text, Data, List(Int32));
|
||||
doubleBind @2 :Generic(Text, Data)(Data, Text);
|
||||
primitiveBinding @3 :Generic(Text, Int32);
|
||||
}
|
||||
|
||||
const embedBadType :UInt32 = embed "binary";
|
||||
const embedNoSuchFile :Data = embed "no-such-file";
|
||||
|
||||
using Baz = import "nosuchfile-unused.capnp".Baz;
|
||||
# Check that an import in an unused `using` still reports error.
|
||||
|
||||
interface TestInterface {
|
||||
foo @0 (a :UInt32 = null);
|
||||
}
|
60
MsBuildGenerationTest/capnp/testdata/errors.txt
vendored
Normal file
60
MsBuildGenerationTest/capnp/testdata/errors.txt
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
file:74:30-32: error: As of Cap'n Proto v0.3, it is no longer necessary to assign numbers to unions. However, removing the number will break binary compatibility. If this is an old protocol and you need to retain compatibility, please add an exclamation point after the number to indicate that it is really needed, e.g. `foo @1! :union {`. If this is a new protocol or compatibility doesn't matter, just remove the @n entirely. Sorry for the inconvenience, and thanks for being an early adopter! :)
|
||||
file:74:30-32: error: As of Cap'n Proto v0.3, the 'union' keyword should be prefixed with a colon for named unions, e.g. `foo :union {`.
|
||||
file:79:23-25: error: As of Cap'n Proto v0.3, it is no longer necessary to assign numbers to unions. However, removing the number will break binary compatibility. If this is an old protocol and you need to retain compatibility, please add an exclamation point after the number to indicate that it is really needed, e.g. `foo @1! :union {`. If this is a new protocol or compatibility doesn't matter, just remove the @n entirely. Sorry for the inconvenience, and thanks for being an early adopter! :)
|
||||
file:84:17-19: error: As of Cap'n Proto v0.3, the 'union' keyword should be prefixed with a colon for named unions, e.g. `foo :union {`.
|
||||
file:132:7-10: error: 'using' declaration without '=' must specify a named declaration from a different scope.
|
||||
file:37:3-10: error: 'dupName' is already defined in this scope.
|
||||
file:36:3-10: error: 'dupName' previously defined here.
|
||||
file:52:5-12: error: 'dupName' is already defined in this scope.
|
||||
file:36:3-10: error: 'dupName' previously defined here.
|
||||
file:55:3-8: error: An unnamed union is already defined in this scope.
|
||||
file:51:3-8: error: Previously defined here.
|
||||
file:60:10-24: error: Type names must begin with a capital letter.
|
||||
file:61:3-18: error: Non-type names must begin with a lower-case letter.
|
||||
file:62:3-14: error: Cap'n Proto declaration names should use camelCase and must not contain underscores. (Code generators may convert names to the appropriate style for the target language.)
|
||||
file:66:5-27: error: This kind of declaration doesn't belong here.
|
||||
file:44:3-23: error: Union must have at least two members.
|
||||
file:45:3-23: error: Group must have at least one member.
|
||||
file:47: error: Union must have at least two members.
|
||||
file:92: error: Unions cannot contain unnamed unions.
|
||||
file:39:15-16: error: Duplicate ordinal number.
|
||||
file:38:15-16: error: Ordinal @2 originally used here.
|
||||
file:41:18-19: error: Skipped ordinal @3. Ordinals must be sequential with no holes.
|
||||
file:69:15-17: error: Union ordinal, if specified, must be greater than no more than one of its member ordinals (i.e. there can only be one field retroactively unionized).
|
||||
file:116:31-50: error: Import failed: noshuchfile.capnp
|
||||
file:118:26-32: error: Not defined: NoSuch
|
||||
file:119:28-34: error: 'Foo' has no member named 'NoSuch'
|
||||
file:97:25-29: error: 'List' requires exactly one parameter.
|
||||
file:98:30-48: error: Too many generic parameters.
|
||||
file:98:30-34: error: 'List' requires exactly one parameter.
|
||||
file:99:23-39: error: 'List(AnyPointer)' is not supported.
|
||||
file:100:17-24: error: 'notType' is not a type.
|
||||
file:101:17-27: error: Declaration does not accept generic parameters.
|
||||
file:103:34-41: error: Integer value out of range.
|
||||
file:104:37-38: error: Integer value out of range.
|
||||
file:105:32-35: error: Type mismatch; expected Text.
|
||||
file:106:33-38: error: Type mismatch; expected Text.
|
||||
file:107:33-55: error: Type mismatch; expected Text.
|
||||
file:108:43-61: error: Integer is too big to be negative.
|
||||
file:109:35-39: error: '.Foo' does not refer to a constant.
|
||||
file:110:44-51: error: Constant names must be qualified to avoid confusion. Please replace 'notType' with '.notType', if that's what you intended.
|
||||
file:117:28-34: error: Not defined: NoSuch
|
||||
file:112:29-32: error: 'Foo' is not an annotation.
|
||||
file:113:29-47: error: 'notFieldAnnotation' cannot be applied to this kind of declaration.
|
||||
file:114:33-48: error: 'fieldAnnotation' requires a value.
|
||||
file:126:35-46: error: Struct has no field named 'nosuchfield'.
|
||||
file:127:49-52: error: Type mismatch; expected group.
|
||||
file:125:52-55: error: Missing field name.
|
||||
file:136:3-10: error: 'dupName' is already defined in this scope.
|
||||
file:135:3-10: error: 'dupName' previously defined here.
|
||||
file:138:15-16: error: Duplicate ordinal number.
|
||||
file:137:15-16: error: Ordinal @2 originally used here.
|
||||
file:141:7-16: error: Declaration recursively depends on itself.
|
||||
file:147:14-27: error: Not enough generic parameters.
|
||||
file:148:15-47: error: Too many generic parameters.
|
||||
file:149:18-49: error: Double-application of generic parameters.
|
||||
file:150:38-43: error: Sorry, only pointer types can be used as generic parameters.
|
||||
file:153:30-44: error: Embeds can only be used when Text, Data, or a struct is expected.
|
||||
file:154:37-51: error: Couldn't read file for embed: no-such-file
|
||||
file:160:23-27: error: Only pointer parameters can declare their default as 'null'.
|
||||
file:156:20-45: error: Import failed: nosuchfile-unused.capnp
|
BIN
MsBuildGenerationTest/capnp/testdata/flat
vendored
Normal file
BIN
MsBuildGenerationTest/capnp/testdata/flat
vendored
Normal file
Binary file not shown.
BIN
MsBuildGenerationTest/capnp/testdata/lists.binary
vendored
Normal file
BIN
MsBuildGenerationTest/capnp/testdata/lists.binary
vendored
Normal file
Binary file not shown.
BIN
MsBuildGenerationTest/capnp/testdata/packed
vendored
Normal file
BIN
MsBuildGenerationTest/capnp/testdata/packed
vendored
Normal file
Binary file not shown.
BIN
MsBuildGenerationTest/capnp/testdata/packedflat
vendored
Normal file
BIN
MsBuildGenerationTest/capnp/testdata/packedflat
vendored
Normal file
Binary file not shown.
88
MsBuildGenerationTest/capnp/testdata/pretty.json
vendored
Normal file
88
MsBuildGenerationTest/capnp/testdata/pretty.json
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
{ "voidField": null,
|
||||
"boolField": true,
|
||||
"int8Field": -123,
|
||||
"int16Field": -12345,
|
||||
"int32Field": -12345678,
|
||||
"int64Field": "-123456789012345",
|
||||
"uInt8Field": 234,
|
||||
"uInt16Field": 45678,
|
||||
"uInt32Field": 3456789012,
|
||||
"uInt64Field": "12345678901234567890",
|
||||
"float32Field": 1234.5,
|
||||
"float64Field": -1.23e47,
|
||||
"textField": "foo",
|
||||
"dataField": [98, 97, 114],
|
||||
"structField": {
|
||||
"voidField": null,
|
||||
"boolField": true,
|
||||
"int8Field": -12,
|
||||
"int16Field": 3456,
|
||||
"int32Field": -78901234,
|
||||
"int64Field": "56789012345678",
|
||||
"uInt8Field": 90,
|
||||
"uInt16Field": 1234,
|
||||
"uInt32Field": 56789012,
|
||||
"uInt64Field": "345678901234567890",
|
||||
"float32Field": -1.2499999646475857e-10,
|
||||
"float64Field": 345,
|
||||
"textField": "baz",
|
||||
"dataField": [113, 117, 120],
|
||||
"structField": {
|
||||
"voidField": null,
|
||||
"boolField": false,
|
||||
"int8Field": 0,
|
||||
"int16Field": 0,
|
||||
"int32Field": 0,
|
||||
"int64Field": "0",
|
||||
"uInt8Field": 0,
|
||||
"uInt16Field": 0,
|
||||
"uInt32Field": 0,
|
||||
"uInt64Field": "0",
|
||||
"float32Field": 0,
|
||||
"float64Field": 0,
|
||||
"textField": "nested",
|
||||
"structField": {"voidField": null, "boolField": false, "int8Field": 0, "int16Field": 0, "int32Field": 0, "int64Field": "0", "uInt8Field": 0, "uInt16Field": 0, "uInt32Field": 0, "uInt64Field": "0", "float32Field": 0, "float64Field": 0, "textField": "really nested", "enumField": "foo", "interfaceField": null},
|
||||
"enumField": "foo",
|
||||
"interfaceField": null },
|
||||
"enumField": "baz",
|
||||
"interfaceField": null,
|
||||
"voidList": [null, null, null],
|
||||
"boolList": [false, true, false, true, true],
|
||||
"int8List": [12, -34, -128, 127],
|
||||
"int16List": [1234, -5678, -32768, 32767],
|
||||
"int32List": [12345678, -90123456, -2147483648, 2147483647],
|
||||
"int64List": ["123456789012345", "-678901234567890", "-9223372036854775808", "9223372036854775807"],
|
||||
"uInt8List": [12, 34, 0, 255],
|
||||
"uInt16List": [1234, 5678, 0, 65535],
|
||||
"uInt32List": [12345678, 90123456, 0, 4294967295],
|
||||
"uInt64List": ["123456789012345", "678901234567890", "0", "18446744073709551615"],
|
||||
"float32List": [0, 1234567, 9.9999999338158125e36, -9.9999999338158125e36, 9.99999991097579e-38, -9.99999991097579e-38],
|
||||
"float64List": [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],
|
||||
"textList": ["quux", "corge", "grault"],
|
||||
"dataList": [[103, 97, 114, 112, 108, 121], [119, 97, 108, 100, 111], [102, 114, 101, 100]],
|
||||
"structList": [
|
||||
{"voidField": null, "boolField": false, "int8Field": 0, "int16Field": 0, "int32Field": 0, "int64Field": "0", "uInt8Field": 0, "uInt16Field": 0, "uInt32Field": 0, "uInt64Field": "0", "float32Field": 0, "float64Field": 0, "textField": "x structlist 1", "enumField": "foo", "interfaceField": null},
|
||||
{"voidField": null, "boolField": false, "int8Field": 0, "int16Field": 0, "int32Field": 0, "int64Field": "0", "uInt8Field": 0, "uInt16Field": 0, "uInt32Field": 0, "uInt64Field": "0", "float32Field": 0, "float64Field": 0, "textField": "x structlist 2", "enumField": "foo", "interfaceField": null},
|
||||
{"voidField": null, "boolField": false, "int8Field": 0, "int16Field": 0, "int32Field": 0, "int64Field": "0", "uInt8Field": 0, "uInt16Field": 0, "uInt32Field": 0, "uInt64Field": "0", "float32Field": 0, "float64Field": 0, "textField": "x structlist 3", "enumField": "foo", "interfaceField": null} ],
|
||||
"enumList": ["qux", "bar", "grault"] },
|
||||
"enumField": "corge",
|
||||
"interfaceField": null,
|
||||
"voidList": [null, null, null, null, null, null],
|
||||
"boolList": [true, false, false, true],
|
||||
"int8List": [111, -111],
|
||||
"int16List": [11111, -11111],
|
||||
"int32List": [111111111, -111111111],
|
||||
"int64List": ["1111111111111111111", "-1111111111111111111"],
|
||||
"uInt8List": [111, 222],
|
||||
"uInt16List": [33333, 44444],
|
||||
"uInt32List": [3333333333],
|
||||
"uInt64List": ["11111111111111111111"],
|
||||
"float32List": [5555.5, "Infinity", "-Infinity", "NaN"],
|
||||
"float64List": [7777.75, "Infinity", "-Infinity", "NaN"],
|
||||
"textList": ["plugh", "xyzzy", "thud"],
|
||||
"dataList": [[111, 111, 112, 115], [101, 120, 104, 97, 117, 115, 116, 101, 100], [114, 102, 99, 51, 48, 57, 50]],
|
||||
"structList": [
|
||||
{"voidField": null, "boolField": false, "int8Field": 0, "int16Field": 0, "int32Field": 0, "int64Field": "0", "uInt8Field": 0, "uInt16Field": 0, "uInt32Field": 0, "uInt64Field": "0", "float32Field": 0, "float64Field": 0, "textField": "structlist 1", "enumField": "foo", "interfaceField": null},
|
||||
{"voidField": null, "boolField": false, "int8Field": 0, "int16Field": 0, "int32Field": 0, "int64Field": "0", "uInt8Field": 0, "uInt16Field": 0, "uInt32Field": 0, "uInt64Field": "0", "float32Field": 0, "float64Field": 0, "textField": "structlist 2", "enumField": "foo", "interfaceField": null},
|
||||
{"voidField": null, "boolField": false, "int8Field": 0, "int16Field": 0, "int32Field": 0, "int64Field": "0", "uInt8Field": 0, "uInt16Field": 0, "uInt32Field": 0, "uInt64Field": "0", "float32Field": 0, "float64Field": 0, "textField": "structlist 3", "enumField": "foo", "interfaceField": null} ],
|
||||
"enumList": ["foo", "garply"] }
|
187
MsBuildGenerationTest/capnp/testdata/pretty.txt
vendored
Normal file
187
MsBuildGenerationTest/capnp/testdata/pretty.txt
vendored
Normal file
@ -0,0 +1,187 @@
|
||||
( voidField = void,
|
||||
boolField = true,
|
||||
int8Field = -123,
|
||||
int16Field = -12345,
|
||||
int32Field = -12345678,
|
||||
int64Field = -123456789012345,
|
||||
uInt8Field = 234,
|
||||
uInt16Field = 45678,
|
||||
uInt32Field = 3456789012,
|
||||
uInt64Field = 12345678901234567890,
|
||||
float32Field = 1234.5,
|
||||
float64Field = -1.23e47,
|
||||
textField = "foo",
|
||||
dataField = "bar",
|
||||
structField = (
|
||||
voidField = void,
|
||||
boolField = true,
|
||||
int8Field = -12,
|
||||
int16Field = 3456,
|
||||
int32Field = -78901234,
|
||||
int64Field = 56789012345678,
|
||||
uInt8Field = 90,
|
||||
uInt16Field = 1234,
|
||||
uInt32Field = 56789012,
|
||||
uInt64Field = 345678901234567890,
|
||||
float32Field = -1.25e-10,
|
||||
float64Field = 345,
|
||||
textField = "baz",
|
||||
dataField = "qux",
|
||||
structField = (
|
||||
voidField = void,
|
||||
boolField = false,
|
||||
int8Field = 0,
|
||||
int16Field = 0,
|
||||
int32Field = 0,
|
||||
int64Field = 0,
|
||||
uInt8Field = 0,
|
||||
uInt16Field = 0,
|
||||
uInt32Field = 0,
|
||||
uInt64Field = 0,
|
||||
float32Field = 0,
|
||||
float64Field = 0,
|
||||
textField = "nested",
|
||||
structField = (
|
||||
voidField = void,
|
||||
boolField = false,
|
||||
int8Field = 0,
|
||||
int16Field = 0,
|
||||
int32Field = 0,
|
||||
int64Field = 0,
|
||||
uInt8Field = 0,
|
||||
uInt16Field = 0,
|
||||
uInt32Field = 0,
|
||||
uInt64Field = 0,
|
||||
float32Field = 0,
|
||||
float64Field = 0,
|
||||
textField = "really nested",
|
||||
enumField = foo,
|
||||
interfaceField = void ),
|
||||
enumField = foo,
|
||||
interfaceField = void ),
|
||||
enumField = baz,
|
||||
interfaceField = void,
|
||||
voidList = [void, void, void],
|
||||
boolList = [false, true, false, true, true],
|
||||
int8List = [12, -34, -128, 127],
|
||||
int16List = [1234, -5678, -32768, 32767],
|
||||
int32List = [12345678, -90123456, -2147483648, 2147483647],
|
||||
int64List = [123456789012345, -678901234567890, -9223372036854775808, 9223372036854775807],
|
||||
uInt8List = [12, 34, 0, 255],
|
||||
uInt16List = [1234, 5678, 0, 65535],
|
||||
uInt32List = [12345678, 90123456, 0, 4294967295],
|
||||
uInt64List = [123456789012345, 678901234567890, 0, 18446744073709551615],
|
||||
float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37],
|
||||
float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306],
|
||||
textList = ["quux", "corge", "grault"],
|
||||
dataList = ["garply", "waldo", "fred"],
|
||||
structList = [
|
||||
( voidField = void,
|
||||
boolField = false,
|
||||
int8Field = 0,
|
||||
int16Field = 0,
|
||||
int32Field = 0,
|
||||
int64Field = 0,
|
||||
uInt8Field = 0,
|
||||
uInt16Field = 0,
|
||||
uInt32Field = 0,
|
||||
uInt64Field = 0,
|
||||
float32Field = 0,
|
||||
float64Field = 0,
|
||||
textField = "x structlist 1",
|
||||
enumField = foo,
|
||||
interfaceField = void ),
|
||||
( voidField = void,
|
||||
boolField = false,
|
||||
int8Field = 0,
|
||||
int16Field = 0,
|
||||
int32Field = 0,
|
||||
int64Field = 0,
|
||||
uInt8Field = 0,
|
||||
uInt16Field = 0,
|
||||
uInt32Field = 0,
|
||||
uInt64Field = 0,
|
||||
float32Field = 0,
|
||||
float64Field = 0,
|
||||
textField = "x structlist 2",
|
||||
enumField = foo,
|
||||
interfaceField = void ),
|
||||
( voidField = void,
|
||||
boolField = false,
|
||||
int8Field = 0,
|
||||
int16Field = 0,
|
||||
int32Field = 0,
|
||||
int64Field = 0,
|
||||
uInt8Field = 0,
|
||||
uInt16Field = 0,
|
||||
uInt32Field = 0,
|
||||
uInt64Field = 0,
|
||||
float32Field = 0,
|
||||
float64Field = 0,
|
||||
textField = "x structlist 3",
|
||||
enumField = foo,
|
||||
interfaceField = void ) ],
|
||||
enumList = [qux, bar, grault] ),
|
||||
enumField = corge,
|
||||
interfaceField = void,
|
||||
voidList = [void, void, void, void, void, void],
|
||||
boolList = [true, false, false, true],
|
||||
int8List = [111, -111],
|
||||
int16List = [11111, -11111],
|
||||
int32List = [111111111, -111111111],
|
||||
int64List = [1111111111111111111, -1111111111111111111],
|
||||
uInt8List = [111, 222],
|
||||
uInt16List = [33333, 44444],
|
||||
uInt32List = [3333333333],
|
||||
uInt64List = [11111111111111111111],
|
||||
float32List = [5555.5, inf, -inf, nan],
|
||||
float64List = [7777.75, inf, -inf, nan],
|
||||
textList = ["plugh", "xyzzy", "thud"],
|
||||
dataList = ["oops", "exhausted", "rfc3092"],
|
||||
structList = [
|
||||
( voidField = void,
|
||||
boolField = false,
|
||||
int8Field = 0,
|
||||
int16Field = 0,
|
||||
int32Field = 0,
|
||||
int64Field = 0,
|
||||
uInt8Field = 0,
|
||||
uInt16Field = 0,
|
||||
uInt32Field = 0,
|
||||
uInt64Field = 0,
|
||||
float32Field = 0,
|
||||
float64Field = 0,
|
||||
textField = "structlist 1",
|
||||
enumField = foo,
|
||||
interfaceField = void ),
|
||||
( voidField = void,
|
||||
boolField = false,
|
||||
int8Field = 0,
|
||||
int16Field = 0,
|
||||
int32Field = 0,
|
||||
int64Field = 0,
|
||||
uInt8Field = 0,
|
||||
uInt16Field = 0,
|
||||
uInt32Field = 0,
|
||||
uInt64Field = 0,
|
||||
float32Field = 0,
|
||||
float64Field = 0,
|
||||
textField = "structlist 2",
|
||||
enumField = foo,
|
||||
interfaceField = void ),
|
||||
( voidField = void,
|
||||
boolField = false,
|
||||
int8Field = 0,
|
||||
int16Field = 0,
|
||||
int32Field = 0,
|
||||
int64Field = 0,
|
||||
uInt8Field = 0,
|
||||
uInt16Field = 0,
|
||||
uInt32Field = 0,
|
||||
uInt64Field = 0,
|
||||
float32Field = 0,
|
||||
float64Field = 0,
|
||||
textField = "structlist 3",
|
||||
enumField = foo,
|
||||
interfaceField = void ) ],
|
||||
enumList = [foo, garply] )
|
BIN
MsBuildGenerationTest/capnp/testdata/segmented
vendored
Normal file
BIN
MsBuildGenerationTest/capnp/testdata/segmented
vendored
Normal file
Binary file not shown.
BIN
MsBuildGenerationTest/capnp/testdata/segmented-packed
vendored
Normal file
BIN
MsBuildGenerationTest/capnp/testdata/segmented-packed
vendored
Normal file
Binary file not shown.
1
MsBuildGenerationTest/capnp/testdata/short.json
vendored
Normal file
1
MsBuildGenerationTest/capnp/testdata/short.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"voidField":null,"boolField":true,"int8Field":-123,"int16Field":-12345,"int32Field":-12345678,"int64Field":"-123456789012345","uInt8Field":234,"uInt16Field":45678,"uInt32Field":3456789012,"uInt64Field":"12345678901234567890","float32Field":1234.5,"float64Field":-1.23e47,"textField":"foo","dataField":[98,97,114],"structField":{"voidField":null,"boolField":true,"int8Field":-12,"int16Field":3456,"int32Field":-78901234,"int64Field":"56789012345678","uInt8Field":90,"uInt16Field":1234,"uInt32Field":56789012,"uInt64Field":"345678901234567890","float32Field":-1.2499999646475857e-10,"float64Field":345,"textField":"baz","dataField":[113,117,120],"structField":{"voidField":null,"boolField":false,"int8Field":0,"int16Field":0,"int32Field":0,"int64Field":"0","uInt8Field":0,"uInt16Field":0,"uInt32Field":0,"uInt64Field":"0","float32Field":0,"float64Field":0,"textField":"nested","structField":{"voidField":null,"boolField":false,"int8Field":0,"int16Field":0,"int32Field":0,"int64Field":"0","uInt8Field":0,"uInt16Field":0,"uInt32Field":0,"uInt64Field":"0","float32Field":0,"float64Field":0,"textField":"really nested","enumField":"foo","interfaceField":null},"enumField":"foo","interfaceField":null},"enumField":"baz","interfaceField":null,"voidList":[null,null,null],"boolList":[false,true,false,true,true],"int8List":[12,-34,-128,127],"int16List":[1234,-5678,-32768,32767],"int32List":[12345678,-90123456,-2147483648,2147483647],"int64List":["123456789012345","-678901234567890","-9223372036854775808","9223372036854775807"],"uInt8List":[12,34,0,255],"uInt16List":[1234,5678,0,65535],"uInt32List":[12345678,90123456,0,4294967295],"uInt64List":["123456789012345","678901234567890","0","18446744073709551615"],"float32List":[0,1234567,9.9999999338158125e36,-9.9999999338158125e36,9.99999991097579e-38,-9.99999991097579e-38],"float64List":[0,123456789012345,1e306,-1e306,1e-306,-1e-306],"textList":["quux","corge","grault"],"dataList":[[103,97,114,112,108,121],[119,97,108,100,111],[102,114,101,100]],"structList":[{"voidField":null,"boolField":false,"int8Field":0,"int16Field":0,"int32Field":0,"int64Field":"0","uInt8Field":0,"uInt16Field":0,"uInt32Field":0,"uInt64Field":"0","float32Field":0,"float64Field":0,"textField":"x structlist 1","enumField":"foo","interfaceField":null},{"voidField":null,"boolField":false,"int8Field":0,"int16Field":0,"int32Field":0,"int64Field":"0","uInt8Field":0,"uInt16Field":0,"uInt32Field":0,"uInt64Field":"0","float32Field":0,"float64Field":0,"textField":"x structlist 2","enumField":"foo","interfaceField":null},{"voidField":null,"boolField":false,"int8Field":0,"int16Field":0,"int32Field":0,"int64Field":"0","uInt8Field":0,"uInt16Field":0,"uInt32Field":0,"uInt64Field":"0","float32Field":0,"float64Field":0,"textField":"x structlist 3","enumField":"foo","interfaceField":null}],"enumList":["qux","bar","grault"]},"enumField":"corge","interfaceField":null,"voidList":[null,null,null,null,null,null],"boolList":[true,false,false,true],"int8List":[111,-111],"int16List":[11111,-11111],"int32List":[111111111,-111111111],"int64List":["1111111111111111111","-1111111111111111111"],"uInt8List":[111,222],"uInt16List":[33333,44444],"uInt32List":[3333333333],"uInt64List":["11111111111111111111"],"float32List":[5555.5,"Infinity","-Infinity","NaN"],"float64List":[7777.75,"Infinity","-Infinity","NaN"],"textList":["plugh","xyzzy","thud"],"dataList":[[111,111,112,115],[101,120,104,97,117,115,116,101,100],[114,102,99,51,48,57,50]],"structList":[{"voidField":null,"boolField":false,"int8Field":0,"int16Field":0,"int32Field":0,"int64Field":"0","uInt8Field":0,"uInt16Field":0,"uInt32Field":0,"uInt64Field":"0","float32Field":0,"float64Field":0,"textField":"structlist 1","enumField":"foo","interfaceField":null},{"voidField":null,"boolField":false,"int8Field":0,"int16Field":0,"int32Field":0,"int64Field":"0","uInt8Field":0,"uInt16Field":0,"uInt32Field":0,"uInt64Field":"0","float32Field":0,"float64Field":0,"textField":"structlist 2","enumField":"foo","interfaceField":null},{"voidField":null,"boolField":false,"int8Field":0,"int16Field":0,"int32Field":0,"int64Field":"0","uInt8Field":0,"uInt16Field":0,"uInt32Field":0,"uInt64Field":"0","float32Field":0,"float64Field":0,"textField":"structlist 3","enumField":"foo","interfaceField":null}],"enumList":["foo","garply"]}
|
1
MsBuildGenerationTest/capnp/testdata/short.txt
vendored
Normal file
1
MsBuildGenerationTest/capnp/testdata/short.txt
vendored
Normal file
@ -0,0 +1 @@
|
||||
(voidField = void, boolField = true, int8Field = -123, int16Field = -12345, int32Field = -12345678, int64Field = -123456789012345, uInt8Field = 234, uInt16Field = 45678, uInt32Field = 3456789012, uInt64Field = 12345678901234567890, float32Field = 1234.5, float64Field = -1.23e47, textField = "foo", dataField = "bar", structField = (voidField = void, boolField = true, int8Field = -12, int16Field = 3456, int32Field = -78901234, int64Field = 56789012345678, uInt8Field = 90, uInt16Field = 1234, uInt32Field = 56789012, uInt64Field = 345678901234567890, float32Field = -1.25e-10, float64Field = 345, textField = "baz", dataField = "qux", structField = (voidField = void, boolField = false, int8Field = 0, int16Field = 0, int32Field = 0, int64Field = 0, uInt8Field = 0, uInt16Field = 0, uInt32Field = 0, uInt64Field = 0, float32Field = 0, float64Field = 0, textField = "nested", structField = (voidField = void, boolField = false, int8Field = 0, int16Field = 0, int32Field = 0, int64Field = 0, uInt8Field = 0, uInt16Field = 0, uInt32Field = 0, uInt64Field = 0, float32Field = 0, float64Field = 0, textField = "really nested", enumField = foo, interfaceField = void), enumField = foo, interfaceField = void), enumField = baz, interfaceField = void, voidList = [void, void, void], boolList = [false, true, false, true, true], int8List = [12, -34, -128, 127], int16List = [1234, -5678, -32768, 32767], int32List = [12345678, -90123456, -2147483648, 2147483647], int64List = [123456789012345, -678901234567890, -9223372036854775808, 9223372036854775807], uInt8List = [12, 34, 0, 255], uInt16List = [1234, 5678, 0, 65535], uInt32List = [12345678, 90123456, 0, 4294967295], uInt64List = [123456789012345, 678901234567890, 0, 18446744073709551615], float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37], float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306], textList = ["quux", "corge", "grault"], dataList = ["garply", "waldo", "fred"], structList = [(voidField = void, boolField = false, int8Field = 0, int16Field = 0, int32Field = 0, int64Field = 0, uInt8Field = 0, uInt16Field = 0, uInt32Field = 0, uInt64Field = 0, float32Field = 0, float64Field = 0, textField = "x structlist 1", enumField = foo, interfaceField = void), (voidField = void, boolField = false, int8Field = 0, int16Field = 0, int32Field = 0, int64Field = 0, uInt8Field = 0, uInt16Field = 0, uInt32Field = 0, uInt64Field = 0, float32Field = 0, float64Field = 0, textField = "x structlist 2", enumField = foo, interfaceField = void), (voidField = void, boolField = false, int8Field = 0, int16Field = 0, int32Field = 0, int64Field = 0, uInt8Field = 0, uInt16Field = 0, uInt32Field = 0, uInt64Field = 0, float32Field = 0, float64Field = 0, textField = "x structlist 3", enumField = foo, interfaceField = void)], enumList = [qux, bar, grault]), enumField = corge, interfaceField = void, voidList = [void, void, void, void, void, void], boolList = [true, false, false, true], int8List = [111, -111], int16List = [11111, -11111], int32List = [111111111, -111111111], int64List = [1111111111111111111, -1111111111111111111], uInt8List = [111, 222], uInt16List = [33333, 44444], uInt32List = [3333333333], uInt64List = [11111111111111111111], float32List = [5555.5, inf, -inf, nan], float64List = [7777.75, inf, -inf, nan], textList = ["plugh", "xyzzy", "thud"], dataList = ["oops", "exhausted", "rfc3092"], structList = [(voidField = void, boolField = false, int8Field = 0, int16Field = 0, int32Field = 0, int64Field = 0, uInt8Field = 0, uInt16Field = 0, uInt32Field = 0, uInt64Field = 0, float32Field = 0, float64Field = 0, textField = "structlist 1", enumField = foo, interfaceField = void), (voidField = void, boolField = false, int8Field = 0, int16Field = 0, int32Field = 0, int64Field = 0, uInt8Field = 0, uInt16Field = 0, uInt32Field = 0, uInt64Field = 0, float32Field = 0, float64Field = 0, textField = "structlist 2", enumField = foo, interfaceField = void), (voidField = void, boolField = false, int8Field = 0, int16Field = 0, int32Field = 0, int64Field = 0, uInt8Field = 0, uInt16Field = 0, uInt32Field = 0, uInt64Field = 0, float32Field = 0, float64Field = 0, textField = "structlist 3", enumField = foo, interfaceField = void)], enumList = [foo, garply])
|
10
MsBuildGenerationTest/nuget.config
Normal file
10
MsBuildGenerationTest/nuget.config
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="repositoryPath" value="..\packages" />
|
||||
<add key="globalPackagesFolder" value="..\globalPackages" />
|
||||
</config>
|
||||
<packageSources>
|
||||
<add key="MsBuildGenerationSource" value="..\bin\Release" />
|
||||
</packageSources>
|
||||
</configuration>
|
@ -42,10 +42,10 @@ build_script:
|
||||
after_build:
|
||||
# For once the build has completed
|
||||
artifacts:
|
||||
- path: Capnp.Net.Runtime\bin\Release\Capnp.Net.Runtime.$(appveyor_build_version).nupkg
|
||||
- path: bin\Release\Capnp.Net.Runtime.$(appveyor_build_version).nupkg
|
||||
name: Capnp.Net.Runtime
|
||||
type: NuGetPackage
|
||||
- path: CapnpC.CSharp.MsBuild.Generation\bin\Release\CapnpC.CSharp.MsBuild.Generation.$(appveyor_build_version).nupkg
|
||||
- path: bin\Release\CapnpC.CSharp.MsBuild.Generation.$(appveyor_build_version).nupkg
|
||||
name: CapnpC.CSharp.MsBuild.Generation
|
||||
type: NuGetPackage
|
||||
- path: chocolatey\install\capnpc-csharp-win-x86.$(appveyor_build_version).nupkg
|
||||
|
@ -14,10 +14,7 @@
|
||||
<RepositoryType>Git</RepositoryType>
|
||||
<PackageTags>capnp capnpc RPC serialization cerealization</PackageTags>
|
||||
<Version>1.0.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<OutputPath></OutputPath>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user