https://github.com/frege/sbt-frege
Frege support for sbt
https://github.com/frege/sbt-frege
frege frege-repl sbt sbt-plugin
Last synced: 5 months ago
JSON representation
Frege support for sbt
- Host: GitHub
- URL: https://github.com/frege/sbt-frege
- Owner: Frege
- License: bsd-3-clause
- Created: 2015-07-30T20:47:08.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2025-03-22T22:58:11.000Z (7 months ago)
- Last Synced: 2025-03-31T08:06:20.660Z (6 months ago)
- Topics: frege, frege-repl, sbt, sbt-plugin
- Language: Scala
- Homepage:
- Size: 156 KB
- Stars: 53
- Watchers: 7
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/earldouglas/sbt-frege/actions)
[](https://index.scala-lang.org/earldouglas/sbt-frege)## Features
* Compile Frege code from your project's *src/main/frege/* directory
* Call Frege code from your project's Java/Scala/etc. code
* Launch the [Frege REPL][1] with your project's classes and libraries## Requirements
* sbt 1.0.1+
* Scala 2.4.0+*For sbt 0.13.6+ projects, use sbt-frege version 1.1.3*
## Getting started from a template
```
$ sbt new earldouglas/sbt-frege.g8
A project built with sbt-fregename [My Frege Project]: hello frege
Template applied in ./hello-frege
$ cd hello-frege/
$ sbt
> test
example.HelloWorldSuite:
+ multiply 0.008s
+ showWork 0.016s
[info] Passed: Total 2, Failed 0, Errors 0, Passed 2
> run
[info] 6 * 7 = 42
```## Getting started from scratch
Add the Frege sbt plugin to your project:
*project/plugins.sbt:*
```scala
addSbtPlugin("com.earldouglas" % "sbt-frege" % "3.0.3")
```Write some Frege code:
*src/main/frege/example/HelloWorld.fr:*
```frege
package example.HelloWorld wheremain :: [String] -> IO ()
main _ = println "Hello, world!"
```Build and run it:
```
$ sbt
> compile
> run
Hello, world!
```Try it from the Frege REPL:
```
$ sbt
> fregeReplfrege> import example.HelloWorld (main)
frege> main []
Hello, world!
()
```## Configuration
### Frege compiler
* `fregeOptions: Seq[String]` - Extra options for fregec
* `fregeSource: File` - Frege source directory (default
*src/main/frege/*)
* `fregeTarget: File` - Frege target directory (default *target/frege/*)
* `fregeCompiler: String` - Full name of the Frege compiler (default
*frege.compiler.Main*)
* `fregeLibrary: ModuleID` - Frege library (fregec.jar) to use (default
*Frege 3.23.288*)### Frege REPL
* `fregeReplVersion: String` - The version of [frege-repl][1] to use
(default 1.3)
* `fregeReplMainClass: String` - The Frege REPL main class (default
`frege.repl.FregeRepl`)Though sbt-frege uses 3.24.100.1 by default, Frege REPL 1.3 depends on
Frege 3.23.288, so it takes priority when launching `fregeRepl`.[1]: https://github.com/Frege/frege-repl