From 0c879ca73b17769a6982d2b932ac21dcd5e1d98f Mon Sep 17 00:00:00 2001 From: Jean Helou Date: Mon, 11 Feb 2019 22:24:14 +0100 Subject: Adds the api submodule This is the second commit of a redesign of the play lib module. This module contains only the common `api` which is implemented by the actual workers. It also defines a specific ADT to configure the type of routes generator to be used for the project. The ADT feels cleaner than a simple string but may be too restrictive. --- .../playlib/api/src/RouteCompilerWorkerApi.scala | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 contrib/playlib/api/src/RouteCompilerWorkerApi.scala (limited to 'contrib/playlib/api') diff --git a/contrib/playlib/api/src/RouteCompilerWorkerApi.scala b/contrib/playlib/api/src/RouteCompilerWorkerApi.scala new file mode 100644 index 00000000..0467b774 --- /dev/null +++ b/contrib/playlib/api/src/RouteCompilerWorkerApi.scala @@ -0,0 +1,26 @@ +package mill +package playlib +package api + +import ammonite.ops.Path +import mill.api.Result +import mill.scalalib.api.CompilationResult + + +trait RouteCompilerWorkerApi { + def compile(file: Path, + additionalImports: Seq[String], + forwardsRouter: Boolean, + reverseRouter: Boolean, + namespaceReverseRouter: Boolean, + generatorType:RouteCompilerType, + dest: Path)(implicit ctx: mill.api.Ctx):Result[CompilationResult] + + +} + +sealed trait RouteCompilerType +object RouteCompilerType{ + case object InjectedGenerator extends RouteCompilerType + case object StaticGenerator extends RouteCompilerType +} \ No newline at end of file -- cgit v1.2.3