Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/eed3si9n/ifdef
- Owner: eed3si9n
- License: apache-2.0
- Created: 2023-10-12T06:11:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-03T13:33:44.000Z (5 months ago)
- Last Synced: 2024-10-03T12:45:03.746Z (3 months ago)
- Topics: scala
- Language: Scala
- Homepage:
- Size: 39.1 KB
- Stars: 32
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 exampleimport 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.