forked from tototoshi/sbt-slick-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from adRise/chunsenwang/plugin-enhance
plugin enhancement
- Loading branch information
Showing
23 changed files
with
542 additions
and
252 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 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 |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
/project/project/ | ||
/project/target/ | ||
/target/ | ||
/.idea/ | ||
/.bsp/ |
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,11 @@ | ||
version = "3.4.3" | ||
runner.dialect = scala213 | ||
preset = IntelliJ | ||
maxColumn = 120 | ||
docstrings.style = SpaceAsterisk | ||
docstrings.wrap = "no" | ||
newlines.beforeCurlyLambdaParams = multiline | ||
rewrite.rules = [Imports] | ||
rewrite.imports.sort = scalastyle | ||
rewrite.imports.groups = [["sbt\\..*"], ["java\\..*", "javax\\..*"], ["scala\\..*"]] | ||
rewrite.trailingCommas.style = keep |
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,69 +1,28 @@ | ||
import scalariform.formatter.preferences._ | ||
import scala.collection.JavaConverters._ | ||
import java.lang.management.ManagementFactory | ||
|
||
enablePlugins(SbtPlugin) | ||
import scala.collection.JavaConverters.* | ||
//import scalariform.formatter.preferences.* | ||
|
||
scalariformPreferences := scalariformPreferences.value | ||
.setPreference(AlignSingleLineCaseStatements, true) | ||
.setPreference(DoubleIndentConstructorArguments, true) | ||
.setPreference(DanglingCloseParenthesis, Preserve) | ||
enablePlugins(SbtPlugin) | ||
|
||
sbtPlugin := true | ||
|
||
name := """sbt-slick-codegen""" | ||
|
||
organization := "com.github.tototoshi" | ||
|
||
version := "2.0.0" | ||
|
||
crossSbtVersions := Seq("1.8.0") | ||
|
||
val slickVersion = SettingKey[String]("slickVersion") | ||
|
||
slickVersion := "3.3.3" | ||
organization := "com.tubitv" | ||
|
||
libraryDependencies ++= Seq( | ||
"com.typesafe.slick" %% "slick" % slickVersion.value, | ||
"com.typesafe.slick" %% "slick-codegen" % slickVersion.value | ||
"com.typesafe.slick" %% "slick" % Versions.slick, | ||
"com.typesafe.slick" %% "slick-codegen" % Versions.slick, | ||
"org.postgresql" % "postgresql" % Versions.postgresql, | ||
"com.github.docker-java" % "docker-java" % Versions.dockerJava, | ||
) | ||
addSbtPlugin("io.github.davidmweber" % "flyway-sbt" % Versions.flywaySbt) | ||
|
||
publishMavenStyle := true | ||
|
||
publishTo := { | ||
val nexus = "https://oss.sonatype.org/" | ||
if (version.value.trim.endsWith("SNAPSHOT")) Some("snapshots" at nexus + "content/repositories/snapshots") | ||
else Some("releases" at nexus + "service/local/staging/deploy/maven2") | ||
} | ||
|
||
publishTo := Some(if (isSnapshot.value) Repo.Jfrog.Tubins.sbtDev else Repo.Jfrog.Tubins.sbtRelease) | ||
ThisBuild / versionScheme := Some("early-semver") | ||
Test / publishArtifact := false | ||
|
||
pomExtra := | ||
<url>https://github.com/tototoshi/sbt-slick-codegen</url> | ||
<licenses> | ||
<license> | ||
<name>Apache License, Version 2.0</name> | ||
<url>https://www.apache.org/licenses/LICENSE-2.0.html</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<scm> | ||
<url>git@github.com:tototoshi/sbt-slick-codegen</url> | ||
<connection>scm:git:git@github.com:tototoshi/sbt-slick-codegen.git</connection> | ||
</scm> | ||
<developers> | ||
<developer> | ||
<id>tototoshi</id> | ||
<name>Toshiyuki Takahashi</name> | ||
<url>https://tototoshi.github.io</url> | ||
</developer> | ||
</developers> | ||
|
||
scriptedBufferLog := false | ||
scriptedLaunchOpts ++= ManagementFactory.getRuntimeMXBean.getInputArguments.asScala.toList.filter(a => | ||
Seq("-Xmx", "-Xms", "-XX", "-Dsbt.log.noformat").exists(a.startsWith) | ||
) | ||
scriptedLaunchOpts ++= Seq( | ||
"-Dplugin.version=" + version.value, | ||
"-Dslick.version=" + slickVersion.value | ||
scriptedLaunchOpts ++= ManagementFactory.getRuntimeMXBean.getInputArguments.asScala.toList.filter( | ||
a => Seq("-Xmx", "-Xms", "-XX", "-Dsbt.log.noformat").exists(a.startsWith) | ||
) | ||
scriptedLaunchOpts ++= Seq("-Dplugin.version=" + version.value, "-Dslick.version=" + Versions.slick) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import sbt.* | ||
|
||
object Repo { | ||
|
||
object Jfrog { | ||
private val domain = "tubins.jfrog.io" | ||
private val jFrogRoot = s"https://$domain" | ||
|
||
object Tubins { | ||
private val pathPrefix = "tubins" | ||
|
||
lazy val sbtDev: MavenRepository = "sbt-dev" at s"$jFrogRoot/$pathPrefix/sbt-dev" | ||
|
||
lazy val sbtRelease: MavenRepository = "sbt-release" at s"$jFrogRoot/$pathPrefix/sbt-release" | ||
|
||
lazy val jvmSnapshot: MavenRepository = "jvm-snapshot" at s"$jFrogRoot/$pathPrefix/jvm-snapshots" | ||
|
||
lazy val jvm: MavenRepository = "jvm-release" at s"$jFrogRoot/$pathPrefix/jvm" | ||
} | ||
} | ||
|
||
} |
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,6 @@ | ||
object Versions { | ||
val slick = "3.4.0" | ||
val postgresql = "42.6.0" | ||
val dockerJava = "3.3.4" | ||
val flywaySbt = "7.4.0" | ||
} |
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,23 @@ | ||
ThisBuild / credentials ++= { | ||
val logger = streams.value.log | ||
if (sys.env.contains("ARTIFACTORY_USERNAME")) { | ||
logger.info("spotted credential in env, will add to credentials") | ||
Some( | ||
Credentials( | ||
"Artifactory Realm", | ||
"tubins.jfrog.io", | ||
sys.env.getOrElse("ARTIFACTORY_USERNAME", ""), | ||
sys.env.getOrElse("ARTIFACTORY_PASSWORD", "") | ||
) | ||
) | ||
} else { | ||
Credentials.loadCredentials(Path.userHome / ".artifactory" / "credentials") match { | ||
case Right(credentials: DirectCredentials) => | ||
logger.info(s"Using credentials found in the home directory for host ${credentials.host}") | ||
Some(credentials) | ||
case Left(err: String) => | ||
logger.warn(s"Could not find artifactory credentials in home directory: $err") | ||
None | ||
} | ||
} | ||
} |
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,3 +1,3 @@ | ||
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.3") | ||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.18") | ||
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") | ||
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1") | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") | ||
|
Oops, something went wrong.