From 29ef6610f74477c77ef6540a839dd49c2f040e05 Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Tue, 29 Nov 2016 12:20:34 +0300 Subject: move from Build.scala to build.sbt --- project/SbtJniBuild.scala | 87 ----------------------------------------------- project/Version.scala | 4 +++ 2 files changed, 4 insertions(+), 87 deletions(-) delete mode 100644 project/SbtJniBuild.scala create mode 100644 project/Version.scala (limited to 'project') diff --git a/project/SbtJniBuild.scala b/project/SbtJniBuild.scala deleted file mode 100644 index c0fd7fb..0000000 --- a/project/SbtJniBuild.scala +++ /dev/null @@ -1,87 +0,0 @@ -import sbt._ -import sbt.Keys._ -import sbt.ScriptedPlugin._ - -import sbtdoge.CrossPerProjectPlugin - -import scalariform.formatter.preferences._ -import com.typesafe.sbt.SbtScalariform -import com.typesafe.sbt.SbtScalariform.ScalariformKeys - -object SbtJniBuild extends Build { - - val scalaVersions: Seq[String] = List("2.11.8", "2.10.6", "2.12.0") - val macrosParadiseVersion = "2.1.0" - - val commonSettings = Seq( - organization := "ch.jodersky", - licenses := Seq(("BSD New", url("http://opensource.org/licenses/BSD-3-Clause"))), - scalacOptions ++= Seq("-deprecation", "-feature"), - resolvers += Resolver.sonatypeRepo("releases"), - ScalariformKeys.preferences := ScalariformKeys.preferences.value - .setPreference(DoubleIndentClassDeclaration, true) - .setPreference(DanglingCloseParenthesis, Preserve) - .setPreference(MultilineScaladocCommentsStartOnFirstLine, true) - .setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, true) - ) - - lazy val root = Project( - id = "root", - base = file("."), - aggregate = Seq( - macros, plugin - ), - settings = commonSettings ++ Seq( - publish := {}, - publishLocal := {}, - // make sbt-pgp happy - publishTo := Some(Resolver.file("Unused transient repository", target.value / "unusedrepo")) - ) ++ addCommandAlias("test-plugin", ";+sbt-jni-macros/publishLocal;scripted") - ).enablePlugins(CrossPerProjectPlugin) - - lazy val macros = Project( - id = "sbt-jni-macros", - base = file("macros"), - settings = commonSettings ++ Seq( - scalaVersion := scalaVersions.head, - crossScalaVersions := scalaVersions, - addCompilerPlugin("org.scalamacros" % "paradise" % macrosParadiseVersion cross CrossVersion.full), - libraryDependencies += "org.typelevel" %% "macro-compat" % "1.1.1", - libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided, - libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value - ) - ) - - lazy val plugin = Project( - id = "sbt-jni", - base = file("plugin"), - settings = commonSettings ++ scriptedSettings ++ Seq( - sbtPlugin := true, - publishMavenStyle := false, - scalaVersion := "2.10.6", - crossScalaVersions := Seq(scalaVersion.value), - - libraryDependencies += "org.ow2.asm" % "asm" % "5.0.4", - - // make project settings available to source - sourceGenerators in Compile += Def.task{ - val src = s"""|/* Generated by sbt */ - |package ch.jodersky.sbt.jni - | - |private[jni] object ProjectVersion { - | final val MacrosParadise = "${macrosParadiseVersion}" - | final val Macros = "${version.value}" - |} - |""".stripMargin - val file = sourceManaged.value / "ch" / "jodersky" / "sbt" / "jni" / "ProjectVersion.scala" - IO.write(file, src) - Seq(file) - }.taskValue, - scriptedLaunchOpts := Seq( - "-Dplugin.version=" + version.value, - "-XX:MaxPermSize=256m", "-Xmx2g", "-Xss2m" - ) - ) - ) - -} diff --git a/project/Version.scala b/project/Version.scala new file mode 100644 index 0000000..bc96fa1 --- /dev/null +++ b/project/Version.scala @@ -0,0 +1,4 @@ +object Version { + val scala: Seq[String] = List("2.11.8", "2.10.6", "2.12.0") + val macrosParadise = "2.1.0" +} \ No newline at end of file -- cgit v1.2.3