diff options
Diffstat (limited to 'project')
-rw-r--r-- | project/Dependencies.scala | 44 | ||||
-rw-r--r-- | project/Publish.scala | 50 | ||||
-rw-r--r-- | project/Release.scala | 80 | ||||
-rw-r--r-- | project/Settings.scala | 65 | ||||
-rw-r--r-- | project/VersionWithSHA.scala | 28 | ||||
-rw-r--r-- | project/plugins.sbt | 14 |
6 files changed, 2 insertions, 279 deletions
diff --git a/project/Dependencies.scala b/project/Dependencies.scala deleted file mode 100644 index 14d837e4..00000000 --- a/project/Dependencies.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* ========================================================================================= - * Copyright © 2013-2016 the kamon project <http://kamon.io/> - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - * ========================================================================================= - */ - -import sbt._ -import Keys._ - -object Dependencies { - - val resolutionRepos = Seq( - "typesafe repo" at "http://repo.typesafe.com/typesafe/releases/", - "Kamon Repository Snapshots" at "http://snapshots.kamon.io" - ) - - val aspectJ = "org.aspectj" % "aspectjweaver" % "1.8.10" - val hdrHistogram = "org.hdrhistogram" % "HdrHistogram" % "2.1.9" - val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.7" - val slf4jnop = "org.slf4j" % "slf4j-nop" % "1.7.7" - val logback = "ch.qos.logback" % "logback-classic" % "1.0.13" - val scalatest = "org.scalatest" %% "scalatest" % "3.0.1" - - def akkaDependency(moduleName: String) = Def.setting { - scalaBinaryVersion.value match { - case "2.10" | "2.11" => "com.typesafe.akka" %% s"akka-$moduleName" % "2.3.15" - case "2.12" => "com.typesafe.akka" %% s"akka-$moduleName" % "2.4.14" - } - } - - def compileScope (deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile") - def testScope (deps: ModuleID*): Seq[ModuleID] = deps map (_ % "test") - def providedScope (deps: ModuleID*): Seq[ModuleID] = deps map (_ % "provided") - def optionalScope (deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile,optional") -} diff --git a/project/Publish.scala b/project/Publish.scala deleted file mode 100644 index ddb64d2d..00000000 --- a/project/Publish.scala +++ /dev/null @@ -1,50 +0,0 @@ -/* ========================================================================================= - * Copyright © 2013-2014 the kamon project <http://kamon.io/> - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - * ========================================================================================= - */ - -import sbt._ -import sbt.Keys._ - -object Publish { - - lazy val settings = Seq( - crossPaths := true, - pomExtra := kamonPomExtra, - publishTo := kamonRepo, - organization := "io.kamon", - pomIncludeRepository := { x => false }, - publishMavenStyle := true, - publishArtifact in Test := false - ) - - def kamonRepo = Some(Resolver.sftp("Kamon Snapshots Repository", "snapshots.kamon.io", "/var/local/snapshots-repo")) - - def kamonPomExtra = { - <url>http://kamon.io</url> - <licenses> - <license> - <name>Apache 2</name> - <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> - </license> - </licenses> - <scm> - <url>git://github.com/kamon-io/Kamon.git</url> - <connection>scm:git:git@github.com:kamon-io/Kamon.git</connection> - </scm> - <developers> - <developer><id>ivantopo</id><name>Ivan Topolnjak</name><url>https://twitter.com/ivantopo</url></developer> - <developer><id>dpsoft</id><name>Diego Parra</name><url>https://twitter.com/diegolparra</url></developer> - </developers> - } -} diff --git a/project/Release.scala b/project/Release.scala deleted file mode 100644 index a388a66f..00000000 --- a/project/Release.scala +++ /dev/null @@ -1,80 +0,0 @@ -/* ========================================================================================= - * Copyright © 2013-2014 the kamon project <http://kamon.io/> - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - * ========================================================================================= - */ - -import com.typesafe.sbt.pgp._ -import sbt._ -import sbt.Keys._ -import sbtrelease.ReleasePlugin._ -import sbtrelease.ReleaseStateTransformations._ -import sbtrelease.ReleaseStep -import sbtrelease.Utilities._ -import xerial.sbt.Sonatype._ - -object Release { - - def settings = Seq.empty ++ - releaseSettings ++ - Seq( - ReleaseKeys.releaseProcess := Seq[ReleaseStep]( - checkSnapshotDependencies, - inquireVersions, - runClean, - runTest, - setReleaseVersion, - commitReleaseVersion, // .copy(check = identity), // FIX 0: to skip "all changes committed" precondition - tagRelease, - publishSignedArtifacts, // FIX 1: publish signed. Otherwise sonatype won't sync artifact to maven central - setNextVersion, - commitNextVersion, - pushChanges, - refreshVersionWithSHA // FIX 2: update "version" by replacing the "-SNAPSHOT" with "-WHATEVER_COMMIT_SHA" - ) - ) ++ - sonatypeSettings ++ - Seq( - // sbt-sonatype overrides publishTo. So we need to restore kamon repo declaration for snapshots - publishTo := { if (isSnapshot.value) Publish.kamonRepo else publishTo.value } - ) - - - def kamonSonatypeCredentials = - Credentials.toDirect(Credentials(Path.userHome / ".ivy2" / "kamon-credentials-sonatype.properties")) - - /** - * Hijacked from [[sbtrelease.ReleaseStateTransformations.publishArtifacts]] - */ - lazy val publishSignedArtifacts = ReleaseStep( - action = { st: State => - val extracted = st.extract - val ref = extracted.get(thisProjectRef) - extracted.runAggregated(PgpKeys.publishSigned in Global in ref, st) - }, - check = st => { - // getPublishTo fails if no publish repository is set up. - val ex = st.extract - val ref = ex.get(thisProjectRef) - Classpaths.getPublishTo(ex.get(publishTo in Global in ref)) - st - }, - enableCrossBuild = true - ) - - lazy val refreshVersionWithSHA = ReleaseStep(st => { - reapply(Seq( - version in ThisBuild := VersionWithSHA.kamonVersionWithSHA(st.extract.get(version)) - ), st) - }) - -}
\ No newline at end of file diff --git a/project/Settings.scala b/project/Settings.scala deleted file mode 100644 index 2b6b093d..00000000 --- a/project/Settings.scala +++ /dev/null @@ -1,65 +0,0 @@ -/* ========================================================================================= - * Copyright © 2013-2016 the kamon project <http://kamon.io/> - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - * ========================================================================================= - */ - -import sbt._ -import Keys._ -import com.typesafe.sbt.SbtScalariform -import com.typesafe.sbt.SbtScalariform.ScalariformKeys -import Publish.{settings => publishSettings} -import Release.{settings => releaseSettings} -import scalariform.formatter.preferences._ - -object Settings { - - val SVersion = "2.12.1" - - lazy val basicSettings = Seq( - ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }, - scalaVersion := SVersion, - crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.1"), - resolvers ++= Dependencies.resolutionRepos, - fork in run := true, - parallelExecution in Global := false, - scalacOptions := commonScalacOptions, - javacOptions := commonJavaOptions - ) ++ publishSettings ++ releaseSettings - - lazy val commonJavaOptions = Seq("-Xlint:-options") - - lazy val commonScalacOptions = Seq( - "-encoding", - "utf8", - "-g:vars", - "-feature", - "-unchecked", - "-deprecation", - "-language:postfixOps", - "-language:implicitConversions", - "-Xlog-reflective-calls", - "-Ywarn-dead-code" - ) - - lazy val formatSettings = SbtScalariform.scalariformSettings ++ Seq( - ScalariformKeys.preferences in Compile := formattingPreferences, - ScalariformKeys.preferences in Test := formattingPreferences - ) - - def formattingPreferences = - FormattingPreferences() - .setPreference(RewriteArrowSymbols, true) - .setPreference(AlignParameters, false) - .setPreference(AlignSingleLineCaseStatements, true) - .setPreference(DoubleIndentClassDeclaration, true) -} diff --git a/project/VersionWithSHA.scala b/project/VersionWithSHA.scala deleted file mode 100644 index 58139f7f..00000000 --- a/project/VersionWithSHA.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* ========================================================================================= - * Copyright © 2013-2016 the kamon project <http://kamon.io/> - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the - * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - * ========================================================================================= - */ - -import sbt.Process - -object VersionWithSHA { - - private lazy val VersionWithShaRegex = """(?:\d+\.)?(?:\d+\.)?(?:\d+)-[0-9a-f]{5,40}""" - - /** Don't use this. You should use version.value instead. */ - def kamonVersionWithSHA(version: String) = version.takeWhile(_ != '-') + "-" + Process("git rev-parse HEAD").lines.head - - /** Don't use this. You should use isSnapshot.value instead. */ - def kamonIsSnapshot(version: String) = (version matches VersionWithShaRegex) || (version endsWith "-SNAPSHOT") - -}
\ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index 7cd8953d..5d8fc573 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,13 +1,3 @@ -resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" - -resolvers += "Kamon Releases" at "http://repo.kamon.io" - -addSbtPlugin("com.typesafe.sbt" % "sbt-aspectj" % "0.10.6") -addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.8.2") -addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.2.1") -addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1") -addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.1") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.18") - +resolvers += Resolver.bintrayIvyRepo("kamon-io", "sbt-plugins") +addSbtPlugin("io.kamon" % "kamon-sbt-umbrella" % "0.0.5") |