I have a bunch of projects that use SBT 0.13, but I'm presently running SBT 0.12, with global plugins specific to it. Is there any way I can have both versions on my machine?
Generally, there are these points to consider:
The launcher version used. sbt 0.13 launchers should support building with sbt 0.12, but 0.12 launchers cannot build with sbt 0.13 because of a JLine change.
Global plugins. Global plugins for sbt 0.13 should go in ~/.sbt/0.13/ by default. For compatibility, 0.13 has to read from plain ~/.sbt/ as well, however. A solution is to change the 0.12 startup script to look in ~/.sbt/0.12/. For example:
java ... -Dsbt.global.base=/home/user/.sbt/0.12/ ...
sbt 0.13 fixes several Ivy cache issues, but it cannot always detect corruption due to sbt 0.12.
Related
I need to get acquainted specifically with elm 0.16.XX because some project I am working on is using it, and long story short,e.g. the version cannot be changed. Also, as you guys know there is a significant change between 0.16 and later elm versions. I am doing an online video course that has the 0.16.XX version but when I install elm, it naturally installs the latest version. How can I install the older versions?
The info I see online says to just change in elm.json, the version numbers of dependencies you need, but the problem is that the names of the dependencies have also changed. e.g in a basic hello world project,
0.16.xx
"elm-lang/core": 5.1.1, "elm-lang/html": 2.0.0, "elm-lang/virtual dom": 2.0.4
as opposed to modern elm
"elm/core": 1.0.5, "elm/html": 1.0.0, "elm/virtual-dom": 1.0.3
So how do I go about installing older elm i.e 0.16.XX. Any help is appreciated.
In theory, you could download the source code zip and try to build from sources but I remember people having a lot of trouble with the particular Haskell dependencies.
If the app is an Html based app that used evancz/start-app you might have some luck by first upgrading to 0.17.1. Take a look at https://github.com/elm-lang/elm-platform/blob/master/upgrade-docs/0.17.md
You might be able to install 0.17.1 with npm i -D elm#0.17.1.
elm.json is available only to 0.19 and 0.19.1 projects. The versions before that used elm-package.json
You can download Elm 0.16 installers for Windows and Mac Elm from the official releases.
https://github.com/elm/compiler/releases/tag/0.16.0
But I have no idea if installing the dependencies still works.
So maybe you'll need to incrementally upgrade your code, see https://github.com/elm-lang/elm-platform/tree/master/upgrade-docs
If that is too complicated, maybe you can ask in the Elm slack if someone can upgrade the code for you? E.g. with a small freelancer contract?
I want to write a plugin using scala 2.11
sbtPlugin := true
scalaVersion := "2.11.0"
The current sbt release (0.13.9) is built on scala 2.10.5
https://github.com/sbt/sbt/blob/0.13.9/build.sbt#L27
EDIT:
Does build against 2.11 in the community build.
https://scala-ci.typesafe.com/job/scala-2.11.x-integrate-community-build/lastSuccessfulBuild/consoleFull
[sbt] --== Extracting dependencies for sbt ==--
[sbt] Fetching https://github.com/sbt/sbt.git
[sbt] into /home/jenkins/workspace/scala-2.11.x-integrate-community-build/target-0.9.1/clones/d12473907f59fe78661e5f2a758557fe14df3ac6
[sbt] Took: 00h 00m 02.3s
[sbt] Fetching /home/jenkins/workspace/scala-2.11.x-integrate-community-build/target-0.9.1/clones/d12473907f59fe78661e5f2a758557fe14df3ac6
[sbt] into /home/jenkins/workspace/scala-2.11.x-integrate-community-build/target-0.9.1/extraction/18f58ea36720e88c2e79edce7efe5b626fc09a5e/projects/c2c0436b24853ab78d6f35ecf52a77248da4e537
[sbt] Took: 00h 00m 01.3s
[sbt] The following subprojects will be built in project sbt: launcher-interface, test-agent, control, io, datatype-generator, process, scripted-framework, interface, launcher, precompiled-2_8_2, relation, classpath, api, precompiled-2_9_2, logging, compile, run, classfile, scripted-sbt, testing, incremental-compiler, persist, compiler-integration, precompiled-2_9_3, compiler-interface, collections, completion, logic, apply-macro, tasks, task-system, cache, tracking, cross, ivy, compiler-ivy-integration, actions, command, main-settings, main, sbt, scripted-plugin
[sbt] --== End Extracting dependencies for sbt ==--
We can't break binary compatibility for all the sbt 0.13 plugins until we release the next version sbt 0.14 or potentially sbt 1.0, so no Scala 2.11.x sbt until then.
Update:
One way to work around this is to use Fork API. sbt 0.13 is capable of building Scala 2.11 source using Scala 2.11 compilers. You can mimic the way its done, and run Scala 2.10 or 2.11 code from sbt.
sbt now uses Scala 2.12
The current version of sbt is 1.2.8 (released 30th December 2018) and it supports Scala 2.12 since 1.0.0 (released 10th August 2017)
sbt 1.0 uses Scala 2.12 for build definitions and plugins. This also requires JDK 8.
https://www.scala-sbt.org/1.x/docs/sbt-1.0-Release-Notes.html#sbt+1.0.0
We simply skipped Scala 2.11 and went directly to 2.12.
I have just taken over a project using SBT 0.7.x and I am trying to convert it to use 0.12.3. The project has config as a *.java file and I can't find where some of the classes/objects that are used were moved to. I found a VERY small table in the migration docs, but is it not complete, for example it says that FileUtilities was moved to IO, which is true only for some of the functions. The following functions/classes/objects are nowhere to be found:
FileUtilities.copyFlat
FileUtilities.clean
Path.lazyPathFinder
BasicScalaProject
MavenStyleScalaPaths
DefaultProject
ProjectInfo
IdeaProject
Can someone please tell me where those went or where there is a complete log of changes?
I don't have a complete log of changes, but I did write an unofficial guide to sbt 0.10 v2.0, which lists some of the changes between 0.7 and modern sbt.
How can I force sbt 0.11 to fail when doing package or publish unless all the tests pass?
In build.sbt, add:
publish <<= publish dependsOn (test in Test)
(or the equivalent for package)
Im having a compatible issue, my project is develop in JDK 1.6, but when i need to post it to a host domain, there is a issue where the host domain used JDK 1.5, how do i make my project compatible with JDK 1.5? thanks in advance
You basically need to set the -target attribute. Also see javac /?.
javac -target 1.5 [...]
Also see this example in javac's documentation.
Update: as per the comments you're using Eclipse, you can just change the compiler compliance level on a per-project basis. Rightclick project > Properties > Java Compiler > Compiler compliance level > 1.5. See screenshot.
You can download JDK 1.5 from the Sun Archive.
You should be able to set the compliance level on your compiler / IDE to 1.5 so that any incompatibilities are flagged (via compiler warnings). You can then fix whatever needs to be done to make your code 1.5 compatible.
In Eclipse for example, you go to Preferences / Java / Compiler and set the compliance level to 1.5. It's probably something similar in other IDEs.