Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidgregory084/mill-tpolecat
scalac options for the enlightened
https://github.com/davidgregory084/mill-tpolecat
mill-module mill-plugin
Last synced: 3 months ago
JSON representation
scalac options for the enlightened
- Host: GitHub
- URL: https://github.com/davidgregory084/mill-tpolecat
- Owner: DavidGregory084
- License: apache-2.0
- Created: 2019-02-06T12:40:18.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T14:28:32.000Z (5 months ago)
- Last Synced: 2024-10-04T13:44:00.985Z (4 months ago)
- Topics: mill-module, mill-plugin
- Language: Scala
- Size: 78.1 KB
- Stars: 17
- Watchers: 5
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## mill-tpolecat
[![CI](https://github.com/DavidGregory084/mill-tpolecat/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/DavidGregory084/mill-tpolecat/actions/workflows/ci.yml)
[![License](https://img.shields.io/github/license/DavidGregory084/mill-tpolecat.svg)](https://opensource.org/licenses/Apache-2.0)
![Maven Central](https://img.shields.io/maven-central/v/io.github.davidgregory084/mill-tpolecat_mill0.10_2.13)### scalac options for the enlightened
mill-tpolecat is an extension for the [Mill build tool](https://github.com/lihaoyi/mill/) for automagically configuring scalac options according to the project Scala version, inspired by Rob Norris ([@tpolecat](https://github.com/tpolecat))'s excellent series of blog posts providing [recommended options](https://tpolecat.github.io/2017/04/25/scalac-flags.html) to get the most out of the compiler.
It has been tested with versions 0.10.x and 0.9.x of mill.
### Usage
Import the module in `build.sc` using mill's `$ivy` import syntax, and extend `TpolecatModule` in your build definition:
```scala
// build.scimport $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.2`
import io.github.davidgregory084.TpolecatModule
object core extends TpolecatModule {
def scalaVersion = "2.13.7"
}
```Don't forget to apply the mill platform suffix to your import according to the mill version that you are using.
If necessary you can filter out scalac options that are not appropriate for your project:
```scala
// build.scimport $ivy.`io.github.davidgregory084::mill-tpolecat_mill0.10:0.3.2`
import io.github.davidgregory084.TpolecatModule
object core extends TpolecatModule {
def scalaVersion = "2.13.7"
def scalacOptions = T { super.scalacOptions().filterNot(Set("-Yno-imports")) }
}
```### Caveat
I can't promise this plugin will work for old minor releases of Scala. It has been tested with:
* 2.13.7
* 2.12.11
* 2.11.12### License
All code in this repository is licensed under the Apache License, Version 2.0. See [LICENSE](./LICENSE).