-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Used common project definitions in scommons-admin
- Loading branch information
1 parent
ab97d2b
commit 2ed9478
Showing
13 changed files
with
67 additions
and
281 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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
package common | ||
|
||
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ | ||
import common.Libs._ | ||
import sbt._ | ||
import scommons.sbtplugin.project.CommonTestLibs | ||
|
||
object TestLibs { | ||
|
||
private val scalaTestVersion = "3.0.1" | ||
private val scalaMockVersion = "3.6.0" | ||
object TestLibs extends CommonTestLibs { | ||
|
||
lazy val scommonsApiPlayWs = Def.setting("org.scommons.api" %% "scommons-api-play-ws" % scommonsApiVersion) | ||
|
||
lazy val scalaTest = Def.setting("org.scalatest" %% "scalatest" % scalaTestVersion) | ||
lazy val scalaMock = Def.setting("org.scalamock" %% "scalamock-scalatest-support" % scalaMockVersion) | ||
|
||
lazy val mockito = Def.setting("org.mockito" % "mockito-all" % "1.9.5") | ||
|
||
lazy val scalaTestPlusPlay = Def.setting("org.scalatestplus.play" %% "scalatestplus-play" % "3.1.2") | ||
lazy val akkaStreamTestKit = Def.setting("com.typesafe.akka" %% "akka-stream-testkit" % akkaVersion) | ||
|
||
// Scala.js dependencies | ||
|
||
lazy val scalaTestJs = Def.setting("org.scalatest" %%% "scalatest" % scalaTestVersion) | ||
lazy val scalaMockJs = Def.setting("org.scalamock" %%% "scalamock-scalatest-support" % scalaMockVersion) | ||
} |
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 |
---|---|---|
@@ -1,52 +1,25 @@ | ||
package definitions | ||
|
||
import com.typesafe.sbt.web.SbtWeb | ||
import common.Libs | ||
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ | ||
import sbt.Keys._ | ||
import sbt._ | ||
import scoverage.ScoverageKeys._ | ||
import webscalajs.ScalaJSWeb | ||
import scommons.sbtplugin.project.CommonClientModule | ||
|
||
import scalajsbundler.BundlingMode | ||
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin | ||
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport._ | ||
|
||
object AdminClient extends ScalaJsModule { | ||
object AdminClient extends AdminModule with CommonClientModule { | ||
|
||
override val id: String = "scommons-admin-client" | ||
|
||
override def base: File = file(id) | ||
|
||
override def definition: Project = { | ||
super.definition | ||
.enablePlugins(ScalaJSBundlerPlugin, ScalaJSWeb, SbtWeb) | ||
.settings( | ||
coverageEnabled := false, | ||
|
||
scalaJSUseMainModuleInitializer := true, | ||
webpackBundlingMode := BundlingMode.LibraryOnly(), | ||
|
||
//dev | ||
webpackConfigFile in fastOptJS := Some(baseDirectory.value / "admin.webpack.config.js"), | ||
//production | ||
webpackConfigFile in fullOptJS := Some(baseDirectory.value / "admin.webpack.config.js"), | ||
//reload workflow and tests | ||
webpackConfigFile in Test := Some(baseDirectory.value / "test.webpack.config.js") | ||
) | ||
} | ||
|
||
override val internalDependencies: Seq[ClasspathDep[ProjectReference]] = Seq( | ||
override def internalDependencies: Seq[ClasspathDep[ProjectReference]] = Seq( | ||
AdminClientApi.js | ||
) | ||
|
||
override val superRepoProjectsDependencies: Seq[(String, String, Option[String])] = Seq( | ||
("scommons-client", "scommons-client-ui", None) | ||
) | ||
|
||
override val runtimeDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting(Seq( | ||
Libs.scommonsClientUi.value | ||
)) | ||
override def runtimeDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting { | ||
super.runtimeDependencies.value ++ Seq( | ||
// specify your custom runtime dependencies here | ||
) | ||
} | ||
|
||
override val testDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting(Nil) | ||
override def testDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting { | ||
super.testDependencies.value ++ Seq[ModuleID]( | ||
// specify your custom test dependencies here | ||
).map(_ % "test") | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package definitions | ||
|
||
import common.Libs | ||
import sbt.Keys._ | ||
import sbt._ | ||
import scommons.sbtplugin.project.CommonModule | ||
|
||
trait AdminModule extends CommonModule { | ||
|
||
override val repoName = "scommons-admin" | ||
|
||
val scommonsServiceVersion: String = Libs.scommonsServiceVersion | ||
val scommonsClientVersion: String = Libs.scommonsClientVersion | ||
|
||
override def definition: Project = { | ||
super.definition | ||
.settings(AdminModule.settings: _*) | ||
} | ||
} | ||
|
||
object AdminModule { | ||
|
||
val settings: Seq[Setting[_]] = Seq( | ||
organization := "org.scommons.admin" | ||
) | ||
} |
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 |
---|---|---|
@@ -1,72 +1,36 @@ | ||
package definitions | ||
|
||
import com.typesafe.sbt.digest.Import.digest | ||
import com.typesafe.sbt.gzip.Import.gzip | ||
import com.typesafe.sbt.web.SbtWeb.autoImport._ | ||
import common.{Libs, TestLibs} | ||
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ | ||
import play.sbt.routes.RoutesKeys | ||
import play.sbt.{PlayImport, PlayLayoutPlugin, PlayScala} | ||
import sbt._ | ||
import scommons.sbtplugin.WebpackAssetsPlugin.autoImport._ | ||
import scoverage.ScoverageKeys.coverageExcludedPackages | ||
import scommons.sbtplugin.project.CommonPlayModule | ||
import webscalajs.WebScalaJS.autoImport._ | ||
|
||
import scalajsbundler.sbtplugin.WebScalaJSBundlerPlugin | ||
|
||
object AdminServer extends BasicModule { | ||
object AdminServer extends AdminModule with CommonPlayModule { | ||
|
||
override val id: String = "scommons-admin-server" | ||
|
||
override def base: File = file(id) | ||
|
||
override def definition: Project = { | ||
super.definition | ||
.enablePlugins(PlayScala, WebScalaJSBundlerPlugin) | ||
.disablePlugins(PlayLayoutPlugin) | ||
.configs(IntegrationTest) | ||
.settings(Defaults.itSettings: _*) | ||
.settings( | ||
RoutesKeys.routesImport -= "controllers.Assets.Asset", //remove unused import warning from routes file | ||
coverageExcludedPackages := "<empty>;Reverse.*;router.*", | ||
|
||
scalaJSProjects := Seq(AdminClient.definition), | ||
pipelineStages in Assets := Seq(scalaJSPipeline), | ||
pipelineStages := Seq(digest, gzip), | ||
|
||
// Expose as sbt-web assets some webpack build files of the `client` project | ||
//npmAssets ++= WebpackAssets.ofProject(ShowcaseClient.definition) { build => (build / "styles").*** }.value | ||
webpackAssets in fastOptJS ++= WebpackAssets.ofProject(fastOptJS, AdminClient.definition) { build => (build / "styles").*** }.value, | ||
webpackAssets in fullOptJS ++= WebpackAssets.ofProject(fullOptJS, AdminClient.definition) { build => (build / "styles").*** }.value | ||
scalaJSProjects := Seq(AdminClient.definition) | ||
) | ||
} | ||
|
||
override val internalDependencies: Seq[ClasspathDep[ProjectReference]] = Seq( | ||
override def internalDependencies: Seq[ClasspathDep[ProjectReference]] = Seq( | ||
AdminClientApi.jvm | ||
) | ||
|
||
override val superRepoProjectsDependencies: Seq[(String, String, Option[String])] = Seq( | ||
("scommons-service", "scommons-service-play", None) | ||
) | ||
|
||
override val runtimeDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting(Seq( | ||
Libs.scommonsServicePlay.value, | ||
Libs.scommonsClientAssets.value, | ||
|
||
PlayImport.guice, | ||
Libs.play.value, | ||
Libs.scaldiPlay.value, | ||
Libs.slf4jApi.value, | ||
Libs.logback.value, | ||
Libs.swaggerPlay.value, | ||
Libs.swaggerAnnotations.value, | ||
Libs.swaggerUi.value | ||
)) | ||
override def runtimeDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting { | ||
super.runtimeDependencies.value ++ Seq( | ||
Libs.swaggerPlay.value, | ||
Libs.swaggerAnnotations.value, | ||
Libs.swaggerUi.value | ||
) | ||
} | ||
|
||
override val testDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting(Seq( | ||
TestLibs.scommonsApiPlayWs.value, | ||
TestLibs.scalaTestPlusPlay.value, | ||
TestLibs.akkaStreamTestKit.value, | ||
TestLibs.mockito.value | ||
).map(_ % "it,test")) | ||
override def testDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting { | ||
super.testDependencies.value ++ Seq[ModuleID]( | ||
TestLibs.scommonsApiPlayWs.value | ||
).map(_ % "it,test") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.