updates the codegen to also include the project name for sbt

This commit is contained in:
Ivan Porto Carrero 2014-10-21 10:59:35 -07:00
parent f3dc69a7e7
commit a656ea301e
2 changed files with 39 additions and 13 deletions

31
specs/extra.sbt Normal file
View File

@ -0,0 +1,31 @@
val wordnikSnapshots = "Wordnik Snapshots" at "https://ci.aws.wordnik.com/artifactory/m2-snapshots/"
val wordnikReleases = "Wordnik Releases" at "https://ci.aws.wordnik.com/artifactory/m2-releases/"
val wordnikRemoteRepos = "Wordnik Remote Repos" at "https://ci.aws.wordnik.com/artifactory/remote-repos/"
scalaVersion := "2.11.2"
crossScalaVersions := Seq("2.10.4", "2.11.2")
scalacOptions ++= Seq("-unchecked", "-deprecation", "-optimize", "-Xcheckinit", "-encoding", "utf8")
version := "1.6.1"
publishTo <<= (version) { version: String =>
val artifactory = "https://ci.aws.wordnik.com/artifactory/m2-"
if (version.trim.endsWith("SNAPSHOT"))
Some("snapshots" at artifactory + "snapshots")
else
Some("releases" at artifactory + "releases")
}
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { x => false }
credentials += Credentials("Artifactory Realm", "ci.aws.wordnik.com", "mavenuser", "DEEaffe987a")
resolvers ++= Seq(wordnikSnapshots, wordnikReleases, wordnikRemoteRepos)

View File

@ -1,20 +1,14 @@
package com.wordnik.swagger.codegen package com.wordnik.swagger.codegen
import scala.collection.mutable import java.io.File
import java.io.{File, FileWriter}
import com.wordnik.swagger.codegen.language.CodegenConfig
import com.wordnik.swagger.codegen.model._ import com.wordnik.swagger.codegen.model._
import scala.collection.mutable.{HashMap, ListBuffer}
import language.CodegenConfig
import scala.io.Source
import org.json4s.jackson.Serialization._
import org.fusesource.scalate.{Template, TemplateSource, TemplateEngine}
import org.apache.commons.io.FileUtils
import com.wordnik.swagger.codegen.util.{CoreUtils, ApiExtractor, ResourceExtractor}
import com.wordnik.swagger.codegen.spec.SwaggerSpecValidator
import mojolly.inflector.InflectorImports._ import mojolly.inflector.InflectorImports._
import org.rogach.scallop.{ScallopConf, Scallop} import org.rogach.scallop.ScallopConf
import scala.annotation.switch
import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
import scala.collection.mutable.HashMap
case class SwaggerApi( case class SwaggerApi(
clientName: String, clientName: String,
@ -119,6 +113,7 @@ object ScalaAsyncClientGenerator extends App {
props += "fileMap" -> resUrl props += "fileMap" -> resUrl
props += "clientName" -> cfg.api.clientName.underscore.pascalize props += "clientName" -> cfg.api.clientName.underscore.pascalize
props += "projectName" -> cfg.api.clientName.underscore.dasherize
clientOpts.properties = props.toMap.asJava clientOpts.properties = props.toMap.asJava