Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Build improvements

  • Loading branch information...
commit 0a070e000eb99ba4cb22507c5b4a304790fcc9f0 1 parent fa2a0f0
@mdr authored
View
21 cli/.classpath
@@ -1,11 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry output="bin" path="src/main/scala" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/main/java" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/test/scala" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/test/java" kind="src"></classpathentry>
- <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"></classpathentry>
- <classpathentry kind="lib" path="../lib_managed/jars/commons-io/commons-io/commons-io-1.4.jar" sourcepath="../lib_managed/srcs/commons-io/commons-io/commons-io-1.4-sources.jar"></classpathentry>
- <classpathentry exported="true" path="/scalariform" kind="src" combineaccessrules="false"></classpathentry>
- <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"></classpathentry>
- <classpathentry path="bin" kind="output"></classpathentry>
-</classpath>
+ <classpathentry kind="src" output="bin" path="src/main/scala"/>
+ <classpathentry kind="src" output="bin" path="src/main/java"/>
+ <classpathentry kind="src" output="bin" path="src/test/scala"/>
+ <classpathentry kind="src" output="bin" path="src/test/java"/>
+ <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
+ <classpathentry kind="lib" path="../lib_managed/jars/commons-io/commons-io/commons-io-1.4.jar" sourcepath="/lib_managed/srcs/commons-io/commons-io/commons-io-1.4-sources.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/scalariform"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
2  cli/src/main/scala/scalariform/commandline/Main.scala
@@ -27,7 +27,7 @@ object Main {
}
if (arguments contains Version) {
- println("Scalariform " + scalariform.VERSION + " (runtime Scala " + ScalaVersions.DEFAULT_VERSION + ")")
+ println("Scalariform " + scalariform.BuildInfo.version + " (runtime Scala " + ScalaVersions.DEFAULT_VERSION + ")")
return false
}
View
25 misc/.classpath
@@ -1,13 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry output="bin" path="src/main/scala" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/main/java" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/test/scala" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/test/java" kind="src"></classpathentry>
- <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"></classpathentry>
- <classpathentry kind="lib" path="../lib_managed/jars/commons-io/commons-io/commons-io-1.4.jar" sourcepath="../lib_managed/srcs/commons-io/commons-io/commons-io-1.4-sources.jar"></classpathentry>
- <classpathentry kind="lib" path="../lib_managed/jars/com.miglayout/miglayout/miglayout-3.7.4.jar" sourcepath="../lib_managed/srcs/com.miglayout/miglayout/miglayout-3.7.4-sources.jar"></classpathentry>
- <classpathentry exported="true" path="/scalariform" kind="src" combineaccessrules="false"></classpathentry>
- <classpathentry exported="true" path="/cli" kind="src" combineaccessrules="false"></classpathentry>
- <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"></classpathentry>
- <classpathentry path="bin" kind="output"></classpathentry>
-</classpath>
+ <classpathentry kind="src" output="bin" path="src/main/scala"/>
+ <classpathentry kind="src" output="bin" path="src/main/java"/>
+ <classpathentry kind="src" output="bin" path="src/test/scala"/>
+ <classpathentry kind="src" output="bin" path="src/test/java"/>
+ <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
+ <classpathentry kind="lib" path="../lib_managed/jars/commons-io/commons-io/commons-io-1.4.jar" sourcepath="/lib_managed/srcs/commons-io/commons-io/commons-io-1.4-sources.jar"/>
+ <classpathentry kind="lib" path="../lib_managed/jars/com.miglayout/miglayout/miglayout-3.7.4.jar" sourcepath="/lib_managed/srcs/com.miglayout/miglayout/miglayout-3.7.4-sources.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/cli"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/scalariform"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
4 misc/src/main/scala/scalariform/gui/FormatterFrame.scala
@@ -96,7 +96,7 @@ class FormatterFrame extends JFrame with SpecificFormatter {
setLayout(new BorderLayout)
- setTitle("Scalariform " + scalariform.VERSION)
+ setTitle("Scalariform " + scalariform.BuildInfo.version)
val textFont = new Font("monospaced", Font.PLAIN, 14)
@@ -169,7 +169,7 @@ class FormatterFrame extends JFrame with SpecificFormatter {
val duration = System.currentTimeMillis - startTime
val tokens = ScalaLexer.tokenise(inputText, scalaVersion = SCALA_VERSION)
val tokenCount = tokens.size
- setTitle("Scalariform " + scalariform.VERSION + " -- " + duration + "ms, " + tokenCount + " tokens, speed = " + (1000 * tokenCount / (duration + 1)) + " tokens/second")
+ setTitle("Scalariform " + scalariform.BuildInfo.version + " -- " + duration + "ms, " + tokenCount + " tokens, speed = " + (1000 * tokenCount / (duration + 1)) + " tokens/second")
outputTextPane.setText(outputText)
if (showAstCheckBox.isSelected) {
View
27 project/.classpath
@@ -0,0 +1,27 @@
+<classpath>
+ <classpathentry output="target/scala-2.9.1/classes" path="src/main/scala" kind="src"></classpathentry>
+ <classpathentry output="target/scala-2.9.1/classes" path="src/main/java" kind="src"></classpathentry>
+ <classpathentry output="target/scala-2.9.1/test-classes" path="src/test/scala" kind="src"></classpathentry>
+ <classpathentry output="target/scala-2.9.1/test-classes" path="src/test/java" kind="src"></classpathentry>
+ <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"></classpathentry>
+ <classpathentry path="./lib_managed/jars/com.github.retronym/sbt-onejar/scala_2.9.1/sbt_0.11.2/sbt-onejar-0.7.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.9.1/sbt_0.11.2/sbteclipse-plugin-2.1.0-SNAPSHOT.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/com.typesafe.sbteclipse/sbteclipse-core/scala_2.9.1/sbt_0.11.2/sbteclipse-core-2.1.0-SNAPSHOT.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/org.scalaz/scalaz-core_2.9.1/scalaz-core_2.9.1-6.0.3.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/com.typesafe.sbtscalariform/sbtscalariform/scala_2.9.1/sbt_0.11.2/sbtscalariform-0.3.0.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/org.scalariform/scalariform_2.9.1/scalariform_2.9.1-0.1.1.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/com.jsuereth/xsbt-gpg-plugin/scala_2.9.1/sbt_0.11.2/xsbt-gpg-plugin-0.6.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/com.jsuereth/gpg-library_2.9.1/gpg-library_2.9.1-0.6.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/org.bouncycastle/bcpg-jdk16/bcpg-jdk16-1.46.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/org.bouncycastle/bcprov-jdk16/bcprov-jdk16-1.46.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/net.databinder/dispatch-http_2.9.1/dispatch-http_2.9.1-0.8.6.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/net.databinder/dispatch-core_2.9.1/dispatch-core_2.9.1-0.8.6.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/org.apache.httpcomponents/httpclient/httpclient-4.1.2.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/org.apache.httpcomponents/httpcore/httpcore-4.1.2.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/commons-logging/commons-logging/commons-logging-1.1.1.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/commons-codec/commons-codec/commons-codec-1.4.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/net.databinder/dispatch-futures_2.9.1/dispatch-futures_2.9.1-0.8.6.jar" kind="lib"></classpathentry>
+ <classpathentry path="./lib_managed/jars/com.eed3si9n/sbt-buildinfo/scala_2.9.1/sbt_0.11.2/sbt-buildinfo-0.1.1.jar" kind="lib"></classpathentry>
+ <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"></classpathentry>
+ <classpathentry path="bin" kind="output"></classpathentry>
+</classpath>
View
12 project/.project
@@ -0,0 +1,12 @@
+<projectDescription>
+ <name>default-719b99</name>
+ <buildSpec>
+ <buildCommand>
+ <name>org.scala-ide.sdt.core.scalabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.scala-ide.sdt.core.scalanature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
65 project/Build.scala
@@ -3,7 +3,6 @@ import sbt.Keys._
import com.github.retronym.SbtOneJar
import com.typesafe.sbteclipse.core.EclipsePlugin.EclipseKeys._
import com.typesafe.sbteclipse.core.EclipsePlugin._
-
import com.typesafe.sbtscalariform.ScalariformPlugin
import com.typesafe.sbtscalariform.ScalariformPlugin.ScalariformKeys
import scalariform.formatter.preferences._
@@ -15,55 +14,59 @@ object ScalariformBuild extends Build {
version := "0.1.3-SNAPSHOT",
scalaVersion := "2.9.2",
crossScalaVersions := Seq("2.8.0", "2.8.1", "2.8.2", "2.9.0", "2.9.1", "2.9.2"),
- resolvers += ScalaToolsSnapshots,
+ exportJars := true, // Needed for cli oneJar
retrieveManaged := true,
scalacOptions += "-deprecation",
- pomExtra := pomExtraXml,
- parallelExecution in Test := false,
- publishMavenStyle := true,
- publishArtifact in Test := false,
- // Workaround for package object Scaladoc error (https://github.com/harrah/xsbt/issues/85):
- unmanagedClasspath in Compile += Attributed.blank(file("doesnotexist")),
- pomIncludeRepository := { _ => false },
EclipseKeys.withSource := true,
EclipseKeys.eclipseOutput := Some("bin"))
lazy val subprojectSettings = commonSettings ++ Seq(
- ScalariformKeys.preferences <<= baseDirectory.apply(dir PreferencesImporterExporter.loadPreferences((dir / ".." / "formatterPreferences.properties").getPath)))
+ ScalariformKeys.preferences <<= baseDirectory.apply(getScalariformPreferences))
+
+ def getScalariformPreferences(dir: File) =
+ PreferencesImporterExporter.loadPreferences((dir / ".." / "formatterPreferences.properties").getPath)
lazy val root: Project = Project("root", file("."), settings = commonSettings ++ Seq(
publish := (),
- publishLocal := ()
- )) aggregate (scalariform, cli, misc)
+ publishLocal := ())) aggregate (scalariform, cli, misc)
- lazy val scalariform: Project = Project("scalariform", file("scalariform"), settings = subprojectSettings ++
- Seq(
- libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps)
- val scalatestVersion = sv match {
- case "2.8.0" "org.scalatest" %% "scalatest" % "1.3.1.RC2" % "test"
- case "2.10.0-M3" "org.scalatest" % "scalatest_2.10.0-M3" % "1.8-SNAPSHOT" % "test"
- case _ "org.scalatest" %% "scalatest" % "1.7.2" % "test"
- }
- deps :+ scalatestVersion
- },
- exportJars := true, // Needed for cli oneJar
- publishTo <<= isSnapshot(
- if (_) Some("snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
- else Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"))
- ))
+ def getScalaTestDependency(scalaVersion: String) = scalaVersion match {
+ case "2.8.0" "org.scalatest" %% "scalatest" % "1.3.1.RC2" % "test"
+ case "2.10.0-M3" "org.scalatest" % "scalatest_2.10.0-M3" % "1.8-SNAPSHOT" % "test"
+ case _ "org.scalatest" %% "scalatest" % "1.7.2" % "test"
+ }
+
+ lazy val scalariform: Project = Project("scalariform", file("scalariform"), settings =
+ subprojectSettings ++ sbtbuildinfo.Plugin.buildInfoSettings ++ eclipseSettings ++
+ Seq(
+ libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) deps :+ getScalaTestDependency(sv) },
+ pomExtra := pomExtraXml,
+ publishMavenStyle := true,
+ publishArtifact in Test := false,
+ pomIncludeRepository := { _ false },
+ sbtbuildinfo.Plugin.buildInfoKeys := Seq[Scoped](version),
+ sbtbuildinfo.Plugin.buildInfoPackage := "scalariform",
+ sourceGenerators in Compile <+= sbtbuildinfo.Plugin.buildInfo,
+ EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Managed,
+ publishTo <<= isSnapshot(getPublishToRepo)))
+
+ def getPublishToRepo(isSnapshot: Boolean) =
+ if (isSnapshot) Some("snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
+ else Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
lazy val cli = Project("cli", file("cli"), settings = subprojectSettings ++ SbtOneJar.oneJarSettings ++
Seq(
libraryDependencies += "commons-io" % "commons-io" % "1.4",
mainClass in (Compile, packageBin) := Some("scalariform.commandline.Main"),
+ artifactName in SbtOneJar.oneJar := { (config: String, module: ModuleID, artifact: Artifact) "scalariform.jar" },
publish := (),
- publishLocal := (),
- artifactName in SbtOneJar.oneJar := { (config: String, module: ModuleID, artifact: Artifact) "scalariform.jar" })) dependsOn (scalariform)
+ publishLocal := ())) dependsOn (scalariform)
lazy val misc: Project = Project("misc", file("misc"), settings = subprojectSettings ++
Seq(
- libraryDependencies += "commons-io" % "commons-io" % "1.4",
- libraryDependencies += "com.miglayout" % "miglayout" % "3.7.4",
+ libraryDependencies ++= Seq(
+ "commons-io" % "commons-io" % "1.4",
+ "com.miglayout" % "miglayout" % "3.7.4"),
publish := (),
publishLocal := (),
mainClass in (Compile, run) := Some("scalariform.gui.Main"))) dependsOn (scalariform, cli)
View
9 project/plugins.sbt
@@ -1,4 +1,4 @@
-resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
+resolvers += Classpaths.typesafeResolver
resolvers += Resolver.url(
"sbt-plugin-releases",
@@ -15,4 +15,9 @@ addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.3.0")
resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
-addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")
+addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")
+
+addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.1.1")
+
+retrieveManaged := true
+
View
4 project/project/plugins.sbt
@@ -0,0 +1,4 @@
+resolvers += Classpaths.typesafeSnapshots
+
+addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-SNAPSHOT")
+
View
21 scalariform/.classpath
@@ -1,10 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry output="bin" path="src/main/scala" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/main/java" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/test/scala" kind="src"></classpathentry>
- <classpathentry output="bin" path="src/test/java" kind="src"></classpathentry>
- <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"></classpathentry>
- <classpathentry kind="lib" path="../lib_managed/jars/org.scalatest/scalatest_2.9.2/scalatest_2.9.2-1.7.2.jar" sourcepath="../lib_managed/srcs/org.scalatest/scalatest_2.9.2/scalatest_2.9.2-1.7.2-sources.jar"></classpathentry>
- <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"></classpathentry>
- <classpathentry path="bin" kind="output"></classpathentry>
-</classpath>
+ <classpathentry kind="src" output="bin" path="src/main/scala"/>
+ <classpathentry kind="src" output="bin" path="src/main/java"/>
+ <classpathentry kind="src" output="bin" path="target/scala-2.9.2/src_managed/main"/>
+ <classpathentry kind="src" output="bin" path="src/test/scala"/>
+ <classpathentry kind="src" output="bin" path="src/test/java"/>
+ <classpathentry kind="src" output="bin" path="target/scala-2.9.2/src_managed/test"/>
+ <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
+ <classpathentry kind="lib" path="../lib_managed/jars/org.scalatest/scalatest_2.9.2/scalatest_2.9.2-1.7.2.jar" sourcepath="/lib_managed/srcs/org.scalatest/scalatest_2.9.2/scalatest_2.9.2-1.7.2-sources.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
6 scalariform/src/main/scala/scalariform/package.scala
@@ -1,6 +0,0 @@
-package object scalariform {
-
- val VERSION = "0.1.3-SNAPSHOT"
-
-}
-
Please sign in to comment.
Something went wrong with that request. Please try again.