Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eed3si9n/ifdef

`@ifdef` is an annotation that implements conditional compilation in Scala
https://github.com/eed3si9n/ifdef

scala

Last synced: 2 months ago
JSON representation

`@ifdef` is an annotation that implements conditional compilation in Scala

Awesome Lists containing this project

README

        

ifdef
=====

`@ifdef` is an annotation that implements conditional compilation in Scala.

See https://eed3si9n.com/ifdef-in-scala-via-pre-typer-processing/ for details.

setup
-----

```scala
addSbtPlugin("com.eed3si9n.ifdef" % "sbt-ifdef" % "x.y.z")
```

usage
-----

```scala
package example

import com.eed3si9n.ifdef.ifdef

class A {
def foo: Int = 42
}

@ifdef("test")
class ATest extends munit.FunSuite {
test("hello") {
val actual = new A().foo
val expected = 42
assertEquals(actual, expected)
}
}
```

license
-------
ifdef is released under Apache License Version 2.0.