Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Update CMT plugin code #61

Merged
merged 2 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ jobs:

- name: Generate Tests Script using CMT
run: |
git config --global user.email "[email protected]"
git config --global user.name "Lunatech Labs"
(cd CMT/ && exec sbt "mainadm -dot -t ../runTests $GITHUB_WORKSPACE/course-repo")

- name: Run Tests
run: |
chmod +x runTests
export PATH=${PATH}:$GITHUB_WORKSPACE/CMT/bin
./runTests

create_release:
Expand Down Expand Up @@ -104,6 +107,7 @@ jobs:
- name: Studentify Repo
run: |
mkdir -p studentified
export PATH=${PATH}:$GITHUB_WORKSPACE/CMT/bin
git config --global user.email "[email protected]"
git config --global user.name "Lunatech Labs"
(cd CMT/ && exec sbt "studentify -dot -g ../lunatech-scala-2-to-scala3-course ../studentified")
Expand Down
4 changes: 3 additions & 1 deletion exercises/project/CommonSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import sbt.Keys._
import sbt._
import sbtstudent.AdditionalSettings
import dotty.tools.sbtplugin.DottyPlugin.autoImport.DottyCompatModuleID
import sbtstudent.StudentCommandsPlugin._


object CommonSettings {
Expand All @@ -41,7 +42,8 @@ object CommonSettings {
publishArtifact in packageDoc := false,
libraryDependencies ++= Dependencies.dependencies,
libraryDependencies ++= Dependencies.crossDependencies.map(_.withDottyCompat(scalaVersion.value)),
testFrameworks += new TestFramework("munit.Framework")
testFrameworks += new TestFramework("munit.Framework"),
shellPrompt := (state => renderCMTPrompt(state))
) ++
AdditionalSettings.initialCmdsConsole ++
AdditionalSettings.initialCmdsTestConsole ++
Expand Down
16 changes: 9 additions & 7 deletions exercises/project/StudentCommandsPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ object StudentCommandsPlugin extends AutoPlugin {
IO.readLines(new sbt.File(new sbt.File(Project.extract(state).structure.root), ".courseName")).head
}

override lazy val projectSettings: Seq[Def.Setting[State => String]] =
def renderCMTPrompt(state: State) = {
val exercise = Console.GREEN + extractCurrentExerciseDesc(state) + Console.RESET
val manRmnd = Console.GREEN + "man [e]" + Console.RESET
val prjNbrNme = extractProjectName(state)
s"$manRmnd > $prjNbrNme > $exercise > "
}

override def projectSettings: Seq[Def.Setting[State => String]] =
Seq(
shellPrompt := { state =>
val exercise = Console.GREEN + extractCurrentExerciseDesc(state) + Console.RESET
val manRmnd = Console.GREEN + "man [e]" + Console.RESET
val prjNbrNme = extractProjectName(state)
s"$manRmnd > $prjNbrNme > $exercise > "
}
shellPrompt := { state => renderCMTPrompt(state)}
)
}