-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
95 lines (88 loc) · 3.22 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
lazy val scala212 = "2.12.19"
lazy val scala213 = "2.13.15"
lazy val scala3 = "3.3.4"
lazy val allScala = Seq(scala212, scala213, scala3)
ThisBuild / organization := "com.anymindgroup"
ThisBuild / organizationName := "AnyMind Group"
ThisBuild / organizationHomepage := Some(url("https://anymindgroup.com"))
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / homepage := Some(url("https://github.com/AnyMindGroup/sbt-skunk-codegen"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/AnyMindGroup/sbt-skunk-codegen"),
"scm:git@github.com:AnyMindGroup/sbt-skunk-codegen.git",
)
)
ThisBuild / description := "SBT plugin for generating source code from Postgres database schema."
ThisBuild / developers := List(
Developer("rolang", "Roman Langolf", "@rolang", url("https://github.com/rolang")),
Developer("dutch3883", "Panuwach Boonyasup", "@dutch3883", url("https://github.com/dutch3883")),
Developer("qhquanghuy", "Huy Nguyen", "@qhquanghuy", url("https://github.com/qhquanghuy")),
Developer("alialiusefi", "Ali Al-Yousefi", "@alialiusefi", url("https://github.com/alialiusefi"))
)
ThisBuild / sonatypeCredentialHost := xerial.sbt.Sonatype.sonatypeCentralHost
lazy val betterFilesVersion = "3.9.2"
lazy val commonSettings = List(
libraryDependencies ++= {
if (scalaVersion.value == scala3)
Seq()
else
Seq(compilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"))
},
version ~= { v => if (v.contains('+')) s"${v.replace('+', '-')}-SNAPSHOT" else v },
Test / scalacOptions --= Seq("-Xfatal-warnings"),
)
lazy val sbtSkunkCodegen = (project in file("."))
.dependsOn(core, sbtPlugin)
.aggregate(core, sbtPlugin)
.settings(noPublishSettings)
val noPublishSettings = List(
publish := {},
publishLocal := {},
publishArtifact := false,
publish / skip := true,
)
val releaseSettings = List(
publishTo := sonatypePublishToBundle.value
)
lazy val core = (project in file("modules/core"))
.settings(
name := "skunk-codegen",
scalaVersion := scala213,
crossScalaVersions := allScala,
javacOptions ++= Seq("-source", "17"),
Compile / scalacOptions ++= {
if (scalaVersion.value == scala3)
Seq("-source:future")
else if (scalaVersion.value == scala213)
Seq(
"-Ymacro-annotations",
"-Xsource:3",
"-Wconf:cat=scala3-migration:s",
) // https://github.com/scala/scala/pull/10439
else
Seq("-Xsource:3")
},
libraryDependencies ++= Seq(
"dev.rolang" %% "dumbo" % "0.0.9",
"com.github.pathikrit" %% "better-files" % betterFilesVersion,
),
)
.settings(commonSettings)
.settings(releaseSettings)
lazy val sbtPlugin = (project in file("modules/sbt"))
.enablePlugins(SbtPlugin)
.dependsOn(core)
.aggregate(core)
.settings(commonSettings)
.settings(releaseSettings)
.settings(
name := "sbt-skunk-codegen",
sbtPluginPublishLegacyMavenStyle := false,
scalaVersion := scala212,
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
scriptedBufferLog := false,
)