Coeur-Morny-Cono/build.sbt
Eyre_S 5aa63de2a9 add HTTP server and basic tstickers-api
- add HTTP server backend
  - with configurable listening port
    - default is 30179
    - cannot disable it yet
  - with UI service with a 523 image
  - with simple RESTful API service
- add basic tstickers-api
  - now can only get and output binary content without file-type tagging or converting
-
2024-02-04 23:58:15 +08:00

86 lines
2.9 KiB
Scala

aether.AetherKeys.aetherOldVersionMethod := true
ThisBuild / organization := "cc.sukazyo"
ThisBuild / organizationName := "A.C. Sukazyo Eyre"
ThisBuild / scalaVersion := "3.3.1"
resolvers ++= Seq(
"-ws-releases" at "https://mvn.sukazyo.cc/releases"
)
lazy val root = (project in file("."))
.enablePlugins(BuildInfoPlugin)
.settings(
name := "Coeur Morny Cono",
version := MornyProject.version,
crossPaths := false,
moduleName := MornyProject.app_archive_name,
Compile / packageDoc / publishArtifact := false,
artifactName := {(sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
val classifier = artifact.classifier match {
case Some(value) => s"-$value"
case None => ""
}
s"${module.name}-${MornyProject.version_full}$classifier.${artifact.extension}"
},
Compile / mainClass := Some(MornyProject.app_application_main),
libraryDependencies ++= MornyProject.dependencies,
buildInfoPackage := MornyProject.app_package,
buildInfoObject := "BuildConfig",
buildInfoKeys ++= Seq(
BuildInfoKey[String]("VERSION", MornyProject.version),
BuildInfoKey[String]("VERSION_FULL", MornyProject.version_full),
BuildInfoKey[String]("VERSION_BASE", MornyProject.version_base),
BuildInfoKey[Option[String]]("VERSION_DELTA", MornyProject.version_delta),
BuildInfoKey[String]("CODENAME", MornyProject.version_codename),
BuildInfoKey.action[Long]("CODE_TIMESTAMP") { MornyProject.code_time },
BuildInfoKey.action[String]("COMMIT") { MornyProject.git_commit },
BuildInfoKey.action[Boolean]("CLEAN_BUILD") { MornyProject.git_is_clean },
BuildInfoKey[String]("CODE_STORE", MornyProject.git_store),
BuildInfoKey[String]("COMMIT_PATH", MornyProject.git_store_path),
),
scalacOptions ++= Seq(
"-language:postfixOps",
"-encoding", MornyProject.source_encoding
),
javacOptions ++= Seq(
"-encoding", MornyProject.source_encoding,
"-source", "17",
"-target", "17"
),
autoAPIMappings := true,
assemblyMergeStrategy := {
case module if module endsWith "module-info.class" => MergeStrategy.concat
case module_kt if module_kt endsWith ".kotlin_module" => MergeStrategy.concat
case x =>
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
},
assembly / artifact := (assembly / artifact).value
.withClassifier(Some("fat")),
if (MornyProject.publishWithFatJar) {
addArtifact(assembly / artifact, assembly)
} else {
Nil
},
if (System.getenv("DOCKER_BUILD") != null) {
assembly / assemblyJarName := {
sLog.value info "environment DOCKER_BUILD checked"
sLog.value info "assembly will output for docker build (morny-coeur-docker-build.jar)"
"morny-coeur-docker-build.jar"
}
} else Nil,
publishTo := MornyProject.publishTo,
credentials ++= MornyProject.publishCredentials,
)