@@ -3,7 +3,6 @@ package org.codeoverflow.chatoverflow.build
33import java .io .{BufferedWriter , File , FileWriter , IOException }
44
55import org .codeoverflow .chatoverflow .build .plugins .Plugin
6- import sbt .librarymanagement .{CrossVersion , ModuleID }
76
87/**
98 * Represents a simple sbt files content and methods to create a new sbt file. Not intended to open/read sbt files.
@@ -13,30 +12,22 @@ import sbt.librarymanagement.{CrossVersion, ModuleID}
1312 * @param plugins list of paths of sub projects
1413 * @param apiProjectPath the path of a base api project which every project depends on
1514 * @param defineRoot true, if a root project (".") should be defined in the sbt file
16- * @param dependencies library dependencies to add to the sbt file
1715 */
1816class SbtFile (val name : String , val version : String , val plugins : List [Plugin ], val apiProjectPath : String ,
19- val defineRoot : Boolean , dependencies : List [ ModuleID ] ) {
17+ val defineRoot : Boolean ) {
2018 /**
2119 * Represents a simple sbt files content and methods to create a new sbt file. Not intended to open/read sbt files.
2220 *
2321 * @param name the name of a sbt project
2422 * @param version the version of a sbt project
2523 */
26- def this (name : String , version : String ) = this (name, version, List (), " " , false , List () )
24+ def this (name : String , version : String ) = this (name, version, List (), " " , false )
2725
2826 /**
2927 * Represents a simple sbt files content and methods to create a new sbt file. Not intended to open/read sbt files.
3028 */
3129 def this () = this (" " , " " )
3230
33- /**
34- * Represents a simple sbt files content and methods to create a new sbt file. Not intended to open/read sbt files.
35- *
36- * @param dependencies library dependencies to add to the sbt file
37- */
38- def this (dependencies : List [ModuleID ]) = this (" " , " " , List (), " " , false , dependencies)
39-
4031 /**
4132 * Tries to save the sbt files content into a defined directory.
4233 *
@@ -101,32 +92,6 @@ class SbtFile(val name: String, val version: String, val plugins: List[Plugin],
10192 sbtContent append rootLine
10293 }
10394
104- if (dependencies.nonEmpty) {
105- sbtContent append " \n resolvers += \" jcenter-bintray\" at \" https://jcenter.bintray.com\"\n "
106-
107- val depString = dependencies.map(m => renderModuleID(m)).mkString(" " , " ,\n " , " " )
108-
109- sbtContent append s " libraryDependencies ++= Seq( \n $depString\n ) \n "
110- }
111-
11295 sbtContent.mkString
11396 }
114-
115- /**
116- * Converts a ModuleID instance to a string with the module in the syntax that is used in sbt files.
117- */
118- private def renderModuleID (m : ModuleID ): String = {
119- var formatString = " "
120-
121- // Note that the %% in the string are required to escape the string formatter and will turn into a single %
122- if (m.crossVersion == CrossVersion .binary)
123- formatString += " \" %s\" %%%% \" %s\" %% \" %s\" "
124- else
125- formatString += " \" %s\" %% \" %s\" %% \" %s\" "
126-
127- if (m.configurations.isDefined)
128- formatString += " %% \" %s\" "
129-
130- formatString.format(m.organization, m.name, m.revision, m.configurations.getOrElse(" " ))
131- }
13297}
0 commit comments