File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
modules/cli/src/main/scala/scala/cli/commands/export0 Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -518,6 +518,8 @@ trait Core extends ScalaCliCrossSbtModule
518
518
| def giter8Organization = " ${Deps .giter8.dep.module.organization.value}"
519
519
| def giter8Name = " ${Deps .giter8.dep.module.name.value}"
520
520
| def giter8Version = " ${Deps .giter8.dep.version}"
521
+ |
522
+ | def sbtVersion = " ${Deps .Versions .sbtVersion}"
521
523
|
522
524
| def mavenVersion = " ${Deps .Versions .mavenVersion}"
523
525
| def mavenScalaCompilerPluginVersion = " ${Deps .Versions .mavenScalaCompilerPluginVersion}"
Original file line number Diff line number Diff line change @@ -155,11 +155,15 @@ object Export extends ScalaCommand[ExportOptions] {
155
155
val shouldExportToSbt = options.sbt.getOrElse(false )
156
156
val shouldExportToMaven = options.maven.getOrElse(false )
157
157
158
- val exportOptions = List (shouldExportToMill, shouldExportToSbt, shouldExportToMaven)
159
-
160
- if (exportOptions.count(identity) > 1 ) {
158
+ val exportOptions =
159
+ (if shouldExportToMill then List (" Mill" ) else Nil ) ++
160
+ (if shouldExportToSbt then List (" SBT" ) else Nil ) ++
161
+ (if shouldExportToMaven then List (" Maven" ) else Nil )
162
+ val exportOptionsString = exportOptions.mkString(" , " )
163
+ if exportOptions.length > 1 then {
161
164
logger.error(
162
- s " Error: Cannot export to both mill and sbt. Please pick one build tool to export. "
165
+ s """ Error: Cannot export to more than one tool at once (currently chosen: $exportOptionsString).
166
+ |Pick one build tool to export to. """ .stripMargin
163
167
)
164
168
sys.exit(1 )
165
169
}
@@ -238,7 +242,7 @@ object Export extends ScalaCommand[ExportOptions] {
238
242
project.print(System .out)
239
243
}
240
244
else {
241
- val sbtVersion = options.sbtVersion.getOrElse(" 1.10.2 " )
245
+ val sbtVersion = options.sbtVersion.getOrElse(Constants .sbtVersion )
242
246
val defaultMavenCompilerVersion = options.mvnVersion.getOrElse(Constants .mavenVersion)
243
247
val defaultScalaMavenCompilerVersion =
244
248
options.mvnScalaVersion.getOrElse(Constants .mavenScalaCompilerPluginVersion)
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ object Deps {
124
124
def javaSemanticdb = " 0.10.0"
125
125
def javaClassName = " 0.1.3"
126
126
def bloop = " 2.0.0"
127
+ def sbtVersion = " 1.10.2"
127
128
def mavenVersion = " 3.8.1"
128
129
def mavenScalaCompilerPluginVersion = " 4.9.1"
129
130
def mavenExecPluginVersion = " 3.3.0"
You can’t perform that action at this time.
0 commit comments