diff --git a/src/cli/Commands/GenerateJsonSchema.cs b/src/cli/Commands/GenerateJsonSchema.cs index e54e4918..f5754911 100644 --- a/src/cli/Commands/GenerateJsonSchema.cs +++ b/src/cli/Commands/GenerateJsonSchema.cs @@ -27,16 +27,13 @@ namespace cli multipleValues: false); genargjson = target.Argument( "json", - "Json file to generate a schema for.", + "Json file generated", multipleValues: false); }, false); cmd.OnExecute( - async () => { - if (genargjson.Value == "jsonSchema") { - if (genargjson.Value == null) - await GenerateCiBuildSettingsSchema(); - else - await GenerateCiBuildSettingsSchema(genargjson.Value); + () => { + if (genargclass.Value == "jsonSchema") { + GenerateCiBuildSettingsSchema(genargjson.Value); } else { cmd.ShowHint(); return 1; @@ -46,9 +43,9 @@ namespace cli ); return cmd; } - public static async Task GenerateCiBuildSettingsSchema(string outputFileName = "pauls-ci-schema.json") + public static void GenerateCiBuildSettingsSchema(string outputFileName = "pauls-ci-schema.json") { - var schema = await JsonSchema4.FromTypeAsync(); + var schema = JsonSchema.FromType(typeof(CiBuildSettings)); var schemaData = schema.ToJson(); FileInfo ofi = new FileInfo(outputFileName); @@ -57,14 +54,8 @@ namespace cli owritter.WriteLine(schemaData); owritter.Close(); ostream.Close(); - /* var errors = schema.Validate("{...}"); - - foreach (var error in errors) - Console.WriteLine(error.Path + ": " + error.Kind); - - schema = await JsonSchema4.FromJsonAsync(schemaData); */ } } -} \ No newline at end of file +} diff --git a/src/cli/Commands/Streamer.cs b/src/cli/Commands/Streamer.cs index c8a4bc14..bd22e548 100644 --- a/src/cli/Commands/Streamer.cs +++ b/src/cli/Commands/Streamer.cs @@ -82,7 +82,7 @@ namespace cli { _logger.LogInformation("Connecting to "+url); await _client.ConnectAsync(new Uri(url), _tokenSource.Token); _logger.LogInformation("Connected"); - const int bufLen = Constants.WebSocketsMaxBufLen; + const int bufLen = Yavsc.Constants.WebSocketsMaxBufLen; byte [] buffer = new byte[bufLen+4*sizeof(int)]; const int offset=0; int read = 0; diff --git a/src/cli/Makefile b/src/cli/Makefile index 58c29a5b..3cb31848 100644 --- a/src/cli/Makefile +++ b/src/cli/Makefile @@ -12,13 +12,10 @@ msbuild-restore: check: run - -project.lock.json: project.json - dnu restore +fixSystemXML: @# fixing package id reference case, to System.Xml, from package NJsonSchema.CodeGeneration.CSharp - sed 's/System.XML/System.Xml/' project.lock.json > project.lock.json.new && mv project.lock.json.new project.lock.json + @sed 's/System.XML/System.Xml/' project.lock.json > project.lock.json.new && mv project.lock.json.new project.lock.json -restore: project.lock.json $(BINTARGETPATH): project.lock.json diff --git a/src/cli/project.json b/src/cli/project.json index ebf6ee39..a022c9c5 100644 --- a/src/cli/project.json +++ b/src/cli/project.json @@ -46,14 +46,15 @@ "Microsoft.Framework.Configuration.Json": "1.0.0-beta8", "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4", "Newtonsoft.Json": "9.0.1", - "NJsonSchema.CodeGeneration.CSharp": "9.10.65", + "NJsonSchema.CodeGeneration.CSharp": "10.0.27", "Yavsc": { "version": "1.0.6-rc05", "target": "package" }, "Microsoft.Dnx.Host": "1.0.0-rc1-final", "Microsoft.Dnx.Runtime": "1.0.0-rc1-final", - "Microsoft.Dnx.DesignTimeHost": "1.0.0-rc1-final" + "Microsoft.Dnx.DesignTimeHost": "1.0.0-rc1-final", + "YamlDotNet": "8.0.0" }, "frameworks": { "dnx451": { @@ -61,4 +62,4 @@ "System.Xml": {} } } -} \ No newline at end of file +}