Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve dependencies on SBT 0.13.15, using SNAPSHOT or v0.18 #216

Open
jmrunkle opened this issue Jul 1, 2019 · 0 comments
Open

Comments

@jmrunkle
Copy link

jmrunkle commented Jul 1, 2019

Here is my build.sbt

lazy val Benchmark = config("bench") extend Test

/**  This allows running ScalaMeter benchmarks in separate sbt configuration.
  *  It means, that when you want run your benchmarks you should type `bench:test` in sbt console.
  */
lazy val basic: Project = (project in file("."))
  .settings(Seq(
    name := "leap-year",
    organization := "com.storm-enroute",
    scalaVersion := "2.12.1",
    scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-Xlint"),
    publishArtifact := false,
    libraryDependencies ++= Seq(
      "com.storm-enroute" %% "scalameter" % version.value % "bench", // ScalaMeter version is set in version.sbt
      "org.scalatest" %% "scalatest" % "3.0.1" % "test"
    ),
    resolvers ++= Seq(
      "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
      "Sonatype OSS Releases" at "https://oss.sonatype.org/content/repositories/releases"
    ),
    testFrameworks += new TestFramework("org.scalameter.ScalaMeterFramework"),
    parallelExecution in Benchmark := false,
    logBuffered := false
  )
) configs(
  Benchmark
) settings(
  inConfig(Benchmark)(Defaults.testSettings): _*
)

Here is the version.sbt file:

version in ThisBuild := "0.18"

Here is project/build.properties:

sbt.version=0.13.15

Lastly, here is the simple benchmark I am trying to work with:

package leap.benchmark

import org.scalameter.api._

object RangeBenchmark
extends Bench.LocalTime {
  val years = Gen.range("year")(1, 9999, 1)

  def leapYear(year: Int) = year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
  def nonOptimalLeapYear(year: Int) = year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)

  performance of "Leap" in {
    measure method "leapYear" in {
      using(years) in {
        year => leapYear(year)
      }
    }
  }
}

From the root directory...

$ sbt
[info] Loading project definition from <REDACTED>/eap/project
[info] Set current project to leap-year (in build file:<REDACTED>/leap/)
> bench:test
[info] Updating {file:<REDACTED>/leap/}basic...
[info] Resolving jline#jline;2.14.1 ...
[info] Done updating.
[info] Compiling 2 Scala sources to <REDACTED>/leap/target/scala-2.12/test-classes...
[error] <REDACTED>/leap/src/test/scala/benchmark/LeapBenchmark.scala:3: object scalameter is not a member of package org
[error] import org.scalameter.api._

Any help I can get with setting this up so that I can actually run benchmarks would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant