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

missing parameter type: ver=> Version(ver) #248

Open
mdsabz opened this issue May 28, 2019 · 1 comment
Open

missing parameter type: ver=> Version(ver) #248

mdsabz opened this issue May 28, 2019 · 1 comment
Labels

Comments

@mdsabz
Copy link

mdsabz commented May 28, 2019

Hi,

With Play2.7 and sbt-version 1.2.8, had included sbt-release plugin. On refreshing the project, we get an error, missing parameter type: ver => Version(ver)

build.sbt has the following

lazy val root = (project in file(".")).enablePlugins(PlayScala, BuildInfoPlugin, GitVersioning, GitBranchPrompt)

//build info
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
buildInfoPackage := "eu.byjean"

//git
showCurrentGitBranch
git.useGitDescribe := true
git.baseVersion := "0.0.0"
val VersionRegex = "v([0-9]+.[0-9]+.[0-9]+)-?(.*)?".r
git.gitTagToVersionNumber := {
  case VersionRegex(v,"SNAPSHOT") => Some(s"$v-SNAPSHOT")
  case VersionRegex(v,"") => Some(v)
  case VersionRegex(v,s) => Some(s"$v-$s-SNAPSHOT")
  case v => None
}

// sbt native packager
publishTo := Some("temp" at "file:///tmp/repository")
makeDeploymentSettings(Universal, packageBin in Universal, "zip")

// sbt release
def setVersionOnly(selectVersion: Versions => String): ReleaseStep =  { st: State =>
  val vs = st.get(ReleaseKeys.versions).getOrElse(sys.error("No versions are set! Was this release part executed before inquireVersions?"))
  val selected = selectVersion(vs)

  st.log.info("Setting version to '%s'." format selected)
  val useGlobal =Project.extract(st).get(releaseUseGlobalVersion)
  val versionStr = (if (useGlobal) globalVersionString else versionString) format selected

  reapply(Seq(
    if (useGlobal) version in ThisBuild := selected
    else version := selected
  ), st)
}

lazy val setReleaseVersion: ReleaseStep = setVersionOnly(_._1)

// strip the qualifier off the input version, eg. 1.2.1-SNAPSHOT -> 1.2.1
//releaseVersion     := { ver => Version(ver).map(_.withoutQualifier.string).getOrElse(versionFormatError(_)) }


releaseVersion <<= (releaseVersionBump)( bumper=>{
      ver =>  Version(ver)
    .map(_.withoutQualifier)
    .map(_.bump(bumper.value).string).getOrElse(versionFormatError(_))
})

val showNextVersion = settingKey[String]("the future version once releaseNextVersion has been applied to it")
val showReleaseVersion = settingKey[String]("the future version once releaseNextVersion has been applied to it")
showReleaseVersion := (version, releaseVersion)((v,f)=>f(v))
showNextVersion := (version, releaseNextVersion)((v,f)=>f(v))

releaseProcess := Seq(
  checkSnapshotDependencies,
  inquireVersions,
  setReleaseVersion,
  runTest,
  tagRelease,
  // publishArtifacts,
  ReleaseStep(releaseStepTask(publish in Universal))  
)

Help appreciated.
mdsabz

@fagossa
Copy link

fagossa commented Feb 26, 2020

For future reference, this seems to solve the compile issue

releaseVersion := {
      ver => Version(ver)
        .map(_.withoutQualifier)
        .map(_.bump(releaseVersionBump.value).string)
        .getOrElse(versionFormatError(ver))
}

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

No branches or pull requests

3 participants