Code Monkey home page Code Monkey logo

gbt's Introduction

Gradle Build Tool

CircleCI License: MIT

A plugin that enables the use of SBTs most recent compilers in Gradle Scala projects.

Installation

GBT is published as a Gradle plugin via plugins.gradle.org:

plugins {
    id 'com.github.bhuemer.gbt' version '0.2'
}

// By default it will use Scala 2.13.8, but you can configure the version.
scalac {
    scalaVersion '2.13.8'
}

// The plugin needs to be able to resolve SBT and Scala library/compiler 
// JARs as dependencies. You can use whatever repository you prefer though.
repositories {
    jcenter()
}

dependencies {
    // The plugin neither infers the Scala version from this dependency nor 
    // will it add it automatically for you. If you don't have it declared
    // compilation will fail.
    implementation 'org.scala-lang:scala-library:2.13.8'
}

Configuration

Similar to the built-in Scala plugin this one mostly depends on Zinc for the actual compilation. The plugin will automatically resolve the correct compiler bridges for you based on the scalaVersion you have provided, but in more complicated cases you can also specify those manually. For example, this is how you would configure a build.gradle file for Scala 3:

plugins {
    id 'com.github.bhuemer.gbt' version '0.2'
}

scalac {
    scalaVersion = '3.0.2'
}

repositories {
    mavenCentral()
}

dependencies {
    implementation "org.scala-lang:scala3-library_3:3.0.2"
}

Next steps

  • Actually implement / make use of incremental compilation. At the moment this plugin just uses the RawCompiler as I wanted to sort out classpath and project set-up issues first before tackling incremental compilation.
  • Scaladoc generation task
  • Better configuration for the compiler (e.g. allowing users to pass all the various language feature flags)

gbt's People

Contributors

bhuemer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.