Skip to content

[Internal] Releasing sscheck

Juan Rodriguez Hortala edited this page Oct 3, 2016 · 1 revision

Hosting the maven artifact

Hosting with Artifactory / JFrog

See instructions at https://www.jfrog.com/open-source/#os-bin. It's free for open source projects, and [sbt is hosted there](ahi https://bintray.com/sbt)

There is a sbt plugin for bintray, that allows to publish artifacts from sbt projects. Following the instructions:

  • sign up to bintray https://bintray.com/signup/index. Note you can login with your github account
  • add addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") to project/plugins.sbt
  • check that sbt version is 0.13.8 or newer with sbt sbtVersion, and update if needed
  • start sbt and reload the project if needed to load the plugin. Now run bintrayChangeCredentials from sbt use the bintray API key that is located at profile -> edit after loigin in bintray. That creates a file at ~/.bintray/.credentials (in Windows that is C:\Users\juanrh\.bintray\.credentials)
  • use bintrayWhoami to check the credentials are ok. See the plugin instructions for how to use a bintray organization
  • add a license adding licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")) to build.sbt. See plugin instructions for other licences
  • add labels adding bintrayPackageLabels := Seq("testing") to build.sbt. I don't add Spark in case it is a trademark. See plugin instructions for adding other metadata
  • if the project is not already created in bintray, add bintrayVcsUrl := Some("[email protected]:juanrh/sscheck.git") to build.sbt so bintray is able to import it from github.
  • edit the value of version at build.sbt, as it will be used to generate the release at bintray. Note bintray doesn't accept version names like "0.2.1-SNAPSHOT", so use semantic versioning versions like "0.2.1". Also add organization := "es.ucm.fdi"
  • run +publish is sbt to publish to bin tray for all the version of Scala, or just publish for the version of Scala active in the sbt session (see below for changing this). A new package should be created at https://bintray.com/juanrh/maven/sscheck. Configure the web site and some details.
  • go to https://bintray.com/juanrh/maven/sscheck/view and in "Linked to" select "Add to JCenter". Use es.ucm.fdi as groupid for the project, and wait for an answer in your bintray inbox

Using the dependency in another project

Add the following to build.sbt

lazy val sscheckVersion = "0.2.0"
libraryDependencies += "es.ucm.fdi" %% "sscheck" % sscheckVersion
resolvers += Resolver.bintrayRepo("juanrh", "maven")

for a suitable value for sscheckVersion.

For local development use SBT publish-local feature.

  • in sscheck build.sbt change the version to a value ending in "SNAPSHOT", e.g. 0.2.1-SNAPSHOT. Make modifications, and in sbt run reload and then publish-local, or +publish-local for publishing for several versions of Scala.
  • in the dependent project build.sbt update the dependency to sscheck to the new version and in sbt run reload, update and eclipse. As usual use -Xsource:2.10 -Ymacro-expand:none

Deleting package versions

See "to delete versions, packages or repos".

Cross scala project

This pull request introduced support for several Scala versions at the same time. In order to deal with that:

  • References
  • Use sbt +test for testing for all versions. Also the first time you run it this will fail, have to run sbt clean before. In general modify all Jenkins jobs to do a clean before, as that is a minimal isolation that we should be having anyway.
  • Use ++<scala version> in sbt to set an Scala version, for example ++2.10.6. This is useful if I want to test for a particular scala version, or if I want to run eclipse to generate a Eclipse project for a particular version. Remember I had to use single quotes for non interactively launching a complex sbt goal in Jenkins, like sbt 'test-only es.ucm.fdi.tfg.*'
    • in particular use sbt ++2.10.6 eclipse to generate an Eclipse project for Scala 2.10.6