upgrading usage of NJsonSchema.CodeGeneration.CSharp
This commit is contained in:
@ -27,16 +27,13 @@ namespace cli
|
|||||||
multipleValues: false);
|
multipleValues: false);
|
||||||
genargjson = target.Argument(
|
genargjson = target.Argument(
|
||||||
"json",
|
"json",
|
||||||
"Json file to generate a schema for.",
|
"Json file generated",
|
||||||
multipleValues: false);
|
multipleValues: false);
|
||||||
}, false);
|
}, false);
|
||||||
cmd.OnExecute(
|
cmd.OnExecute(
|
||||||
async () => {
|
() => {
|
||||||
if (genargjson.Value == "jsonSchema") {
|
if (genargclass.Value == "jsonSchema") {
|
||||||
if (genargjson.Value == null)
|
GenerateCiBuildSettingsSchema(genargjson.Value);
|
||||||
await GenerateCiBuildSettingsSchema();
|
|
||||||
else
|
|
||||||
await GenerateCiBuildSettingsSchema(genargjson.Value);
|
|
||||||
} else {
|
} else {
|
||||||
cmd.ShowHint();
|
cmd.ShowHint();
|
||||||
return 1;
|
return 1;
|
||||||
@ -46,9 +43,9 @@ namespace cli
|
|||||||
);
|
);
|
||||||
return cmd;
|
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<CiBuildSettings>();
|
var schema = JsonSchema.FromType(typeof(CiBuildSettings));
|
||||||
var schemaData = schema.ToJson();
|
var schemaData = schema.ToJson();
|
||||||
|
|
||||||
FileInfo ofi = new FileInfo(outputFileName);
|
FileInfo ofi = new FileInfo(outputFileName);
|
||||||
@ -57,12 +54,6 @@ namespace cli
|
|||||||
owritter.WriteLine(schemaData);
|
owritter.WriteLine(schemaData);
|
||||||
owritter.Close();
|
owritter.Close();
|
||||||
ostream.Close();
|
ostream.Close();
|
||||||
/* var errors = schema.Validate("{...}");
|
|
||||||
|
|
||||||
foreach (var error in errors)
|
|
||||||
Console.WriteLine(error.Path + ": " + error.Kind);
|
|
||||||
|
|
||||||
schema = await JsonSchema4.FromJsonAsync(schemaData); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ namespace cli {
|
|||||||
_logger.LogInformation("Connecting to "+url);
|
_logger.LogInformation("Connecting to "+url);
|
||||||
await _client.ConnectAsync(new Uri(url), _tokenSource.Token);
|
await _client.ConnectAsync(new Uri(url), _tokenSource.Token);
|
||||||
_logger.LogInformation("Connected");
|
_logger.LogInformation("Connected");
|
||||||
const int bufLen = Constants.WebSocketsMaxBufLen;
|
const int bufLen = Yavsc.Constants.WebSocketsMaxBufLen;
|
||||||
byte [] buffer = new byte[bufLen+4*sizeof(int)];
|
byte [] buffer = new byte[bufLen+4*sizeof(int)];
|
||||||
const int offset=0;
|
const int offset=0;
|
||||||
int read = 0;
|
int read = 0;
|
||||||
|
@ -12,13 +12,10 @@ msbuild-restore:
|
|||||||
|
|
||||||
check: run
|
check: run
|
||||||
|
|
||||||
|
fixSystemXML:
|
||||||
project.lock.json: project.json
|
|
||||||
dnu restore
|
|
||||||
@# fixing package id reference case, to System.Xml, from package NJsonSchema.CodeGeneration.CSharp
|
@# 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
|
$(BINTARGETPATH): project.lock.json
|
||||||
|
|
||||||
|
@ -46,14 +46,15 @@
|
|||||||
"Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
|
"Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
|
||||||
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
|
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
|
||||||
"Newtonsoft.Json": "9.0.1",
|
"Newtonsoft.Json": "9.0.1",
|
||||||
"NJsonSchema.CodeGeneration.CSharp": "9.10.65",
|
"NJsonSchema.CodeGeneration.CSharp": "10.0.27",
|
||||||
"Yavsc": {
|
"Yavsc": {
|
||||||
"version": "1.0.6-rc05",
|
"version": "1.0.6-rc05",
|
||||||
"target": "package"
|
"target": "package"
|
||||||
},
|
},
|
||||||
"Microsoft.Dnx.Host": "1.0.0-rc1-final",
|
"Microsoft.Dnx.Host": "1.0.0-rc1-final",
|
||||||
"Microsoft.Dnx.Runtime": "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": {
|
"frameworks": {
|
||||||
"dnx451": {
|
"dnx451": {
|
||||||
|
Reference in New Issue
Block a user