This repository has been archived by the owner on Feb 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completes work on 0.0.x branch (#22)
* Reviews Bintray setup. Small fixes to complete a 0.0.1 release and publish. Remove root from publishable list Skip release of 0.0.1 Improves publishing logic Setting version to 0.0.2 Setting version to 0.0.3-SNAPSHOT Setting version to 0.0.3 Setting version to 0.0.4-SNAPSHOT Fixes binary package name Enable Sonatype on runtimelib projects Setting version to 0.0.4 Setting version to 0.0.5-SNAPSHOT Massive folder rename and build-sbt refactor Review publishTo for root Enables release settings on root project Setting version to 0.0.5 Setting version to 0.0.6-SNAPSHOT * Disable mvn publish * Reset to version 0.0.1 * Enable publishing root * Adds bintray settings to root * restores package name on binary settings * Disable root publish * Adds a dummy bontrayPackageVersion * Adds dummy metadata for sbt-bintray * Adds version to default project, removes unnecessary attributes * Main project should not go to bintray * main project is a lib * renamre root to root * Roo prj needs bintray settings * I don't know what I?m doing anymore * remove root from the releasing cirlce * Root has all plugins * adds version on root * Enable bintray settings on all projects * Makes bintrayPackage explicit for root * Downgrade sbt-bintray as a workaround * Bumps to 0.0.2-SNAPSHOT and adds pom extra info * Setting version to 0.0.2 * Setting version to 0.0.3-SNAPSHOT
- Loading branch information
Showing
29 changed files
with
241 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,166 +1,131 @@ | ||
import bintray.Keys._ | ||
import com.typesafe.sbt.SbtScalariform | ||
import com.typesafe.sbt.SbtScalariform.ScalariformKeys | ||
import sbt.Keys.{ crossScalaVersions, libraryDependencies, scalacOptions, unmanagedSourceDirectories } | ||
|
||
import sbt.ScriptedPlugin | ||
import scala.collection.immutable | ||
import scalariform.formatter.preferences._ | ||
import sbt.Keys.{ crossScalaVersions, homepage, libraryDependencies } | ||
|
||
import de.heikoseeberger.sbtheader._ | ||
|
||
// --------------- SETTINGS --------------- | ||
|
||
lazy val `root` = (project in file(".")) | ||
.enablePlugins(AutomateHeaderPlugin) | ||
lazy val commonSettings = | ||
Seq( | ||
organization := "com.lightbend.lagom", | ||
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
homepage := Some(url("https://github.com/lagom/sbt-lagom-descriptor-generator")), | ||
sonatypeProfileName := "com.lightbend", | ||
// Scala settings | ||
scalaVersion := Version.scala, | ||
crossScalaVersions := List(scalaVersion.value, "2.10.6"), | ||
|
||
pomExtra := { | ||
<scm> | ||
<url>https://github.com/lagom/sbt-lagom-descriptor-generator</url> | ||
<connection>scm:git:git@github.com:lagom/sbt-lagom-descriptor-generator.git</connection> | ||
</scm> | ||
<developers> | ||
<developer> | ||
<id>lagom</id> | ||
<name>Lagom Contributors</name> | ||
<url>https://github.com/lagom</url> | ||
</developer> | ||
</developers> | ||
}, | ||
pomIncludeRepository := { _ => false } | ||
|
||
) | ||
|
||
// --------------- ROOT ------------------ | ||
|
||
lazy val root = (project in file(".")) | ||
.enablePlugins(AutomateHeaderPlugin && Sonatype && BintrayPlugin) | ||
.settings(name := "sbt-lagom-descriptor-generator") | ||
.aggregate( | ||
`generator-api`, | ||
`lagom-descriptor-generator-api`, | ||
`openapi-parser`, | ||
`lagom-renderer-javadsl`, | ||
`lagom-renderer-scaladsl`, | ||
`runner`, | ||
`lagom-descriptor-renderer-javadsl`, | ||
`lagom-descriptor-renderer-scaladsl`, | ||
`lagom-descriptor-generator`, | ||
`lagom-descriptor-generator-sbt-plugin` | ||
) | ||
.settings(commonSettings: _*) | ||
|
||
lazy val commonSettings = Seq( | ||
organization := "com.lightbend.lagom", | ||
// Scala settings | ||
scalaVersion := Version.scala, | ||
crossScalaVersions := List(scalaVersion.value, "2.10.6"), | ||
headers := headers.value ++ Map( | ||
"scala" -> ( | ||
HeaderPattern.cStyleBlockComment, | ||
"""|/* | ||
| * Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com> | ||
| */ | ||
|""".stripMargin | ||
), | ||
"java" -> ( | ||
HeaderPattern.cStyleBlockComment, | ||
"""|/* | ||
| * Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com> | ||
| */ | ||
|""".stripMargin | ||
) | ||
), scalacOptions ++= List( | ||
"-unchecked", | ||
"-deprecation", | ||
"-language:_", | ||
"-target:jvm-1.7", // target "jvm-1.8" was not added until scala 2.11.5 (https://issues.scala-lang.org/browse/SI-8966) | ||
"-encoding", "UTF-8" | ||
), | ||
unmanagedSourceDirectories in Compile := List((scalaSource in Compile).value), | ||
unmanagedSourceDirectories in Test := List((scalaSource in Test).value), | ||
unmanagedSourceDirectories in IntegrationTest := List((scalaSource in Test).value) | ||
) | ||
|
||
lazy val commonScalariformSettings: immutable.Seq[Setting[_]] = | ||
SbtScalariform.scalariformSettings ++ Seq( | ||
// Scalariform settings | ||
ScalariformKeys.preferences := ScalariformKeys.preferences.value | ||
.setPreference(AlignSingleLineCaseStatements, true) | ||
.setPreference(AlignSingleLineCaseStatements.MaxArrowIndent, 100) | ||
.setPreference(DoubleIndentClassDeclaration, true) | ||
.setPreference(DanglingCloseParenthesis, Force) | ||
.settings(librarySettings: _*) | ||
.settings( | ||
publishLocal := {}, | ||
publishArtifact in Compile := false, | ||
publish := {} | ||
). | ||
settings( | ||
// this is required during release because for some reason the version value is not available. | ||
version := version.value, | ||
bintrayPackage := bintrayPackage.value | ||
) | ||
|
||
// not used | ||
lazy val bintraySettings = Seq( | ||
// Release + Bintray settings | ||
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
publishMavenStyle := false | ||
) ++ | ||
bintrayPublishSettings ++ | ||
Seq( | ||
repository in bintray := "sbt-plugins", | ||
bintrayOrganization in bintray := Some("sbt-lagom-descriptor-generator") | ||
) | ||
// --------------- PROJECTS --------------- | ||
|
||
lazy val scripteTestsSettings = | ||
scriptedSettings ++ | ||
Seq( | ||
scriptedLaunchOpts += { | ||
version apply { v => s"-Dproject.version=$v" } | ||
}.value | ||
) | ||
def RootPlugins = AutomateHeaderPlugin && Sonatype && BintrayPlugin | ||
def RuntimeLibPlugins = AutomateHeaderPlugin && Sonatype && PluginsAccessor.exclude(BintrayPlugin) | ||
def SbtPluginPlugins = AutomateHeaderPlugin && PluginsAccessor.exclude(Sonatype) && BintrayPlugin | ||
|
||
// copy/pasted from Lagom's build.sbt | ||
def RuntimeLibPlugins = AutomateHeaderPlugin | ||
//def RuntimeLibPlugins = AutomateHeaderPlugin && Sonatype && PluginsAccessor.exclude(BintrayPlugin) | ||
//def SbtPluginPlugins = AutomateHeaderPlugin && BintrayPlugin && PluginsAccessor.exclude(Sonatype) | ||
lazy val librarySettings = commonSettings ++ | ||
Settings.headerLicenseSettings ++ | ||
Settings.commonScalariformSettings ++ | ||
Settings.bintraySettings ++ | ||
Settings.releaseSettings | ||
|
||
lazy val sbtPluginSettings = librarySettings ++ | ||
Settings.publishMavenStyleSettings ++ | ||
Settings.scriptedTestsSettings | ||
|
||
lazy val `lagom-descriptor-generator-sbt-plugin` = project | ||
.in(file("lagom-descriptor-generator-sbt-plugin")) | ||
.settings(scripteTestsSettings: _*) | ||
// .enablePlugins(SbtPluginPlugins) // copy/pasted from Lagom's build.sbt | ||
.enablePlugins(SbtPluginPlugins) | ||
.settings(sbtPluginSettings) | ||
.settings( | ||
name := "lagom-descriptor-generator-sbt-plugin", | ||
sbtPlugin := true, | ||
commonScalariformSettings, | ||
commonSettings | ||
).dependsOn(`runner`) | ||
|
||
lazy val `runner` = project | ||
.in(file("runner")) | ||
.enablePlugins(RuntimeLibPlugins) // copy/pasted from Lagom's build.sbt | ||
.configs(IntegrationTest) | ||
.settings( | ||
commonSettings, | ||
commonScalariformSettings, | ||
Defaults.itSettings, | ||
libraryDependencies ++= List( | ||
Library.scalaTest % "test,it" | ||
) | ||
) | ||
.dependsOn( | ||
`openapi-parser`, | ||
`lagom-renderer-javadsl`, | ||
`lagom-renderer-scaladsl` | ||
) | ||
|
||
|
||
lazy val `lagom-renderer-javadsl` = project | ||
.in(file("lagom-renderers") / "javadsl") | ||
.enablePlugins(RuntimeLibPlugins) // copy/pasted from Lagom's build.sbt | ||
.settings( | ||
commonSettings, | ||
commonScalariformSettings, | ||
libraryDependencies ++= List( | ||
Library.scalaTest % "test" | ||
publishTo := { | ||
if (isSnapshot.value) { | ||
// Bintray doesn't support publishing snapshots, publish to Sonatype snapshots instead | ||
Some(Opts.resolver.sonatypeSnapshots) | ||
} else publishTo.value | ||
}, | ||
publishMavenStyle := isSnapshot.value | ||
).dependsOn(`lagom-descriptor-generator`) | ||
|
||
lazy val `lagom-descriptor-generator` = | ||
(project in file("lagom-descriptor-generator")) | ||
.enablePlugins(RuntimeLibPlugins) | ||
.settings(librarySettings) | ||
.configs(IntegrationTest) | ||
.dependsOn(`openapi-parser`, `lagom-descriptor-renderer-javadsl`, `lagom-descriptor-renderer-scaladsl`) | ||
.settings( | ||
Defaults.itSettings, | ||
libraryDependencies += Library.scalaTest % "test,it" | ||
) | ||
).dependsOn(`generator-api`) | ||
|
||
lazy val `lagom-renderer-scaladsl` = project | ||
.in(file("lagom-renderers") / "scaladsl") | ||
.enablePlugins(RuntimeLibPlugins) // copy/pasted from Lagom's build.sbt | ||
.settings( | ||
commonSettings, | ||
commonScalariformSettings, | ||
libraryDependencies ++= List( | ||
Library.scalaTest % "test" | ||
lazy val `lagom-descriptor-renderer-javadsl` = | ||
(project in file("lagom-renderers") / "javadsl") | ||
.enablePlugins(RuntimeLibPlugins) | ||
.settings(librarySettings) | ||
.dependsOn(`lagom-descriptor-generator-api`) | ||
.settings(libraryDependencies += Library.scalaTest % "test") | ||
|
||
lazy val `lagom-descriptor-renderer-scaladsl` = | ||
(project in file("lagom-renderers") / "scaladsl") | ||
.enablePlugins(RuntimeLibPlugins) | ||
.settings(librarySettings) | ||
.dependsOn(`lagom-descriptor-generator-api`) | ||
.settings(libraryDependencies += Library.scalaTest % "test") | ||
|
||
lazy val `openapi-parser` = | ||
|
||
(project in file("spec-parsers") / "openapi") | ||
.enablePlugins(RuntimeLibPlugins) | ||
.settings(librarySettings) | ||
.dependsOn(`lagom-descriptor-generator-api`) | ||
.settings( | ||
libraryDependencies ++= List(Library.swaggerParser, Library.scalaTest % "test") | ||
) | ||
).dependsOn(`generator-api`) | ||
|
||
lazy val `openapi-parser` = project | ||
.in(file("spec-parsers") / "openapi") | ||
.enablePlugins(RuntimeLibPlugins) // copy/pasted from Lagom's build.sbt | ||
.settings( | ||
commonSettings, | ||
commonScalariformSettings, | ||
libraryDependencies ++= List( | ||
Library.swaggerParser, | ||
Library.scalaTest % "test" | ||
) | ||
).dependsOn(`generator-api`) | ||
lazy val `lagom-descriptor-generator-api` = | ||
(project in file("lagom-descriptor-generator-api")) | ||
.enablePlugins(RuntimeLibPlugins) | ||
.settings(librarySettings) | ||
.settings(libraryDependencies += Library.scalaTest % "test") | ||
|
||
lazy val `generator-api` = project | ||
.in(file("generator-api")) | ||
.enablePlugins(RuntimeLibPlugins) // copy/pasted from Lagom's build.sbt | ||
.settings( | ||
commonSettings, | ||
commonScalariformSettings, | ||
libraryDependencies ++= List( | ||
Library.scalaTest % "test" | ||
) | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...erator-sbt-plugin/src/main/scala/com/lightbend/lagom/spec/sbt/LagomOpenApiGenerator.scala
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
3 changes: 3 additions & 0 deletions
3
...generator-sbt-plugin/src/main/scala/com/lightbend/lagom/spec/sbt/LagomOpenApiPlugin.scala
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...avadsl/src/test/scala/com/lightbend/lagom/spec/render/JavaLagomDescriptorRenderSpec.scala
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package sbt | ||
|
||
/** | ||
* Work around sbts private[sbt] on some plugin functions | ||
*/ | ||
object PluginsAccessor { | ||
|
||
/** | ||
* Exclude a plugin | ||
*/ | ||
def exclude(plugin: AutoPlugin): Plugins.Basic = Plugins.Exclude(plugin) | ||
} |
Oops, something went wrong.