-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8bafa2f
Showing
15 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
cache: 'sbt' | ||
cache-dependency-path: | | ||
sub-project/build.sbt | ||
sub-project/project/build.properties | ||
- uses: sbt/setup-sbt@v1 | ||
|
||
- run: sbt test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2025 James Earl Douglas | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
 | ||
|
||
This is a [Giter8][g8] template for [sbt-frege]. | ||
|
||
[g8]: http://www.foundweekends.org/giter8/ | ||
[sbt-frege]: https://github.com/earldouglas/sbt-frege | ||
|
||
## Usage | ||
|
||
``` | ||
sbt new earldouglas/sbt-frege.g8 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This build is for this Giter8 template. | ||
// To test the template run `g8` or `g8Test` from the sbt session. | ||
// See https://www.foundweekends.org/giter8/testing.html#Using+the+Giter8Plugin for more details. | ||
lazy val root = (project in file(".")) | ||
.settings( | ||
name := "sbt-frege Template Project", | ||
Test / test := { | ||
val _ = (Test / g8Test).toTask("").value | ||
}, | ||
resolvers += Resolver.url("typesafe", url("https://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.10.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
addSbtPlugin("org.foundweekends.giter8" %% "sbt-giter8" % "0.17.0") | ||
libraryDependencies += { "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
let | ||
jdk = pkgs.jdk11; | ||
in | ||
pkgs.mkShell { | ||
nativeBuildInputs = [ | ||
(pkgs.sbt.override { jre = jdk; }) | ||
]; | ||
shellHook = '' | ||
export JAVA_HOME=${jdk} | ||
PATH="${jdk}/bin:$PATH" | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
version = 3.4.3 // https://scalameta.org/scalafmt/docs/installation.html#sbt | ||
runner.dialect = scala3 // https://scalameta.org/scalafmt/docs/configuration.html#scala-3 | ||
maxColumn = 72 // RFC 678: https://datatracker.ietf.org/doc/html/rfc678 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
val scala3Version = "3.6.3" | ||
|
||
lazy val root = project | ||
.in(file(".")) | ||
.settings( | ||
name := "my-sbt-frege", | ||
version := "0.1.0-SNAPSHOT", | ||
|
||
fork := true, | ||
|
||
scalaVersion := scala3Version, | ||
|
||
libraryDependencies += "org.scalameta" %% "munit" % "1.0.0" % Test | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name=My Frege Project | ||
description=A project built with sbt-frege |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.10.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.earldouglas" % "sbt-frege" % "3.0.3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package example.HelloWorld where | ||
|
||
multiply :: Int -> Int -> Int | ||
multiply x y = x * y | ||
|
||
showMultiply :: Int -> Int -> String | ||
showMultiply x y = | ||
let | ||
result = multiply x y | ||
in | ||
unwords [ | ||
show x, | ||
"*", | ||
show y, | ||
"=", | ||
show result, | ||
] | ||
|
||
main :: [String] -> IO () | ||
main _ = do | ||
x = showMultiply 6 7 | ||
println x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package example | ||
|
||
import frege.run8.Thunk | ||
import munit.FunSuite | ||
|
||
class HelloWorldSuite extends FunSuite { | ||
|
||
test("multiply") { | ||
|
||
val obtained = HelloWorld.multiply(6, 7) | ||
val expected = 42 | ||
|
||
assertEquals(obtained, expected) | ||
} | ||
|
||
test("showWork") { | ||
|
||
val x = Thunk.`lazy`(6) | ||
val y = Thunk.`lazy`(7) | ||
|
||
val obtained = HelloWorld.showMultiply(x, y) | ||
val expected = "6 * 7 = 42" | ||
|
||
assertEquals(obtained, expected) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
> test | ||
> run |