Permalink
Browse files

0.2.0

  • Loading branch information...
1 parent b5c1a04 commit 3a1419f4d60bbcfb29289a810a92c4c3c8e0b083 @neuecc committed Dec 15, 2016
View
@@ -1,12 +1,12 @@
MagicOnion
===
-gRPC based HTTP2 RPC Streaming Framework for .NET, .NET Core and Unity.
+gRPC based HTTP/2 RPC Streaming Framework for .NET, .NET Core and Unity.
Work in progress, stay tuned.
Quick Start
---
-alpha-version is available in NuGet(Currently only work on .NET 4.5, .NET Core and Unity is not yet)
+alpha-version is available in NuGet(Currently only work on .NET 4.5, .NET Core is not yet, Unity supports see [Unity Supports](https://github.com/neuecc/MagicOnion#unity-supports) section)
* Install-Package MagicOnion -Pre
@@ -254,3 +254,22 @@ static async Task DuplexStreamRun(IMyFirstService client)
});
}
```
+
+Unity Supports
+---
+Code is located in `src/MagicOnion.Client.Unity/Assets/Scripts/gRPC` (port of Grpc.Core) and `src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion` (MagicOnion Runtime). There are require [ZeroFormatter](https://github.com/neuecc/ZeroFormatter) and [UniRx](https://github.com/neuecc/UniRx).
+
+MagicOnion's Unity client works on all platforms(PC, Android, iOS, etc...). But it can 'not' use dynamic client generation due to IL2CPP issue. But pre code generate helps it. `moc.exe`is using Roslyn so analyze source code, pass the target csproj.
+
+```
+moc arguments help:
+ -i, --input=VALUE [required]Input path of analyze csproj
+ -o, --output=VALUE [required]Output path(file) or directory base(in separated mode)
+ -s, --separate [optional, default=false]Output files are separated
+ -u, --unuseunityattr [optional, default=false]Unuse UnityEngine's RuntimeInitializeOnLoadMethodAttribute on MagicOnionInitializer
+ -c, --conditionalsymbol=VALUE [optional, default=empty]conditional compiler symbol
+ -r, --resolvername=VALUE [optional, default=DefaultResolver]Register CustomSerializer target
+ -n, --namespace=VALUE [optional, default=MagicOnion]Set namespace root name
+```
+
+moc.exe is located in `packages\MagicOnion.*.*.*\tools\moc.exe`.
View
@@ -0,0 +1 @@
+libz inject-dll --assembly src\MagicOnion.CodeGenerator\bin\Release\moc.exe --include src\MagicOnion.CodeGenerator\bin\Release\*.dll --move
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MagicOnion</id>
- <version>0.1.0-alpha</version>
+ <version>0.2.0-alpha</version>
<title>MagicOnion</title>
<authors>neuecc</authors>
<owners>y.neuecc</owners>
@@ -25,5 +25,7 @@
<files>
<file src="..\src\MagicOnion\bin\Release\MagicOnion.dll" target="lib\net45" />
<file src="..\src\MagicOnion\bin\Release\MagicOnion.xml" target="lib\net45" />
+ <file src="moc.exe" target="tools\" />
+ <file src="moc.exe.config" target="tools\" />
</files>
</package>
View
Binary file not shown.
View
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <startup>
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
+ </startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.2.0.0" newVersion="1.2.0.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
View
Binary file not shown.
View
@@ -1 +1 @@
-nuget push MagicOnion.0.1.0-alpha.nupkg -Source https://www.nuget.org/api/v2/package
+nuget push MagicOnion.0.2.0-alpha.nupkg -Source https://www.nuget.org/api/v2/package
@@ -36,13 +36,10 @@ public CommandlineArguments(string[] args)
{ "i|input=", "[required]Input path of analyze csproj", x => { InputPath = x; } },
{ "o|output=", "[required]Output path(file) or directory base(in separated mode)", x => { OutputPath = x; } },
{ "s|separate", "[optional, default=false]Output files are separated", _ => { IsSeparate = true; } },
- { "u|unuseunityattr", "[optional, default=false]Unuse UnityEngine's RuntimeInitializeOnLoadMethodAttribute on ZeroFormatterInitializer", _ => { UnuseUnityAttr = true; } },
+ { "u|unuseunityattr", "[optional, default=false]Unuse UnityEngine's RuntimeInitializeOnLoadMethodAttribute on MagicOnionInitializer", _ => { UnuseUnityAttr = true; } },
{ "c|conditionalsymbol=", "[optional, default=empty]conditional compiler symbol", x => { ConditionalSymbols.AddRange(x.Split(',')); } },
-
{ "r|resolvername=", "[optional, default=DefaultResolver]Register CustomSerializer target", x => { ResolverName = x; } },
-
-
- { "n|namespace=", "[optional, default=ZeroFormatter]Set namespace root name", x => { NamespaceRoot = x; } },
+ { "n|namespace=", "[optional, default=MagicOnion]Set namespace root name", x => { NamespaceRoot = x; } },
};
if (args.Length == 0)
{
@@ -103,21 +100,33 @@ static void Main(string[] args)
var texts = definitions.GroupBy(x => x.Namespace)
.Select(x => new CodeTemplate() { Namespace = x.Key, ZeroFormatterResolver = cmdArgs.ResolverName, Interfaces = x.ToArray() })
- .Select(x => x.TransformText())
+ // .Select(x => x.TransformText())
.ToArray();
- var registerTemplate = new RegisterTemplate { Namespace = "globalname", Interfaces = definitions, UnuseUnityAttribute = false };
+ var registerTemplate = new RegisterTemplate { Namespace = cmdArgs.NamespaceRoot, Interfaces = definitions, UnuseUnityAttribute = cmdArgs.UnuseUnityAttr };
if (cmdArgs.IsSeparate)
{
+ var initializerPath = Path.Combine(cmdArgs.OutputPath, "MagicOnionInitializer.cs");
+ Output(initializerPath, registerTemplate.TransformText());
+
+ foreach (var item in texts)
+ {
+ foreach (var interfaceDef in item.Interfaces)
+ {
+ var path = Path.Combine(cmdArgs.OutputPath, interfaceDef.ToString().Replace(".", "\\") + ".cs");
+ var template2 = new CodeTemplate() { Namespace = interfaceDef.Namespace, ZeroFormatterResolver = cmdArgs.ResolverName, Interfaces = new[] { interfaceDef } };
+ Output(path, template2.TransformText());
+ }
+ }
}
else
{
var sb = new StringBuilder();
sb.AppendLine(registerTemplate.TransformText());
foreach (var item in texts)
{
- sb.AppendLine(item);
+ sb.AppendLine(item.TransformText());
}
Output(cmdArgs.OutputPath, sb.ToString());
}
@@ -23,5 +23,5 @@
[assembly: Guid("c79ce0bf-ed4c-47be-822e-e82cf83fc68a")]
// major-minor-patch
-[assembly: AssemblyVersion("0.1.0")]
-[assembly: AssemblyFileVersion("0.1.0")]
+[assembly: AssemblyVersion("0.2.0")]
+[assembly: AssemblyFileVersion("0.2.0")]

0 comments on commit 3a1419f

Please sign in to comment.