Skip to content

Commit

Permalink
build: add gears as git submodule and gradle dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
tassiluca committed Jan 4, 2024
1 parent ef7d576 commit 6d6461a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/gears"]
path = lib/gears
url = https://github.com/lampepfl/gears.git
5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ plugins {
}

repositories {
mavenLocal() // used for gears dependency
mavenCentral()
}

dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.scala.stdlib)
implementation(libs.gears) // from maven local repository
testRuntimeOnly(libs.flexmark) // needed to make it works scalatest
testImplementation(libs.scalatest)
testImplementation(libs.bundles.kotlin.testing)
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mockito = "5.8.0"

[libraries]
scala-stdlib = { module = "org.scala-lang:scala3-library_3", version.ref = "scala" }
gears = "ch.epfl.lamp:gears_3:0.1.0-SNAPSHOT"
scalatest = "org.scalatest:scalatest_3:3.2.17"
flexmark = "com.vladsch.flexmark:flexmark-all:0.64.8"
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
Expand Down
1 change: 1 addition & 0 deletions lib/gears
Submodule gears added at 7df96b
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ gitHooks {
createHooks()
}

rootProject.name = "PPS-22-direct-style-experiments"
rootProject.name = "PPS-22-direct-style-experiments"
12 changes: 12 additions & 0 deletions src/main/scala/io/github/tassiLuca/gears/useGears.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.tassiLuca.gears

import gears.async.{Async, Future}
import gears.async.default.given

@main def useGears(): Unit =
Async.blocking:
val sum = Future:
val f1 = Future("Hello gears... ")
val f2 = Future("I'm happy to work with you :)")
f1.await + f2.await
println(sum.await)

0 comments on commit 6d6461a

Please sign in to comment.