Merge pull request #207 from emmekappa/master

Fixing extensions and namespaces for csharp common files.
This commit is contained in:
Tony Tam 2014-06-17 10:53:17 -07:00
commit 02631e674a

View File

@ -60,7 +60,9 @@ class BasicCSharpGenerator extends BasicGenerator {
override def templateDir = "csharp" override def templateDir = "csharp"
// where to write generated code // where to write generated code
override def destinationDir = "generated-code/csharp/src/main/csharp" override def destinationDir = "generated-code/csharp/src"
override def invokerPackage: Option[String] = Some("Swagger.Client.Common")
// template used for models // template used for models
modelTemplateFiles += "model.mustache" -> ".cs" modelTemplateFiles += "model.mustache" -> ".cs"
@ -79,10 +81,10 @@ class BasicCSharpGenerator extends BasicGenerator {
override def importMapping = Map() override def importMapping = Map()
// package for models // package for models
override def modelPackage: Option[String] = Some("Com.Wordnik.Client.Model") override def modelPackage: Option[String] = Some("Swagger.Client.Model")
// package for api classes // package for api classes
override def apiPackage: Option[String] = Some("Com.Wordnik.Client.Api") override def apiPackage: Option[String] = Some("Swagger.Client.Api")
// file suffix // file suffix
override def fileSuffix = ".cs" override def fileSuffix = ".cs"
@ -198,8 +200,8 @@ class BasicCSharpGenerator extends BasicGenerator {
// supporting classes // supporting classes
override def supportingFiles = override def supportingFiles =
List( List(
("apiInvoker.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiInvoker.java"), ("apiInvoker.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiInvoker.cs"),
("apiException.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiException.java"), ("apiException.mustache", destinationDir + java.io.File.separator + invokerPackage.get.replace(".", java.io.File.separator) + java.io.File.separator, "ApiException.cs"),
("Newtonsoft.Json.dll", "generated-code/csharp/bin", "Newtonsoft.Json.dll"), ("Newtonsoft.Json.dll", "generated-code/csharp/bin", "Newtonsoft.Json.dll"),
("compile.mustache", "generated-code/csharp", "compile.bat")) ("compile.mustache", "generated-code/csharp", "compile.bat"))
} }