|
| 1 | +package profiling.integrations |
| 2 | + |
| 3 | +import java.nio.file.Path |
| 4 | + |
| 5 | +import caseapp.core.ArgParser |
| 6 | +import caseapp.{ArgsName, CommandName, ExtraName, HelpMessage, Hidden, Recurse} |
| 7 | +import caseapp.core.CommandMessages |
| 8 | + |
| 9 | +object Commands { |
| 10 | + |
| 11 | + /* sealed abstract class Mode(val name: String) |
| 12 | +
|
| 13 | + /** The kind of items that should be returned for autocompletion */ |
| 14 | + object Mode { |
| 15 | + case object Commands extends Mode("commands") |
| 16 | + case object Projects extends Mode("projects") |
| 17 | + case object ProjectBoundCommands extends Mode("project-commands") |
| 18 | + case object Flags extends Mode("flags") |
| 19 | + case object Reporters extends Mode("reporters") |
| 20 | + case object Protocols extends Mode("protocols") |
| 21 | + case object TestsFQCN extends Mode("testsfqcn") |
| 22 | + case object MainsFQCN extends Mode("mainsfqcn") |
| 23 | +
|
| 24 | + implicit val completionModeRead: ArgParser[Mode] = ??? |
| 25 | + } |
| 26 | +
|
| 27 | + sealed abstract class BspProtocol(val name: String) |
| 28 | +
|
| 29 | + object BspProtocol { |
| 30 | + case object Local extends BspProtocol("local") |
| 31 | + case object Tcp extends BspProtocol("tcp") |
| 32 | +
|
| 33 | + implicit val bspProtocolRead: ArgParser[BspProtocol] = ??? |
| 34 | + } |
| 35 | +
|
| 36 | + sealed abstract class ReporterKind(val name: String) |
| 37 | + case object ScalacReporter extends ReporterKind("scalac") |
| 38 | + case object BloopReporter extends ReporterKind("bloop")*/ |
| 39 | + |
| 40 | + sealed trait RawCommand { |
| 41 | + def cliOptions: CliOptions |
| 42 | + } |
| 43 | + |
| 44 | + sealed trait CompilingCommand extends RawCommand { |
| 45 | + //def project: String |
| 46 | + //def reporter: ReporterKind |
| 47 | + } |
| 48 | + |
| 49 | +/* sealed trait Tree[A] |
| 50 | + case class Leaf[A](value: A) extends Tree[A] |
| 51 | + case class Branch[A]( |
| 52 | + left: Tree[A], |
| 53 | + right: Tree[A] |
| 54 | + ) extends Tree[A]*/ |
| 55 | + |
| 56 | + case class Help( |
| 57 | + @Recurse cliOptions: CliOptions = CliOptions.default |
| 58 | + ) extends RawCommand |
| 59 | + |
| 60 | + case class Autocomplete( |
| 61 | + @Recurse cliOptions: CliOptions = CliOptions.default, |
| 62 | + //mode: Mode, |
| 63 | + //format: Format, |
| 64 | + /* command: Option[String], |
| 65 | + project: Option[String]*/ |
| 66 | + ) extends RawCommand |
| 67 | + |
| 68 | + case class About( |
| 69 | + @Recurse cliOptions: CliOptions = CliOptions.default |
| 70 | + ) extends RawCommand |
| 71 | + |
| 72 | + case class Projects( |
| 73 | + /* @ExtraName("dot") |
| 74 | + @HelpMessage("Print out a dot graph you can pipe into `dot`. By default, false.") |
| 75 | + dotGraph: Boolean = false,*/ |
| 76 | + @Recurse cliOptions: CliOptions = CliOptions.default |
| 77 | + ) extends RawCommand |
| 78 | + |
| 79 | + case class Configure( |
| 80 | + /* @ExtraName("parallelism") |
| 81 | + @HelpMessage("Set the number of threads used for parallel compilation and test execution.") |
| 82 | + threads: Int = 4,*/ |
| 83 | + @Recurse cliOptions: CliOptions = CliOptions.default |
| 84 | + ) extends RawCommand |
| 85 | + |
| 86 | + case class Clean( |
| 87 | + /* @ExtraName("p") |
| 88 | + @HelpMessage("The projects to clean.") |
| 89 | + project: List[String] = Nil, |
| 90 | + @HelpMessage("Do not run clean for dependencies. By default, false.") |
| 91 | + isolated: Boolean = false,*/ |
| 92 | + @Recurse cliOptions: CliOptions = CliOptions.default, |
| 93 | + ) extends RawCommand |
| 94 | + |
| 95 | + @CommandName("bsp") |
| 96 | + case class Bsp( |
| 97 | + /*/* @ExtraName("p") |
| 98 | + @HelpMessage("The connection protocol for the bsp server. By default, local.") |
| 99 | + protocol: BspProtocol = BspProtocol.Local,*/ |
| 100 | + @ExtraName("h") |
| 101 | + @HelpMessage("The server host for the bsp server (TCP only).") |
| 102 | + host: String = "127.0.0.1", |
| 103 | + @HelpMessage("The port for the bsp server (TCP only).") |
| 104 | + port: Int = 5101, |
| 105 | + @ExtraName("s") |
| 106 | + @HelpMessage("A path to a socket file to communicate through Unix sockets (local only).") |
| 107 | + socket: Option[Path] = None, |
| 108 | + @ExtraName("pn") |
| 109 | + @HelpMessage( |
| 110 | + "A path to a new existing socket file to communicate through Unix sockets (local only)." |
| 111 | + ) |
| 112 | + pipeName: Option[String] = None,*/ |
| 113 | + @Recurse cliOptions: CliOptions = CliOptions.default |
| 114 | + ) extends RawCommand |
| 115 | + |
| 116 | + case class Compile( |
| 117 | + /* @ExtraName("p") |
| 118 | + @HelpMessage("The project to compile (will be inferred from remaining cli args).") |
| 119 | + project: String = "", |
| 120 | + @HelpMessage("Compile the project incrementally. By default, true.") |
| 121 | + incremental: Boolean = true, |
| 122 | +/* @HelpMessage("Pick reporter to show compilation messages. By default, bloop's used.") |
| 123 | + reporter: ReporterKind = BloopReporter,*/ |
| 124 | + @ExtraName("w") |
| 125 | + @HelpMessage("Run the command when projects' source files change. By default, false.") |
| 126 | + watch: Boolean = false,*/ |
| 127 | + @Recurse cliOptions: CliOptions = CliOptions.default, |
| 128 | + ) extends CompilingCommand |
| 129 | + |
| 130 | + case class Test( |
| 131 | + /* @ExtraName("p") |
| 132 | + @HelpMessage("The project to test (will be inferred from remaining cli args).") |
| 133 | + project: String = "", |
| 134 | + @HelpMessage("Do not run tests for dependencies. By default, false.") |
| 135 | + isolated: Boolean = false, |
| 136 | + @ExtraName("o") |
| 137 | + @HelpMessage("The list of test suite filters to test for only.") |
| 138 | + only: List[String] = Nil, |
| 139 | + @HelpMessage("The arguments to pass in to the test framework.") |
| 140 | + args: List[String] = Nil, |
| 141 | +/* @HelpMessage("Pick reporter to show compilation messages. By default, bloop's used.") |
| 142 | + reporter: ReporterKind = BloopReporter,*/ |
| 143 | + @ExtraName("w") |
| 144 | + @HelpMessage("Run the command when projects' source files change. By default, false.") |
| 145 | + watch: Boolean = false,*/ |
| 146 | + @Recurse cliOptions: CliOptions = CliOptions.default |
| 147 | + ) extends CompilingCommand |
| 148 | + |
| 149 | + case class Console( |
| 150 | + /* @ExtraName("p") |
| 151 | + @HelpMessage("The project to run the console at (will be inferred from remaining cli args).") |
| 152 | + project: String = "", |
| 153 | +/* @HelpMessage("Pick reporter to show compilation messages. By default, bloop's used.") |
| 154 | + reporter: ReporterKind = BloopReporter,*/ |
| 155 | + @HelpMessage("Start up the console compiling only the target project's dependencies.") |
| 156 | + excludeRoot: Boolean = false,*/ |
| 157 | + @Recurse cliOptions: CliOptions = CliOptions.default |
| 158 | + ) extends CompilingCommand |
| 159 | + |
| 160 | + case class Run( |
| 161 | + /* @ExtraName("p") |
| 162 | + @HelpMessage("The project to run (will be inferred from remaining cli args).") |
| 163 | + project: String = "", |
| 164 | + @ExtraName("m") |
| 165 | + @HelpMessage("The main class to run. Leave unset to let bloop select automatically.") |
| 166 | + main: Option[String] = None, |
| 167 | +/* @HelpMessage("Pick reporter to show compilation messages. By default, bloop's used.") |
| 168 | + reporter: ReporterKind = BloopReporter,*/ |
| 169 | + @HelpMessage("The arguments to pass in to the main class.") |
| 170 | + args: List[String] = Nil, |
| 171 | + @ExtraName("w") |
| 172 | + @HelpMessage("If set, run the command whenever projects' source files change.") |
| 173 | + watch: Boolean = false,*/ |
| 174 | + @Recurse cliOptions: CliOptions = CliOptions.default |
| 175 | + ) extends CompilingCommand |
| 176 | +} |
0 commit comments