-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove options compile deps in cli-options module
- Loading branch information
Showing
11 changed files
with
66 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
modules/cli-options/src/main/scala/scala/cli/commands/publish/PublishParamsOptions.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
modules/cli/src/main/scala/scala/cli/commands/util/PublishUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package scala.cli.commands.util | ||
|
||
import java.io.File | ||
import scala.build.options.publish.ConfigPasswordOption | ||
import scala.build.{Os, Position, Positioned} | ||
import scala.cli.commands.SharedOptions | ||
import scala.cli.commands.publish.MaybeConfigPasswordOption | ||
import scala.cli.commands.publish.MaybeConfigPasswordOption.* | ||
import scala.util.Properties | ||
|
||
object PublishUtils { | ||
|
||
implicit class SharedOptionsOps(v: MaybeConfigPasswordOption) { | ||
def configPasswordOptions() = | ||
v match { | ||
case ActualOption(option) => ConfigPasswordOption.ActualOption(option) | ||
case ConfigOption(fullName) => ConfigPasswordOption.ConfigOption(fullName) | ||
} | ||
} | ||
} |
11 changes: 6 additions & 5 deletions
11
...il/MaybeConfigPasswordOptionHelpers.scala → ...li/util/ConfigPasswordOptionHelpers.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
modules/options/src/main/scala/scala/build/options/publish/ConfigPasswordOption.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package scala.build.options.publish | ||
|
||
import scala.cli.signing.shared.PasswordOption | ||
|
||
/** Can be either a [[PasswordOption]], or something like "config:…" pointing at a config entry */ | ||
sealed abstract class ConfigPasswordOption extends Product with Serializable | ||
|
||
object ConfigPasswordOption { | ||
final case class ActualOption(option: PasswordOption) extends ConfigPasswordOption | ||
final case class ConfigOption(fullName: String) extends ConfigPasswordOption { | ||
private lazy val split = fullName.split('.') | ||
def prefix: Seq[String] = split.dropRight(1).toSeq | ||
def name: String = split.last | ||
} | ||
} |