Giter Club home page Giter Club logo

sbt-java-version's Introduction

sbt-java-version

Build Status

Summary

Ensures that code is compiled using targeted Java version, for example:

object MyBuild extends Build {
   override val settings = super.settings ++ Seq(
      javaVersion in ThisBuild  := "1.6", // global setting, checks that java version is compatible on start-up
                                          //   also default for rest of settings
      javaVersion in packageBin := "1.7", // sets X-Java-Version in manifest
      javaVersion in target := "1.6"      // sets target version for Java and Scala compilation
      javaVersion in javaSources := "1.6" // sets source version for Java sources
   )
}

Sets an MANIFEST.MF property X-Java-Version to a short version of javaVersion (e.g. "7" when javaVersion is set to "1.7")

Incrementally upgrade from Java 1.6 to Java 1.7

First, run with Java 7 (assuming your production jar runner scripts recognizes X-Java-Version)

javaVersion in ThisBuild := "1.6",
javaVersion in packageBin := "1.7"

Next, compile (and run) with Java 7

javaVersion in ThisBuild := "1.7",
javaVersion in target    := "1.6"

Lastly, compile to Java 7

javaVersion in ThisBuild := "1.7"

Usage

Not yet published to a Maven or Ivy central repository---please open up an Issue if you find this pl ugin useful and would like it published.

Workaround: compile locally and publish locally:

 sbt -DBUILD_NUMBER=1 publishLocal

sbt-java-version's People

Contributors

flicken avatar araqnid avatar ms-tg avatar

Watchers

Jeffrey Fredrick avatar  avatar Tony Tsui avatar Francesco Gigli avatar Waseem Taj avatar Alex Conlin avatar James Cloos avatar  avatar  avatar Shafeen Tejani avatar Ian Davies avatar  avatar Richard Pearce avatar Mehul Shah avatar  avatar  avatar  avatar

sbt-java-version's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.