Skip to content

Commit

Permalink
in case Plugins is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
zijianhuang committed Nov 12, 2019
1 parent c056ceb commit 58063d5
Showing 1 changed file with 15 additions and 51 deletions.
66 changes: 15 additions & 51 deletions WebApiClientGenShared/CodeGen.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using Fonlow.Web.Meta;
using Fonlow.CodeDom.Web.Ts;

namespace Fonlow.CodeDom.Web
{
Expand Down Expand Up @@ -67,61 +66,26 @@ public static void GenerateClientAPIs(string webRootPath, CodeGenSettings settin
return null;
};


//var jQueryPath = CreateTsPath(settings.ClientApiOutputs.TypeScriptJQFolder, settings.ClientApiOutputs.TypeScriptJQFile);
//if (!String.IsNullOrEmpty(jQueryPath))
//{
// var jQueryOutput = new JSOutput(settings, jQueryPath, false);
// var tsGen = new ControllersTsClientApiGen(jQueryOutput);
// tsGen.CreateCodeDom(apiDescriptions);
// tsGen.Save();
//}

//var ng2Path = CreateTsPath(settings.ClientApiOutputs.TypeScriptNG2Folder, settings.ClientApiOutputs.TypeScriptNG2File);
//if (!String.IsNullOrEmpty(ng2Path))
//{
// var ng2Output = new JSOutput(settings, ng2Path, true);
// var tsGen = new ControllersTsNG2ClientApiGen(ng2Output);
// tsGen.CreateCodeDom(apiDescriptions);
// tsGen.Save();
//}

//var axiosPath = CreateTsPath(settings.ClientApiOutputs.TypeScriptAxiosFolder, settings.ClientApiOutputs.TypeScriptAxiosFile);
//if (!String.IsNullOrEmpty(axiosPath))
//{
// var axiosOutput = new JSOutput(settings, axiosPath, true);
// var tsGen = new ControllersTsAxiosClientApiGen(axiosOutput);
// tsGen.CreateCodeDom(apiDescriptions);
// tsGen.Save();
//}

//var aureliaPath = CreateTsPath(settings.ClientApiOutputs.TypeScriptAureliaFolder, settings.ClientApiOutputs.TypeScriptAureliaFile);
//if (!String.IsNullOrEmpty(aureliaPath))
//{
// var aureliaOutput = new JSOutput(settings, aureliaPath, true);
// var tsGen = new ControllersTsAureliaClientApiGen(aureliaOutput);
// tsGen.CreateCodeDom(apiDescriptions);
// tsGen.Save();
//}

foreach (var plugin in settings.ClientApiOutputs.Plugins)
if (settings.ClientApiOutputs.Plugins != null)
{
var jsOutput = new JSOutput
foreach (var plugin in settings.ClientApiOutputs.Plugins)
{
CamelCase=settings.ClientApiOutputs.CamelCase,
JSPath= CreateTsPath(plugin.TargetDir, plugin.TSFile),
AsModule=plugin.AsModule,
ContentType=plugin.ContentType,
StringAsString=settings.ClientApiOutputs.StringAsString,
var jsOutput = new JSOutput
{
CamelCase = settings.ClientApiOutputs.CamelCase,
JSPath = CreateTsPath(plugin.TargetDir, plugin.TSFile),
AsModule = plugin.AsModule,
ContentType = plugin.ContentType,
StringAsString = settings.ClientApiOutputs.StringAsString,

ApiSelections=settings.ApiSelections,
};
ApiSelections = settings.ApiSelections,
};

var tsGen = PluginFactory.CreateImplementationsFromAssembly(plugin.AssemblyName, jsOutput);
tsGen.CreateCodeDom(apiDescriptions);
tsGen.Save();
var tsGen = PluginFactory.CreateImplementationsFromAssembly(plugin.AssemblyName, jsOutput);
tsGen.CreateCodeDom(apiDescriptions);
tsGen.Save();
}
}

}
}
}

0 comments on commit 58063d5

Please sign in to comment.