diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..58a6034c
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "lib/gears"]
+ path = lib/gears
+ url = https://github.com/lampepfl/gears.git
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index fdc392fe..d20b5975 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -16,5 +16,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index aa2480af..10a96976 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -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)
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index a4379d3d..8fdeb64d 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -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" }
diff --git a/lib/gears b/lib/gears
new file mode 160000
index 00000000..7df96bd7
--- /dev/null
+++ b/lib/gears
@@ -0,0 +1 @@
+Subproject commit 7df96bd78498af2c9919d4687f77ab6e879d756e
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 41b28c96..4a1f5912 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -9,4 +9,4 @@ gitHooks {
createHooks()
}
-rootProject.name = "PPS-22-direct-style-experiments"
\ No newline at end of file
+rootProject.name = "PPS-22-direct-style-experiments"
diff --git a/src/main/scala/io/github/tassiLuca/gears/useGears.scala b/src/main/scala/io/github/tassiLuca/gears/useGears.scala
new file mode 100644
index 00000000..41676e62
--- /dev/null
+++ b/src/main/scala/io/github/tassiLuca/gears/useGears.scala
@@ -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)