diff --git a/Benchmarking/Benchmark/Benchmark.csproj b/Benchmarking/Benchmark/Benchmark.csproj index 5193d73..bea0145 100644 --- a/Benchmarking/Benchmark/Benchmark.csproj +++ b/Benchmarking/Benchmark/Benchmark.csproj @@ -9,7 +9,7 @@ - + all diff --git a/Benchmarking/NuGet.Config b/Benchmarking/NuGet.Config deleted file mode 100644 index 3bb8cd5..0000000 --- a/Benchmarking/NuGet.Config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Benchmarking/nuget.config b/Benchmarking/nuget.config deleted file mode 100644 index 3bb8cd5..0000000 --- a/Benchmarking/nuget.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Capnp.Net.Runtime/DeserializerState.cs b/Capnp.Net.Runtime/DeserializerState.cs index eaa24f9..4c94030 100644 --- a/Capnp.Net.Runtime/DeserializerState.cs +++ b/Capnp.Net.Runtime/DeserializerState.cs @@ -642,6 +642,31 @@ namespace Capnp return cons(StructReadPointer(index)); } + /// + /// Convenience method. Given this state represents a struct, determines if a field is non-null. + /// + /// index within this struct's pointer table + /// true if the field is non-null, false otherwise + /// negative or too large index + /// state does not represent a struct, invalid pointer, + /// non-struct pointer + public bool IsStructFieldNonNull(int index) + { + if (Kind != ObjectKind.Struct && Kind != ObjectKind.Nil) + { + throw new DeserializationException("This is not a struct"); + } + + if (index < 0 || index >= StructPtrCount) + { + throw new IndexOutOfRangeException($"Invalid index {index}. Must be [0, {StructPtrCount})."); + } + + var pointerOffset = index + StructDataCount; + WirePointer pointer = CurrentSegment[Offset + pointerOffset]; + return !pointer.IsNull; + } + /// /// Given this state represents a capability, returns its index into the capability table. /// diff --git a/CapnpC.CSharp.Generator.Tests/Embedded Resources/test.cs b/CapnpC.CSharp.Generator.Tests/Embedded Resources/test.cs index ac83045..a073f18 100644 --- a/CapnpC.CSharp.Generator.Tests/Embedded Resources/test.cs +++ b/CapnpC.CSharp.Generator.Tests/Embedded Resources/test.cs @@ -325,24 +325,42 @@ namespace Capnproto_test.Capnp.Test public string TextField => ctx.ReadText(0, null); public IReadOnlyList DataField => ctx.ReadList(1).CastByte(); public Capnproto_test.Capnp.Test.TestAllTypes.READER StructField => ctx.ReadStruct(2, Capnproto_test.Capnp.Test.TestAllTypes.READER.create); + public bool HasStructField => ctx.IsStructFieldNonNull(2); public Capnproto_test.Capnp.Test.TestEnum EnumField => (Capnproto_test.Capnp.Test.TestEnum)ctx.ReadDataUShort(288UL, (ushort)0); public int VoidList => ctx.ReadList(3).Count; + public bool HasVoidList => ctx.IsStructFieldNonNull(3); public IReadOnlyList BoolList => ctx.ReadList(4).CastBool(); + public bool HasBoolList => ctx.IsStructFieldNonNull(4); public IReadOnlyList Int8List => ctx.ReadList(5).CastSByte(); + public bool HasInt8List => ctx.IsStructFieldNonNull(5); public IReadOnlyList Int16List => ctx.ReadList(6).CastShort(); + public bool HasInt16List => ctx.IsStructFieldNonNull(6); public IReadOnlyList Int32List => ctx.ReadList(7).CastInt(); + public bool HasInt32List => ctx.IsStructFieldNonNull(7); public IReadOnlyList Int64List => ctx.ReadList(8).CastLong(); + public bool HasInt64List => ctx.IsStructFieldNonNull(8); public IReadOnlyList UInt8List => ctx.ReadList(9).CastByte(); + public bool HasUInt8List => ctx.IsStructFieldNonNull(9); public IReadOnlyList UInt16List => ctx.ReadList(10).CastUShort(); + public bool HasUInt16List => ctx.IsStructFieldNonNull(10); public IReadOnlyList UInt32List => ctx.ReadList(11).CastUInt(); + public bool HasUInt32List => ctx.IsStructFieldNonNull(11); public IReadOnlyList UInt64List => ctx.ReadList(12).CastULong(); + public bool HasUInt64List => ctx.IsStructFieldNonNull(12); public IReadOnlyList Float32List => ctx.ReadList(13).CastFloat(); + public bool HasFloat32List => ctx.IsStructFieldNonNull(13); public IReadOnlyList Float64List => ctx.ReadList(14).CastDouble(); + public bool HasFloat64List => ctx.IsStructFieldNonNull(14); public IReadOnlyList TextList => ctx.ReadList(15).CastText2(); + public bool HasTextList => ctx.IsStructFieldNonNull(15); public IReadOnlyList> DataList => ctx.ReadList(16).CastData(); + public bool HasDataList => ctx.IsStructFieldNonNull(16); public IReadOnlyList StructList => ctx.ReadList(17).Cast(Capnproto_test.Capnp.Test.TestAllTypes.READER.create); + public bool HasStructList => ctx.IsStructFieldNonNull(17); public IReadOnlyList EnumList => ctx.ReadList(18).CastEnums(_0 => (Capnproto_test.Capnp.Test.TestEnum)_0); + public bool HasEnumList => ctx.IsStructFieldNonNull(18); public int InterfaceList => ctx.ReadList(19).Count; + public bool HasInterfaceList => ctx.IsStructFieldNonNull(19); } public class WRITER : SerializerState @@ -897,24 +915,42 @@ namespace Capnproto_test.Capnp.Test public string TextField => ctx.ReadText(0, "foo"); public IReadOnlyList DataField => ctx.ReadList(1).CastByte(); public Capnproto_test.Capnp.Test.TestAllTypes.READER StructField => ctx.ReadStruct(2, Capnproto_test.Capnp.Test.TestAllTypes.READER.create); + public bool HasStructField => ctx.IsStructFieldNonNull(2); public Capnproto_test.Capnp.Test.TestEnum EnumField => (Capnproto_test.Capnp.Test.TestEnum)ctx.ReadDataUShort(288UL, (ushort)5); public int VoidList => ctx.ReadList(3).Count; + public bool HasVoidList => ctx.IsStructFieldNonNull(3); public IReadOnlyList BoolList => ctx.ReadList(4).CastBool(); + public bool HasBoolList => ctx.IsStructFieldNonNull(4); public IReadOnlyList Int8List => ctx.ReadList(5).CastSByte(); + public bool HasInt8List => ctx.IsStructFieldNonNull(5); public IReadOnlyList Int16List => ctx.ReadList(6).CastShort(); + public bool HasInt16List => ctx.IsStructFieldNonNull(6); public IReadOnlyList Int32List => ctx.ReadList(7).CastInt(); + public bool HasInt32List => ctx.IsStructFieldNonNull(7); public IReadOnlyList Int64List => ctx.ReadList(8).CastLong(); + public bool HasInt64List => ctx.IsStructFieldNonNull(8); public IReadOnlyList UInt8List => ctx.ReadList(9).CastByte(); + public bool HasUInt8List => ctx.IsStructFieldNonNull(9); public IReadOnlyList UInt16List => ctx.ReadList(10).CastUShort(); + public bool HasUInt16List => ctx.IsStructFieldNonNull(10); public IReadOnlyList UInt32List => ctx.ReadList(11).CastUInt(); + public bool HasUInt32List => ctx.IsStructFieldNonNull(11); public IReadOnlyList UInt64List => ctx.ReadList(12).CastULong(); + public bool HasUInt64List => ctx.IsStructFieldNonNull(12); public IReadOnlyList Float32List => ctx.ReadList(13).CastFloat(); + public bool HasFloat32List => ctx.IsStructFieldNonNull(13); public IReadOnlyList Float64List => ctx.ReadList(14).CastDouble(); + public bool HasFloat64List => ctx.IsStructFieldNonNull(14); public IReadOnlyList TextList => ctx.ReadList(15).CastText2(); + public bool HasTextList => ctx.IsStructFieldNonNull(15); public IReadOnlyList> DataList => ctx.ReadList(16).CastData(); + public bool HasDataList => ctx.IsStructFieldNonNull(16); public IReadOnlyList StructList => ctx.ReadList(17).Cast(Capnproto_test.Capnp.Test.TestAllTypes.READER.create); + public bool HasStructList => ctx.IsStructFieldNonNull(17); public IReadOnlyList EnumList => ctx.ReadList(18).CastEnums(_0 => (Capnproto_test.Capnp.Test.TestEnum)_0); + public bool HasEnumList => ctx.IsStructFieldNonNull(18); public int InterfaceList => ctx.ReadList(19).Count; + public bool HasInterfaceList => ctx.IsStructFieldNonNull(19); } public class WRITER : SerializerState @@ -4868,9 +4904,13 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestUnion.READER S16s8s64s8Set => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestUnion.READER.create); + public bool HasS16s8s64s8Set => ctx.IsStructFieldNonNull(0); public Capnproto_test.Capnp.Test.TestUnion.READER S0sps1s32Set => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestUnion.READER.create); + public bool HasS0sps1s32Set => ctx.IsStructFieldNonNull(1); public Capnproto_test.Capnp.Test.TestUnnamedUnion.READER Unnamed1 => ctx.ReadStruct(2, Capnproto_test.Capnp.Test.TestUnnamedUnion.READER.create); + public bool HasUnnamed1 => ctx.IsStructFieldNonNull(2); public Capnproto_test.Capnp.Test.TestUnnamedUnion.READER Unnamed2 => ctx.ReadStruct(3, Capnproto_test.Capnp.Test.TestUnnamedUnion.READER.create); + public bool HasUnnamed2 => ctx.IsStructFieldNonNull(3); } public class WRITER : SerializerState @@ -4967,6 +5007,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestNestedTypes.NestedStruct.READER TheNestedStruct => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestNestedTypes.NestedStruct.READER.create); + public bool HasTheNestedStruct => ctx.IsStructFieldNonNull(0); public Capnproto_test.Capnp.Test.TestNestedTypes.NestedEnum OuterNestedEnum => (Capnproto_test.Capnp.Test.TestNestedTypes.NestedEnum)ctx.ReadDataUShort(0UL, (ushort)1); public Capnproto_test.Capnp.Test.TestNestedTypes.NestedStruct.NestedEnum InnerNestedEnum => (Capnproto_test.Capnp.Test.TestNestedTypes.NestedStruct.NestedEnum)ctx.ReadDataUShort(16UL, (ushort)2); } @@ -5282,15 +5323,25 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public IReadOnlyList List0 => ctx.ReadList(0).Cast(Capnproto_test.Capnp.Test.TestLists.Struct0.READER.create); + public bool HasList0 => ctx.IsStructFieldNonNull(0); public IReadOnlyList List1 => ctx.ReadList(1).Cast(Capnproto_test.Capnp.Test.TestLists.Struct1.READER.create); + public bool HasList1 => ctx.IsStructFieldNonNull(1); public IReadOnlyList List8 => ctx.ReadList(2).Cast(Capnproto_test.Capnp.Test.TestLists.Struct8.READER.create); + public bool HasList8 => ctx.IsStructFieldNonNull(2); public IReadOnlyList List16 => ctx.ReadList(3).Cast(Capnproto_test.Capnp.Test.TestLists.Struct16.READER.create); + public bool HasList16 => ctx.IsStructFieldNonNull(3); public IReadOnlyList List32 => ctx.ReadList(4).Cast(Capnproto_test.Capnp.Test.TestLists.Struct32.READER.create); + public bool HasList32 => ctx.IsStructFieldNonNull(4); public IReadOnlyList List64 => ctx.ReadList(5).Cast(Capnproto_test.Capnp.Test.TestLists.Struct64.READER.create); + public bool HasList64 => ctx.IsStructFieldNonNull(5); public IReadOnlyList ListP => ctx.ReadList(6).Cast(Capnproto_test.Capnp.Test.TestLists.StructP.READER.create); + public bool HasListP => ctx.IsStructFieldNonNull(6); public IReadOnlyList> Int32ListList => ctx.ReadList(7).Cast(_0 => _0.RequireList().CastInt()); + public bool HasInt32ListList => ctx.IsStructFieldNonNull(7); public IReadOnlyList> TextListList => ctx.ReadList(8).Cast(_0 => _0.RequireList().CastText2()); + public bool HasTextListList => ctx.IsStructFieldNonNull(8); public IReadOnlyList> StructListList => ctx.ReadList(9).Cast(_0 => _0.RequireList().Cast(Capnproto_test.Capnp.Test.TestAllTypes.READER.create)); + public bool HasStructListList => ctx.IsStructFieldNonNull(9); } public class WRITER : SerializerState @@ -6436,6 +6487,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestLists.READER Lists => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestLists.READER.create); + public bool HasLists => ctx.IsStructFieldNonNull(0); } public class WRITER : SerializerState @@ -6696,6 +6748,7 @@ namespace Capnproto_test.Capnp.Test public WHICH which => (WHICH)ctx.ReadDataUShort(48U, (ushort)0); public string Qux => which == WHICH.Qux ? ctx.ReadText(1, null) : default; public IReadOnlyList Corge => which == WHICH.Corge ? ctx.ReadList(1).CastInt() : default; + public bool HasCorge => ctx.IsStructFieldNonNull(1); public float Grault => which == WHICH.Grault ? ctx.ReadDataFloat(64UL, 0F) : default; } @@ -6857,6 +6910,7 @@ namespace Capnproto_test.Capnp.Test public WHICH which => (WHICH)ctx.ReadDataUShort(96U, (ushort)0); public string Qux => which == WHICH.Qux ? ctx.ReadText(2, null) : default; public IReadOnlyList Corge => which == WHICH.Corge ? ctx.ReadList(2).CastInt() : default; + public bool HasCorge => ctx.IsStructFieldNonNull(2); public float Grault => which == WHICH.Grault ? ctx.ReadDataFloat(128UL, 0F) : default; } @@ -6954,6 +7008,7 @@ namespace Capnproto_test.Capnp.Test public long Old1 => ctx.ReadDataLong(0UL, 0L); public string Old2 => ctx.ReadText(0, null); public Capnproto_test.Capnp.Test.TestOldVersion.READER Old3 => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestOldVersion.READER.create); + public bool HasOld3 => ctx.IsStructFieldNonNull(1); } public class WRITER : SerializerState @@ -7062,6 +7117,7 @@ namespace Capnproto_test.Capnp.Test public long Old1 => ctx.ReadDataLong(0UL, 0L); public string Old2 => ctx.ReadText(0, null); public Capnproto_test.Capnp.Test.TestNewVersion.READER Old3 => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestNewVersion.READER.create); + public bool HasOld3 => ctx.IsStructFieldNonNull(1); public long New1 => ctx.ReadDataLong(64UL, 987L); public string New2 => ctx.ReadText(2, "baz"); } @@ -7633,7 +7689,9 @@ namespace Capnproto_test.Capnp.Test public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public WHICH which => (WHICH)ctx.ReadDataUShort(0U, (ushort)0); public Capnproto_test.Capnp.Test.TestStructUnion.SomeStruct.READER Struct => which == WHICH.Struct ? ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestStructUnion.SomeStruct.READER.create) : default; + public bool HasStruct => ctx.IsStructFieldNonNull(0); public Capnproto_test.Capnp.Test.TestAnyPointer.READER Object => which == WHICH.Object ? ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestAnyPointer.READER.create) : default; + public bool HasObject => ctx.IsStructFieldNonNull(0); } public class WRITER : SerializerState @@ -7790,6 +7848,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public string SomeText => ctx.ReadText(0, null); public IReadOnlyList StructList => ctx.ReadList(1).Cast(Capnproto_test.Capnp.Test.TestPrintInlineStructs.InlineStruct.READER.create); + public bool HasStructList => ctx.IsStructFieldNonNull(1); } public class WRITER : SerializerState @@ -8084,8 +8143,10 @@ namespace Capnproto_test.Capnp.Test public WHICH which => (WHICH)ctx.ReadDataUShort(0U, (ushort)0); public DeserializerState Foo => ctx.StructReadPointer(0); public Capnproto_test.Capnp.Test.TestGenerics.READER Rev => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestGenerics.READER.create); + public bool HasRev => ctx.IsStructFieldNonNull(1); public ug.READER Ug => which == WHICH.Ug ? new ug.READER(ctx) : default; public IReadOnlyList.Inner.READER> List => ctx.ReadList(2).Cast(Capnproto_test.Capnp.Test.TestGenerics.Inner.READER.create); + public bool HasList => ctx.IsStructFieldNonNull(2); } public class WRITER : SerializerState @@ -8328,7 +8389,9 @@ namespace Capnproto_test.Capnp.Test public DeserializerState Bar => ctx.StructReadPointer(0); public DeserializerState Baz => ctx.StructReadPointer(1); public Capnproto_test.Capnp.Test.TestGenerics.Inner.READER InnerBound => ctx.ReadStruct(2, Capnproto_test.Capnp.Test.TestGenerics.Inner.READER.create); + public bool HasInnerBound => ctx.IsStructFieldNonNull(2); public Capnproto_test.Capnp.Test.TestGenerics.Inner.READER InnerUnbound => ctx.ReadStruct(3, Capnproto_test.Capnp.Test.TestGenerics.Inner.READER.create); + public bool HasInnerUnbound => ctx.IsStructFieldNonNull(3); } public class WRITER : SerializerState @@ -8713,6 +8776,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public DeserializerState Qux => ctx.StructReadPointer(0); public Capnproto_test.Capnp.Test.TestGenerics.READER Gen => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestGenerics.READER.create); + public bool HasGen => ctx.IsStructFieldNonNull(1); } public class WRITER : SerializerState @@ -8821,9 +8885,13 @@ namespace Capnproto_test.Capnp.Test public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public DeserializerState Foo => ctx.StructReadPointer(0); public Capnproto_test.Capnp.Test.TestGenerics.Inner.READER Inner => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestGenerics.Inner.READER.create); + public bool HasInner => ctx.IsStructFieldNonNull(1); public Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER Inner2 => ctx.ReadStruct(2, Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER.create); + public bool HasInner2 => ctx.IsStructFieldNonNull(2); public Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER Inner2Bind => ctx.ReadStruct(3, Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER.create); + public bool HasInner2Bind => ctx.IsStructFieldNonNull(3); public Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER Inner2Text => ctx.ReadStruct(4, Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER.create); + public bool HasInner2Text => ctx.IsStructFieldNonNull(4); public DeserializerState RevFoo => ctx.StructReadPointer(5); } @@ -8916,6 +8984,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestGenerics.READER Value => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestGenerics.READER.create); + public bool HasValue => ctx.IsStructFieldNonNull(0); } public class WRITER : SerializerState @@ -8976,6 +9045,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestGenericsWrapper.READER Value => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestGenericsWrapper.READER.create); + public bool HasValue => ctx.IsStructFieldNonNull(0); } public class WRITER : SerializerState @@ -9700,24 +9770,42 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestGenerics.READER Basic => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestGenerics.READER.create); + public bool HasBasic => ctx.IsStructFieldNonNull(0); public Capnproto_test.Capnp.Test.TestGenerics.Inner.READER Inner => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestGenerics.Inner.READER.create); + public bool HasInner => ctx.IsStructFieldNonNull(1); public Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER Inner2 => ctx.ReadStruct(2, Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER.create); + public bool HasInner2 => ctx.IsStructFieldNonNull(2); public Capnproto_test.Capnp.Test.TestGenerics.READER Unspecified => ctx.ReadStruct(3, Capnproto_test.Capnp.Test.TestGenerics.READER.create); + public bool HasUnspecified => ctx.IsStructFieldNonNull(3); public Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER UnspecifiedInner => ctx.ReadStruct(4, Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER.create); + public bool HasUnspecifiedInner => ctx.IsStructFieldNonNull(4); public Capnproto_test.Capnp.Test.TestGenerics.READER Default => ctx.ReadStruct(5, Capnproto_test.Capnp.Test.TestGenerics.READER.create); + public bool HasDefault => ctx.IsStructFieldNonNull(5); public Capnproto_test.Capnp.Test.TestGenerics.Inner.READER DefaultInner => ctx.ReadStruct(6, Capnproto_test.Capnp.Test.TestGenerics.Inner.READER.create); + public bool HasDefaultInner => ctx.IsStructFieldNonNull(6); public Capnproto_test.Capnp.Test.TestUseGenerics.READER DefaultUser => ctx.ReadStruct(7, Capnproto_test.Capnp.Test.TestUseGenerics.READER.create); + public bool HasDefaultUser => ctx.IsStructFieldNonNull(7); public Capnproto_test.Capnp.Test.TestGenericsWrapper.READER Wrapper => ctx.ReadStruct(8, Capnproto_test.Capnp.Test.TestGenericsWrapper.READER.create); + public bool HasWrapper => ctx.IsStructFieldNonNull(8); public Capnproto_test.Capnp.Test.TestGenericsWrapper.READER DefaultWrapper => ctx.ReadStruct(9, Capnproto_test.Capnp.Test.TestGenericsWrapper.READER.create); + public bool HasDefaultWrapper => ctx.IsStructFieldNonNull(9); public Capnproto_test.Capnp.Test.TestGenericsWrapper2.READER DefaultWrapper2 => ctx.ReadStruct(10, Capnproto_test.Capnp.Test.TestGenericsWrapper2.READER.create); + public bool HasDefaultWrapper2 => ctx.IsStructFieldNonNull(10); public Capnproto_test.Capnp.Test.TestAllTypes.READER AliasFoo => ctx.ReadStruct(11, Capnproto_test.Capnp.Test.TestAllTypes.READER.create); + public bool HasAliasFoo => ctx.IsStructFieldNonNull(11); public Capnproto_test.Capnp.Test.TestGenerics.Inner.READER AliasInner => ctx.ReadStruct(12, Capnproto_test.Capnp.Test.TestGenerics.Inner.READER.create); + public bool HasAliasInner => ctx.IsStructFieldNonNull(12); public Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER AliasInner2 => ctx.ReadStruct(13, Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER.create); + public bool HasAliasInner2 => ctx.IsStructFieldNonNull(13); public Capnproto_test.Capnp.Test.TestGenerics.Inner2>.READER AliasInner2Bind => ctx.ReadStruct(14, Capnproto_test.Capnp.Test.TestGenerics.Inner2>.READER.create); + public bool HasAliasInner2Bind => ctx.IsStructFieldNonNull(14); public Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER AliasInner2Text => ctx.ReadStruct(15, Capnproto_test.Capnp.Test.TestGenerics.Inner2.READER.create); + public bool HasAliasInner2Text => ctx.IsStructFieldNonNull(15); public string AliasRev => ctx.ReadText(16, "text"); public Capnproto_test.Capnp.Test.TestGenerics>.UseAliases.READER UseAliases => ctx.ReadStruct(17, Capnproto_test.Capnp.Test.TestGenerics>.UseAliases.READER.create); + public bool HasUseAliases => ctx.IsStructFieldNonNull(17); public Capnproto_test.Capnp.Test.TestGenerics.READER Cap => ctx.ReadStruct(18, Capnproto_test.Capnp.Test.TestGenerics.READER.create); + public bool HasCap => ctx.IsStructFieldNonNull(18); public Capnproto_test.Capnp.Test.TestGenerics>.IInterface> GenericCap => ctx.ReadCap>.IInterface>>(19); } @@ -10414,6 +10502,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestAllTypes.READER S => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestAllTypes.READER.create); + public bool HasS => ctx.IsStructFieldNonNull(0); } public class WRITER : SerializerState @@ -11254,6 +11343,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public string S => ctx.ReadText(0, null); public Capnproto_test.Capnp.Test.TestPipeline.Box.READER OutBox => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestPipeline.Box.READER.create); + public bool HasOutBox => ctx.IsStructFieldNonNull(1); } public class WRITER : SerializerState @@ -11338,6 +11428,7 @@ namespace Capnproto_test.Capnp.Test public Capnproto_test.Capnp.Test.ITestInterface Cap => ctx.ReadCap(0); public DeserializerState Obj => ctx.StructReadPointer(1); public IReadOnlyList List => ctx.ReadCapList(2); + public bool HasList => ctx.IsStructFieldNonNull(2); } public class WRITER : SerializerState @@ -11539,6 +11630,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public string S => ctx.ReadText(0, null); public Capnproto_test.Capnp.Test.TestPipeline.AnyBox.READER OutBox => ctx.ReadStruct(1, Capnproto_test.Capnp.Test.TestPipeline.AnyBox.READER.create); + public bool HasOutBox => ctx.IsStructFieldNonNull(1); } public class WRITER : SerializerState @@ -14978,6 +15070,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestMembrane.IThing Cap => ctx.ReadCap(0); public IReadOnlyList List => ctx.ReadCapList(1); + public bool HasList => ctx.IsStructFieldNonNull(1); } public class WRITER : SerializerState @@ -15044,6 +15137,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public IReadOnlyList List => ctx.ReadList(0).Cast(Capnproto_test.Capnp.Test.TestTransferCap.Element.READER.create); + public bool HasList => ctx.IsStructFieldNonNull(0); } public class WRITER : SerializerState @@ -15828,6 +15922,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator DeserializerState(READER reader) => reader.ctx; public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public Capnproto_test.Capnp.Test.TestSturdyRefHostId.READER HostId => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestSturdyRefHostId.READER.create); + public bool HasHostId => ctx.IsStructFieldNonNull(0); public DeserializerState ObjectId => ctx.StructReadPointer(1); } @@ -16433,6 +16528,7 @@ namespace Capnproto_test.Capnp.Test public WHICH which => (WHICH)ctx.ReadDataUShort(48U, (ushort)0); public badlyNamedGroup.READER BadlyNamedGroup => which == WHICH.BadlyNamedGroup ? new badlyNamedGroup.READER(ctx) : default; public Capnproto_test.Capnp.Test.TestNameAnnotation.NestedStruct.READER Baz => which == WHICH.Baz ? ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestNameAnnotation.NestedStruct.READER.create) : default; + public bool HasBaz => ctx.IsStructFieldNonNull(0); } public class WRITER : SerializerState @@ -16564,6 +16660,7 @@ namespace Capnproto_test.Capnp.Test public static implicit operator READER(DeserializerState ctx) => new READER(ctx); public bool BadNestedFieldName => ctx.ReadDataBool(0UL, false); public Capnproto_test.Capnp.Test.TestNameAnnotation.NestedStruct.READER AnotherBadNestedFieldName => ctx.ReadStruct(0, Capnproto_test.Capnp.Test.TestNameAnnotation.NestedStruct.READER.create); + public bool HasAnotherBadNestedFieldName => ctx.IsStructFieldNonNull(0); } public class WRITER : SerializerState diff --git a/CapnpC.CSharp.Generator.Tests/Util/InlineAssemblyCompiler.cs b/CapnpC.CSharp.Generator.Tests/Util/InlineAssemblyCompiler.cs index 372b3d0..32889d3 100644 --- a/CapnpC.CSharp.Generator.Tests/Util/InlineAssemblyCompiler.cs +++ b/CapnpC.CSharp.Generator.Tests/Util/InlineAssemblyCompiler.cs @@ -31,7 +31,7 @@ namespace CapnpC.CSharp.Generator.Tests.Util "Capnp.Net.Runtime", "bin", "Debug", - "netcoreapp3.0", + "netcoreapp3.1", "Capnp.Net.Runtime.dll")); var parseOptions = CSharpParseOptions.Default; diff --git a/CapnpC.CSharp.Generator/CodeGen/ReaderSnippetGen.cs b/CapnpC.CSharp.Generator/CodeGen/ReaderSnippetGen.cs index 8a800ad..a2f628c 100644 --- a/CapnpC.CSharp.Generator/CodeGen/ReaderSnippetGen.cs +++ b/CapnpC.CSharp.Generator/CodeGen/ReaderSnippetGen.cs @@ -264,6 +264,21 @@ namespace CapnpC.CSharp.Generator.CodeGen creator, null, field.DiscValue.HasValue); } + PropertyDeclarationSyntax MakeHasStructProperty(Field field) + { + var propertyType = _names.Type(Nullability.NonNullable); + var propertyName = "Has" + _names.GetCodeIdentifier(field).ToString(); + + return MakeReadProperty( + propertyType, + propertyName, + nameof(Capnp.DeserializerState.IsStructFieldNonNull), + (int)field.Offset, + null, + null, + false); + } + PropertyDeclarationSyntax MakeReadGroupProperty(Field field) { var type = QualifiedName( @@ -630,6 +645,18 @@ namespace CapnpC.CSharp.Generator.CodeGen } } + PropertyDeclarationSyntax MakeHasValueFieldProperty(Field field) + { + switch (field.Type.Tag) + { + case TypeTag.Struct: + case TypeTag.List: + return MakeHasStructProperty(field); + default: + return null; + } + } + public StructDeclarationSyntax MakeReaderStruct(TypeDefinition def) { var readerDecl = StructDeclaration(_names.ReaderStruct.ToString()).AddModifiers(Public); @@ -653,6 +680,12 @@ namespace CapnpC.CSharp.Generator.CodeGen { readerDecl = readerDecl.AddMembers(propDecl); } + + var hasValueDecl = MakeHasValueFieldProperty(field); + if (hasValueDecl != null) + { + readerDecl = readerDecl.AddMembers(hasValueDecl); + } } return readerDecl; diff --git a/CapnpCompatTest/CapnpCompatTest.vcxproj b/CapnpCompatTest/CapnpCompatTest.vcxproj index 82cc32f..d7edd2e 100644 --- a/CapnpCompatTest/CapnpCompatTest.vcxproj +++ b/CapnpCompatTest/CapnpCompatTest.vcxproj @@ -97,6 +97,12 @@ true ws2_32.lib;capnp.lib;capnp-rpc.lib;kj.lib;kj-async.lib;%(AdditionalDependencies) + + capnp compile -oc++ test.capnp + + + re-compile test.capnp + @@ -112,6 +118,12 @@ Console true + + capnp compile -oc++ test.capnp + + + re-compile test.capnp + @@ -132,6 +144,12 @@ true ws2_32.lib;capnp.lib;capnp-rpc.lib;kj.lib;kj-async.lib;%(AdditionalDependencies) + + capnp compile -oc++ test.capnp + + + re-compile test.capnp + @@ -151,6 +169,12 @@ true true + + capnp compile -oc++ test.capnp + + + re-compile test.capnp + diff --git a/CapnpCompatTest/CapnpCompatTest.vcxproj.filters b/CapnpCompatTest/CapnpCompatTest.vcxproj.filters index c3136b5..64d3d18 100644 --- a/CapnpCompatTest/CapnpCompatTest.vcxproj.filters +++ b/CapnpCompatTest/CapnpCompatTest.vcxproj.filters @@ -21,14 +21,12 @@ Quelldateien + Schema - - Schema - diff --git a/CapnpCompatTest/test.capnp.c++ b/CapnpCompatTest/test.capnp.c++ index 6a0808e..b74ae82 100644 --- a/CapnpCompatTest/test.capnp.c++ +++ b/CapnpCompatTest/test.capnp.c++ @@ -11914,7 +11914,7 @@ static const ::capnp::_::AlignedData<553> b_8e59556fb309253f = { 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 98, 132, 0, 0, + 1, 0, 0, 0, 106, 132, 0, 0, 40, 118, 111, 105, 100, 70, 105, 101, 108, 100, 32, 61, 32, 118, 111, 105, 100, 44, 32, 98, 111, 111, 108, 70, @@ -12444,7 +12444,7 @@ static const ::capnp::_::AlignedData<553> b_8e59556fb309253f = { 32, 101, 110, 117, 109, 76, 105, 115, 116, 32, 61, 32, 91, 102, 111, 111, 44, 32, 103, 97, 114, 112, 108, 121, - 93, 41, 10, 0, 0, 0, 0, 0, } + 93, 41, 13, 10, 0, 0, 0, 0, } }; ::capnp::word const* const bp_8e59556fb309253f = b_8e59556fb309253f.words; #if !CAPNP_LITE @@ -18930,7 +18930,7 @@ constexpr ::capnp::_::RawSchema const* TestGenericsWrapper2::_capnpPrivate::sche "test.capnp:TestImplicitMethodParams", "call", 0x8b9717a3f8d85a9aull, 0); } -::kj::Promise TestImplicitMethodParams::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestImplicitMethodParams::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -18940,13 +18940,16 @@ constexpr ::capnp::_::RawSchema const* TestGenericsWrapper2::_capnpPrivate::sche return internalUnimplemented("test.capnp:TestImplicitMethodParams", interfaceId); } } -::kj::Promise TestImplicitMethodParams::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestImplicitMethodParams::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return call(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestImplicitMethodParams::CallParams<>, ::capnproto_test::capnp::test::TestGenerics< ::capnp::AnyPointer, ::capnp::AnyPointer>>(context)); + return { + call(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestImplicitMethodParams::CallParams<>, ::capnproto_test::capnp::test::TestGenerics< ::capnp::AnyPointer, ::capnp::AnyPointer>>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -19044,7 +19047,7 @@ const ::capnp::_::ConstStruct< ::capnproto_test::capnp::test::TestPrintInlineStr const ::capnp::_::ConstStruct< ::capnproto_test::capnp::test::TestAllTypes> DERIVED_CONSTANT(::capnp::schemas::b_a4764c3483341eeb.words + 23); const ::capnp::_::ConstStruct< ::capnproto_test::capnp::test::TestGenerics< ::capnproto_test::capnp::test::TestAllTypes, ::capnp::Text>> GENERIC_CONSTANT(::capnp::schemas::b_b70341f0dafa28ef.words + 41); const ::capnp::_::ConstData<831> EMBEDDED_DATA(::capnp::schemas::b_d7c0fea759d6a0cf.words + 23); -const ::capnp::_::ConstText<4235> EMBEDDED_TEXT(::capnp::schemas::b_8e59556fb309253f.words + 23); +const ::capnp::_::ConstText<4236> EMBEDDED_TEXT(::capnp::schemas::b_8e59556fb309253f.words + 23); const ::capnp::_::ConstStruct< ::capnproto_test::capnp::test::TestAllTypes> EMBEDDED_STRUCT(::capnp::schemas::b_dec09c6791841ebb.words + 23); const ::capnp::_::ConstText<10> NON_ASCII_TEXT(::capnp::schemas::b_fb7ed666617fb649.words + 23); // TestAnyPointerConstants @@ -19087,7 +19090,7 @@ TestInterface::Client::bazRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) { "test.capnp:TestInterface", "baz", 0x88eb12a0e0af92b2ull, 2); } -::kj::Promise TestInterface::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestInterface::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19097,19 +19100,28 @@ TestInterface::Client::bazRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) { return internalUnimplemented("test.capnp:TestInterface", interfaceId); } } -::kj::Promise TestInterface::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestInterface::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return foo(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestInterface::FooParams, ::capnproto_test::capnp::test::TestInterface::FooResults>(context)); + return { + foo(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestInterface::FooParams, ::capnproto_test::capnp::test::TestInterface::FooResults>(context)), + false + }; case 1: - return bar(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestInterface::BarParams, ::capnproto_test::capnp::test::TestInterface::BarResults>(context)); + return { + bar(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestInterface::BarParams, ::capnproto_test::capnp::test::TestInterface::BarResults>(context)), + false + }; case 2: - return baz(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestInterface::BazParams, ::capnproto_test::capnp::test::TestInterface::BazResults>(context)); + return { + baz(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestInterface::BazParams, ::capnproto_test::capnp::test::TestInterface::BazResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -19204,7 +19216,7 @@ TestExtends::Client::graultRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) "test.capnp:TestExtends", "grault", 0xe4e9bac98670b748ull, 2); } -::kj::Promise TestExtends::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestExtends::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19216,19 +19228,28 @@ TestExtends::Client::graultRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) return internalUnimplemented("test.capnp:TestExtends", interfaceId); } } -::kj::Promise TestExtends::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestExtends::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return qux(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestExtends::QuxParams, ::capnproto_test::capnp::test::TestExtends::QuxResults>(context)); + return { + qux(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestExtends::QuxParams, ::capnproto_test::capnp::test::TestExtends::QuxResults>(context)), + false + }; case 1: - return corge(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestAllTypes, ::capnproto_test::capnp::test::TestExtends::CorgeResults>(context)); + return { + corge(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestAllTypes, ::capnproto_test::capnp::test::TestExtends::CorgeResults>(context)), + false + }; case 2: - return grault(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestExtends::GraultParams, ::capnproto_test::capnp::test::TestAllTypes>(context)); + return { + grault(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestExtends::GraultParams, ::capnproto_test::capnp::test::TestAllTypes>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -19277,7 +19298,7 @@ constexpr ::capnp::_::RawSchema const* TestExtends::GraultParams::_capnpPrivate: #endif // !CAPNP_LITE #if !CAPNP_LITE -::kj::Promise TestExtends2::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestExtends2::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19291,7 +19312,7 @@ constexpr ::capnp::_::RawSchema const* TestExtends::GraultParams::_capnpPrivate: return internalUnimplemented("test.capnp:TestExtends2", interfaceId); } } -::kj::Promise TestExtends2::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestExtends2::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { @@ -19341,7 +19362,7 @@ TestPipeline::Client::getAnyCapRequest(::kj::Maybe< ::capnp::MessageSize> sizeHi "test.capnp:TestPipeline", "getAnyCap", 0xa5a404caa61d4cd0ull, 2); } -::kj::Promise TestPipeline::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestPipeline::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19351,19 +19372,28 @@ TestPipeline::Client::getAnyCapRequest(::kj::Maybe< ::capnp::MessageSize> sizeHi return internalUnimplemented("test.capnp:TestPipeline", interfaceId); } } -::kj::Promise TestPipeline::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestPipeline::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return getCap(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestPipeline::GetCapParams, ::capnproto_test::capnp::test::TestPipeline::GetCapResults>(context)); + return { + getCap(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestPipeline::GetCapParams, ::capnproto_test::capnp::test::TestPipeline::GetCapResults>(context)), + false + }; case 1: - return testPointers(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestPipeline::TestPointersParams, ::capnproto_test::capnp::test::TestPipeline::TestPointersResults>(context)); + return { + testPointers(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestPipeline::TestPointersParams, ::capnproto_test::capnp::test::TestPipeline::TestPointersResults>(context)), + false + }; case 2: - return getAnyCap(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestPipeline::GetAnyCapParams, ::capnproto_test::capnp::test::TestPipeline::GetAnyCapResults>(context)); + return { + getAnyCap(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestPipeline::GetAnyCapParams, ::capnproto_test::capnp::test::TestPipeline::GetAnyCapResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -19454,7 +19484,7 @@ TestCallOrder::Client::getCallSequenceRequest(::kj::Maybe< ::capnp::MessageSize> "test.capnp:TestCallOrder", "getCallSequence", 0xa0e77035bdff0051ull, 0); } -::kj::Promise TestCallOrder::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestCallOrder::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19464,13 +19494,16 @@ TestCallOrder::Client::getCallSequenceRequest(::kj::Maybe< ::capnp::MessageSize> return internalUnimplemented("test.capnp:TestCallOrder", interfaceId); } } -::kj::Promise TestCallOrder::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestCallOrder::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return getCallSequence(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestCallOrder::GetCallSequenceParams, ::capnproto_test::capnp::test::TestCallOrder::GetCallSequenceResults>(context)); + return { + getCallSequence(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestCallOrder::GetCallSequenceParams, ::capnproto_test::capnp::test::TestCallOrder::GetCallSequenceResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -19513,7 +19546,7 @@ TestTailCallee::Client::fooRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) "test.capnp:TestTailCallee", "foo", 0xddd699207eb8e23bull, 0); } -::kj::Promise TestTailCallee::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestTailCallee::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19523,13 +19556,16 @@ TestTailCallee::Client::fooRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) return internalUnimplemented("test.capnp:TestTailCallee", interfaceId); } } -::kj::Promise TestTailCallee::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestTailCallee::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return foo(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestTailCallee::FooParams, ::capnproto_test::capnp::test::TestTailCallee::TailResult>(context)); + return { + foo(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestTailCallee::FooParams, ::capnproto_test::capnp::test::TestTailCallee::TailResult>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -19572,7 +19608,7 @@ TestTailCaller::Client::fooRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) "test.capnp:TestTailCaller", "foo", 0x870bf40110ce3035ull, 0); } -::kj::Promise TestTailCaller::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestTailCaller::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19582,13 +19618,16 @@ TestTailCaller::Client::fooRequest(::kj::Maybe< ::capnp::MessageSize> sizeHint) return internalUnimplemented("test.capnp:TestTailCaller", interfaceId); } } -::kj::Promise TestTailCaller::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestTailCaller::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return foo(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestTailCaller::FooParams, ::capnproto_test::capnp::test::TestTailCallee::TailResult>(context)); + return { + foo(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestTailCaller::FooParams, ::capnproto_test::capnp::test::TestTailCallee::TailResult>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -19613,7 +19652,7 @@ constexpr ::capnp::_::RawSchema const* TestTailCaller::FooParams::_capnpPrivate: #endif // !CAPNP_LITE #if !CAPNP_LITE -::kj::Promise TestHandle::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestHandle::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19623,7 +19662,7 @@ constexpr ::capnp::_::RawSchema const* TestTailCaller::FooParams::_capnpPrivate: return internalUnimplemented("test.capnp:TestHandle", interfaceId); } } -::kj::Promise TestHandle::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestHandle::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { @@ -19773,7 +19812,7 @@ TestMoreStuff::Client::methodWithNullDefaultRequest(::kj::Maybe< ::capnp::Messag "test.capnp:TestMoreStuff", "methodWithNullDefault", 0xddc70bf9784133cfull, 12); } -::kj::Promise TestMoreStuff::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestMoreStuff::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -19785,49 +19824,88 @@ TestMoreStuff::Client::methodWithNullDefaultRequest(::kj::Maybe< ::capnp::Messag return internalUnimplemented("test.capnp:TestMoreStuff", interfaceId); } } -::kj::Promise TestMoreStuff::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestMoreStuff::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return callFoo(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::CallFooParams, ::capnproto_test::capnp::test::TestMoreStuff::CallFooResults>(context)); + return { + callFoo(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::CallFooParams, ::capnproto_test::capnp::test::TestMoreStuff::CallFooResults>(context)), + false + }; case 1: - return callFooWhenResolved(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::CallFooWhenResolvedParams, ::capnproto_test::capnp::test::TestMoreStuff::CallFooWhenResolvedResults>(context)); + return { + callFooWhenResolved(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::CallFooWhenResolvedParams, ::capnproto_test::capnp::test::TestMoreStuff::CallFooWhenResolvedResults>(context)), + false + }; case 2: - return neverReturn(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::NeverReturnParams, ::capnproto_test::capnp::test::TestMoreStuff::NeverReturnResults>(context)); + return { + neverReturn(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::NeverReturnParams, ::capnproto_test::capnp::test::TestMoreStuff::NeverReturnResults>(context)), + false + }; case 3: - return hold(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::HoldParams, ::capnproto_test::capnp::test::TestMoreStuff::HoldResults>(context)); + return { + hold(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::HoldParams, ::capnproto_test::capnp::test::TestMoreStuff::HoldResults>(context)), + false + }; case 4: - return callHeld(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::CallHeldParams, ::capnproto_test::capnp::test::TestMoreStuff::CallHeldResults>(context)); + return { + callHeld(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::CallHeldParams, ::capnproto_test::capnp::test::TestMoreStuff::CallHeldResults>(context)), + false + }; case 5: - return getHeld(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::GetHeldParams, ::capnproto_test::capnp::test::TestMoreStuff::GetHeldResults>(context)); + return { + getHeld(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::GetHeldParams, ::capnproto_test::capnp::test::TestMoreStuff::GetHeldResults>(context)), + false + }; case 6: - return echo(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::EchoParams, ::capnproto_test::capnp::test::TestMoreStuff::EchoResults>(context)); + return { + echo(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::EchoParams, ::capnproto_test::capnp::test::TestMoreStuff::EchoResults>(context)), + false + }; case 7: - return expectCancel(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::ExpectCancelParams, ::capnproto_test::capnp::test::TestMoreStuff::ExpectCancelResults>(context)); + return { + expectCancel(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::ExpectCancelParams, ::capnproto_test::capnp::test::TestMoreStuff::ExpectCancelResults>(context)), + false + }; case 8: - return methodWithDefaults(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::MethodWithDefaultsParams, ::capnproto_test::capnp::test::TestMoreStuff::MethodWithDefaultsResults>(context)); + return { + methodWithDefaults(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::MethodWithDefaultsParams, ::capnproto_test::capnp::test::TestMoreStuff::MethodWithDefaultsResults>(context)), + false + }; case 9: - return getHandle(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::GetHandleParams, ::capnproto_test::capnp::test::TestMoreStuff::GetHandleResults>(context)); + return { + getHandle(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::GetHandleParams, ::capnproto_test::capnp::test::TestMoreStuff::GetHandleResults>(context)), + false + }; case 10: - return getNull(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::GetNullParams, ::capnproto_test::capnp::test::TestMoreStuff::GetNullResults>(context)); + return { + getNull(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::GetNullParams, ::capnproto_test::capnp::test::TestMoreStuff::GetNullResults>(context)), + false + }; case 11: - return getEnormousString(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::GetEnormousStringParams, ::capnproto_test::capnp::test::TestMoreStuff::GetEnormousStringResults>(context)); + return { + getEnormousString(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::GetEnormousStringParams, ::capnproto_test::capnp::test::TestMoreStuff::GetEnormousStringResults>(context)), + false + }; case 12: - return methodWithNullDefault(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMoreStuff::MethodWithNullDefaultParams, ::capnproto_test::capnp::test::TestMoreStuff::MethodWithNullDefaultResults>(context)); + return { + methodWithNullDefault(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMoreStuff::MethodWithNullDefaultParams, ::capnproto_test::capnp::test::TestMoreStuff::MethodWithNullDefaultResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -20102,7 +20180,7 @@ TestMembrane::Client::waitForeverRequest(::kj::Maybe< ::capnp::MessageSize> size "test.capnp:TestMembrane", "waitForever", 0xc07d8dcd80a69c0cull, 4); } -::kj::Promise TestMembrane::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestMembrane::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -20112,25 +20190,40 @@ TestMembrane::Client::waitForeverRequest(::kj::Maybe< ::capnp::MessageSize> size return internalUnimplemented("test.capnp:TestMembrane", interfaceId); } } -::kj::Promise TestMembrane::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestMembrane::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return makeThing(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMembrane::MakeThingParams, ::capnproto_test::capnp::test::TestMembrane::MakeThingResults>(context)); + return { + makeThing(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMembrane::MakeThingParams, ::capnproto_test::capnp::test::TestMembrane::MakeThingResults>(context)), + false + }; case 1: - return callPassThrough(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMembrane::CallPassThroughParams, ::capnproto_test::capnp::test::TestMembrane::Result>(context)); + return { + callPassThrough(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMembrane::CallPassThroughParams, ::capnproto_test::capnp::test::TestMembrane::Result>(context)), + false + }; case 2: - return callIntercept(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMembrane::CallInterceptParams, ::capnproto_test::capnp::test::TestMembrane::Result>(context)); + return { + callIntercept(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMembrane::CallInterceptParams, ::capnproto_test::capnp::test::TestMembrane::Result>(context)), + false + }; case 3: - return loopback(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMembrane::LoopbackParams, ::capnproto_test::capnp::test::TestMembrane::LoopbackResults>(context)); + return { + loopback(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMembrane::LoopbackParams, ::capnproto_test::capnp::test::TestMembrane::LoopbackResults>(context)), + false + }; case 4: - return waitForever(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMembrane::WaitForeverParams, ::capnproto_test::capnp::test::TestMembrane::WaitForeverResults>(context)); + return { + waitForever(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMembrane::WaitForeverParams, ::capnproto_test::capnp::test::TestMembrane::WaitForeverResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -20167,7 +20260,7 @@ TestMembrane::Thing::Client::interceptRequest(::kj::Maybe< ::capnp::MessageSize> "test.capnp:TestMembrane.Thing", "intercept", 0x9352e4e41f173917ull, 1); } -::kj::Promise TestMembrane::Thing::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestMembrane::Thing::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -20177,16 +20270,22 @@ TestMembrane::Thing::Client::interceptRequest(::kj::Maybe< ::capnp::MessageSize> return internalUnimplemented("test.capnp:TestMembrane.Thing", interfaceId); } } -::kj::Promise TestMembrane::Thing::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestMembrane::Thing::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return passThrough(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMembrane::Thing::PassThroughParams, ::capnproto_test::capnp::test::TestMembrane::Result>(context)); + return { + passThrough(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMembrane::Thing::PassThroughParams, ::capnproto_test::capnp::test::TestMembrane::Result>(context)), + false + }; case 1: - return intercept(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestMembrane::Thing::InterceptParams, ::capnproto_test::capnp::test::TestMembrane::Result>(context)); + return { + intercept(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestMembrane::Thing::InterceptParams, ::capnproto_test::capnp::test::TestMembrane::Result>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -20355,7 +20454,7 @@ TestKeywordMethods::Client::returnRequest(::kj::Maybe< ::capnp::MessageSize> siz "test.capnp:TestKeywordMethods", "return", 0x9ae342d394247cfcull, 3); } -::kj::Promise TestKeywordMethods::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestKeywordMethods::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -20365,22 +20464,34 @@ TestKeywordMethods::Client::returnRequest(::kj::Maybe< ::capnp::MessageSize> siz return internalUnimplemented("test.capnp:TestKeywordMethods", interfaceId); } } -::kj::Promise TestKeywordMethods::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestKeywordMethods::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return delete_(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestKeywordMethods::DeleteParams, ::capnproto_test::capnp::test::TestKeywordMethods::DeleteResults>(context)); + return { + delete_(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestKeywordMethods::DeleteParams, ::capnproto_test::capnp::test::TestKeywordMethods::DeleteResults>(context)), + false + }; case 1: - return class_(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestKeywordMethods::ClassParams, ::capnproto_test::capnp::test::TestKeywordMethods::ClassResults>(context)); + return { + class_(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestKeywordMethods::ClassParams, ::capnproto_test::capnp::test::TestKeywordMethods::ClassResults>(context)), + false + }; case 2: - return void_(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestKeywordMethods::VoidParams, ::capnproto_test::capnp::test::TestKeywordMethods::VoidResults>(context)); + return { + void_(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestKeywordMethods::VoidParams, ::capnproto_test::capnp::test::TestKeywordMethods::VoidResults>(context)), + false + }; case 3: - return return_(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::TestKeywordMethods::ReturnParams, ::capnproto_test::capnp::test::TestKeywordMethods::ReturnResults>(context)); + return { + return_(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::TestKeywordMethods::ReturnParams, ::capnproto_test::capnp::test::TestKeywordMethods::ReturnResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -20559,7 +20670,7 @@ RenamedInterface::Client::renamedMethodRequest(::kj::Maybe< ::capnp::MessageSize "test.capnp:TestNameAnnotationInterface", "renamedMethod", 0xd112a69d31ed918bull, 0); } -::kj::Promise RenamedInterface::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult RenamedInterface::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -20569,13 +20680,16 @@ RenamedInterface::Client::renamedMethodRequest(::kj::Maybe< ::capnp::MessageSize return internalUnimplemented("test.capnp:TestNameAnnotationInterface", interfaceId); } } -::kj::Promise RenamedInterface::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult RenamedInterface::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return renamedMethod(::capnp::Capability::Server::internalGetTypedContext< - ::capnproto_test::capnp::test::RenamedInterface::RenamedMethodParams, ::capnproto_test::capnp::test::RenamedInterface::RenamedMethodResults>(context)); + return { + renamedMethod(::capnp::Capability::Server::internalGetTypedContext< + ::capnproto_test::capnp::test::RenamedInterface::RenamedMethodParams, ::capnproto_test::capnp::test::RenamedInterface::RenamedMethodResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( diff --git a/CapnpCompatTest/test.capnp.h b/CapnpCompatTest/test.capnp.h index cb19809..4e452b8 100644 --- a/CapnpCompatTest/test.capnp.h +++ b/CapnpCompatTest/test.capnp.h @@ -9,7 +9,7 @@ #include #endif // !CAPNP_LITE -#if CAPNP_VERSION != 7000 +#if CAPNP_VERSION != 8000 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif @@ -1809,7 +1809,7 @@ extern const ::capnp::_::ConstStruct< ::capnproto_test::capnp::test::TestPrintIn extern const ::capnp::_::ConstStruct< ::capnproto_test::capnp::test::TestAllTypes> DERIVED_CONSTANT; extern const ::capnp::_::ConstStruct< ::capnproto_test::capnp::test::TestGenerics< ::capnproto_test::capnp::test::TestAllTypes, ::capnp::Text>> GENERIC_CONSTANT; extern const ::capnp::_::ConstData<831> EMBEDDED_DATA; -extern const ::capnp::_::ConstText<4235> EMBEDDED_TEXT; +extern const ::capnp::_::ConstText<4236> EMBEDDED_TEXT; extern const ::capnp::_::ConstStruct< ::capnproto_test::capnp::test::TestAllTypes> EMBEDDED_STRUCT; extern const ::capnp::_::ConstText<10> NON_ASCII_TEXT; struct TestAnyPointerConstants { @@ -10378,7 +10378,8 @@ class TestGenerics::Inner2::DeepNest::DeepNestInterface dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -10393,7 +10394,8 @@ protected: .template castAs::template Inner2::template DeepNest::template DeepNestInterface>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -10689,7 +10691,8 @@ class TestGenerics::Interface::Server public: typedef Interface Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -10703,7 +10706,8 @@ protected: .template castAs::template Interface>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -11278,7 +11282,8 @@ class TestImplicitMethodParams::Server public: typedef TestImplicitMethodParams Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -11292,7 +11297,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestImplicitMethodParams>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -11444,7 +11450,8 @@ class TestImplicitMethodParamsInGeneric::Server public: typedef TestImplicitMethodParamsInGeneric Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -11458,7 +11465,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestImplicitMethodParamsInGeneric>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -12279,7 +12287,8 @@ class TestInterface::Server public: typedef TestInterface Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -12302,7 +12311,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestInterface>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -12801,7 +12811,8 @@ class TestExtends::Server public: typedef TestExtends Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -12822,7 +12833,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestExtends>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -13142,7 +13154,8 @@ class TestExtends2::Server public: typedef TestExtends2 Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -13153,7 +13166,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestExtends2>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -13193,7 +13207,8 @@ class TestPipeline::Server public: typedef TestPipeline Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -13216,7 +13231,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestPipeline>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -13968,7 +13984,8 @@ class TestCallOrder::Server public: typedef TestCallOrder Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -13983,7 +14000,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestCallOrder>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -14171,7 +14189,8 @@ class TestTailCallee::Server public: typedef TestTailCallee Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -14185,7 +14204,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestTailCallee>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -14408,7 +14428,8 @@ class TestTailCaller::Server public: typedef TestTailCaller Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -14422,7 +14443,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestTailCaller>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -14547,7 +14569,8 @@ class TestHandle::Server public: typedef TestHandle Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -14558,7 +14581,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestHandle>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -14620,7 +14644,8 @@ class TestMoreStuff::Server public: typedef TestMoreStuff Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -14683,7 +14708,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestMoreStuff>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -16848,7 +16874,8 @@ class TestMembrane::Server public: typedef TestMembrane Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -16877,7 +16904,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestMembrane>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -16915,7 +16943,8 @@ class TestMembrane::Thing::Server public: typedef Thing Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -16932,7 +16961,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestMembrane::Thing>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -18127,7 +18157,8 @@ class TestKeywordMethods::Server public: typedef TestKeywordMethods Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -18154,7 +18185,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestKeywordMethods>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -18765,7 +18797,8 @@ class TestAuthenticatedBootstrap::Server public: typedef TestAuthenticatedBootstrap Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -18780,7 +18813,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::TestAuthenticatedBootstrap>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -19884,7 +19918,8 @@ class RenamedInterface::Server public: typedef RenamedInterface Serves; - ::kj::Promise dispatchCall(uint64_t interfaceId, uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCall( + uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) override; @@ -19899,7 +19934,8 @@ protected: .template castAs< ::capnproto_test::capnp::test::RenamedInterface>(); } - ::kj::Promise dispatchCallInternal(uint16_t methodId, + ::capnp::Capability::Server::DispatchCallResult dispatchCallInternal( + uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context); }; #endif // !CAPNP_LITE @@ -28487,7 +28523,7 @@ template template template template -::kj::Promise TestGenerics::Inner2::DeepNest::DeepNestInterface::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestGenerics::Inner2::DeepNest::DeepNestInterface::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -28501,13 +28537,16 @@ template template template template -::kj::Promise TestGenerics::Inner2::DeepNest::DeepNestInterface::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestGenerics::Inner2::DeepNest::DeepNestInterface::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return call(::capnp::Capability::Server::internalGetTypedContext< - typename ::capnproto_test::capnp::test::TestGenerics::template Inner2::template DeepNest::template DeepNestInterface::CallParams, typename ::capnproto_test::capnp::test::TestGenerics::template Inner2::template DeepNest::template DeepNestInterface::CallResults>(context)); + return { + call(::capnp::Capability::Server::internalGetTypedContext< + typename ::capnproto_test::capnp::test::TestGenerics::template Inner2::template DeepNest::template DeepNestInterface::CallParams, typename ::capnproto_test::capnp::test::TestGenerics::template Inner2::template DeepNest::template DeepNestInterface::CallResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -28867,7 +28906,7 @@ template } template template -::kj::Promise TestGenerics::Interface::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestGenerics::Interface::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -28879,13 +28918,16 @@ template } template template -::kj::Promise TestGenerics::Interface::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestGenerics::Interface::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return call(::capnp::Capability::Server::internalGetTypedContext< - typename ::capnproto_test::capnp::test::TestGenerics::template Inner2< ::capnp::Text>, typename ::capnproto_test::capnp::test::TestGenerics::template Interface::CallResults>(context)); + return { + call(::capnp::Capability::Server::internalGetTypedContext< + typename ::capnproto_test::capnp::test::TestGenerics::template Inner2< ::capnp::Text>, typename ::capnproto_test::capnp::test::TestGenerics::template Interface::CallResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -29831,7 +29873,7 @@ template 0xdf9ccdeb81a704c9ull, 0); } template -::kj::Promise TestImplicitMethodParamsInGeneric::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestImplicitMethodParamsInGeneric::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -29842,13 +29884,16 @@ template } } template -::kj::Promise TestImplicitMethodParamsInGeneric::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestImplicitMethodParamsInGeneric::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return call(::capnp::Capability::Server::internalGetTypedContext< - typename ::capnproto_test::capnp::test::TestImplicitMethodParamsInGeneric::template CallParams<>, ::capnproto_test::capnp::test::TestGenerics< ::capnp::AnyPointer, ::capnp::AnyPointer>>(context)); + return { + call(::capnp::Capability::Server::internalGetTypedContext< + typename ::capnproto_test::capnp::test::TestImplicitMethodParamsInGeneric::template CallParams<>, ::capnproto_test::capnp::test::TestGenerics< ::capnp::AnyPointer, ::capnp::AnyPointer>>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( @@ -33401,7 +33446,7 @@ template 0xea72cc77253798cdull, 0); } template -::kj::Promise TestAuthenticatedBootstrap::Server::dispatchCall( +::capnp::Capability::Server::DispatchCallResult TestAuthenticatedBootstrap::Server::dispatchCall( uint64_t interfaceId, uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (interfaceId) { @@ -33412,13 +33457,16 @@ template } } template -::kj::Promise TestAuthenticatedBootstrap::Server::dispatchCallInternal( +::capnp::Capability::Server::DispatchCallResult TestAuthenticatedBootstrap::Server::dispatchCallInternal( uint16_t methodId, ::capnp::CallContext< ::capnp::AnyPointer, ::capnp::AnyPointer> context) { switch (methodId) { case 0: - return getCallerId(::capnp::Capability::Server::internalGetTypedContext< - typename ::capnproto_test::capnp::test::TestAuthenticatedBootstrap::GetCallerIdParams, typename ::capnproto_test::capnp::test::TestAuthenticatedBootstrap::GetCallerIdResults>(context)); + return { + getCallerId(::capnp::Capability::Server::internalGetTypedContext< + typename ::capnproto_test::capnp::test::TestAuthenticatedBootstrap::GetCallerIdParams, typename ::capnproto_test::capnp::test::TestAuthenticatedBootstrap::GetCallerIdResults>(context)), + false + }; default: (void)context; return ::capnp::Capability::Server::internalUnimplemented( diff --git a/Directory.Build.props b/Directory.Build.props index f482dd2..724fde8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,8 @@  - diff --git a/appveyor.yml b/appveyor.yml index 0496dc8..a09b196 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,8 +9,10 @@ install: - cd c:\tools\vcpkg - vcpkg integrate install - vcpkg install capnproto + - set PATH_COPY=%PATH% + - set PATH=%PATH%;c:\tools\vcpkg\installed\x86-windows\tools\capnproto - cd %APPVEYOR_BUILD_FOLDER% - - dotnet tool install -g nbgv + - dotnet tool install -g nbgv --version 3.4.240 - choco install reportgenerator.portable --version=4.5.6 --force -y - dotnet tool install -g coveralls.net --version 1.0.0 init: @@ -32,10 +34,10 @@ before_build: - cmd: dotnet restore ./CapnpC.CSharp.MsBuild.Generation.Tests/CapnpC.CSharp.MsBuild.Generation.Tests.csproj --verbosity m - cmd: dotnet restore ./capnpc-csharp/capnpc-csharp.csproj --verbosity m build_script: - - cmd: msbuild ./Capnp.Net.sln /p:Configuration="Debug" - - cmd: msbuild ./Capnp.Net.sln /p:Configuration="Release" - - cmd: msbuild ./CapnpCompatTest.sln /p:Configuration="Debug" - - cmd: msbuild ./CapnpCompatTest.sln /p:Configuration="Release" + - cmd: msbuild ./Capnp.Net.sln /p:Configuration="Debug" -V:m + - cmd: msbuild ./Capnp.Net.sln /p:Configuration="Release" -V:m + - cmd: msbuild ./CapnpCompatTest.sln /p:Configuration="Debug" -V:m + - cmd: msbuild ./CapnpCompatTest.sln /p:Configuration="Release" -V:m - ps: scripts\capnpc-csharp-pack.ps1 after_build: # For once the build has completed @@ -60,10 +62,9 @@ artifacts: type: zip test_script: - cmd: | - nbgv get-version -v NuGetPackageVersion >> version.txt - set /P VERSION=< version.txt + nbgv get-version -v NuGetPackageVersion >> myversion.txt + set /P VERSION=< myversion.txt vstest.console /logger:Appveyor /inIsolation CapnpC.CSharp.Generator.Tests\bin\Release\netcoreapp3.1\CapnpC.CSharp.Generator.Tests.dll - choco install capnproto --source="https://chocolatey.org/api/v2" --force -y cd %APPVEYOR_BUILD_FOLDER%\capnpc-csharp dotnet tool install --global --add-source ./nupkg capnpc-csharp --version %VERSION% cd %APPVEYOR_BUILD_FOLDER%\install-test @@ -74,6 +75,7 @@ test_script: cd %APPVEYOR_BUILD_FOLDER%\install-test notinstalled-test cd %APPVEYOR_BUILD_FOLDER%\chocolatey\install + choco install capnproto --source="https://chocolatey.org/api/v2" --force -y choco install capnpc-csharp-win-x86 --source=".;https://chocolatey.org/api/v2" --force -y --version %VERSION% --pre cd %APPVEYOR_BUILD_FOLDER%\install-test compile-test diff --git a/scripts/capnpc-csharp-pack.ps1 b/scripts/capnpc-csharp-pack.ps1 index 6aadac5..e14cb5f 100644 --- a/scripts/capnpc-csharp-pack.ps1 +++ b/scripts/capnpc-csharp-pack.ps1 @@ -8,8 +8,8 @@ $csprojDir = "$scriptDir\..\capnpc-csharp" $csprojFile = "capnpc-csharp.csproj" $installDir = "$chocoDir\install" -dotnet build -c Release "$scriptDir\..\Capnp.Net.sln" -dotnet publish -c Release -r win-x86 --self-contained -o "$chocoDir\$id_win_x86\bin" "$csprojDir\$csprojFile" +dotnet build -c Release "$scriptDir\..\Capnp.Net.sln" --verbosity m +dotnet publish -c Release -r win-x86 --self-contained -o "$chocoDir\$id_win_x86\bin" "$csprojDir\$csprojFile" --verbosity m # dotnet publish -c Release -o "$chocoDir\$id\bin" "$csprojDir\$csprojFile" If(!(test-path $installDir))