feat(connector): start VDMJ connection

This commit is contained in:
Anthony 2024-03-30 17:48:44 +01:00
parent 507c4b5f6d
commit 609c8393ae
6 changed files with 43 additions and 17 deletions

View File

@ -10,12 +10,14 @@ repositories {
}
dependencies {
implementation("dk.au.ece.vdmj:vdmj:4.5.0")
testImplementation("org.jetbrains.kotlin:kotlin-test")
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
}
jvmToolchain(21)
}

Binary file not shown.

View File

@ -1,6 +1,6 @@
#Fri Mar 29 14:51:10 CET 2024
#Fri Mar 29 17:41:10 CET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -1,16 +1,6 @@
package io.anthonyberg
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
fun main() {
val name = "Kotlin"
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
println("Hello, " + name + "!")
for (i in 1..5) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
println("i = $i")
}
}
// Open VDMJ
val VDMJ = VDMJ()
}

View File

@ -0,0 +1,33 @@
package io.anthonyberg
import com.fujitsu.vdmj.ExitStatus
import com.fujitsu.vdmj.Settings
import com.fujitsu.vdmj.config.Properties
import com.fujitsu.vdmj.plugins.Lifecycle
import com.fujitsu.vdmj.plugins.VDMJ
import kotlin.system.exitProcess
/**
* Handler for the VDM Model
*/
class VDMJ {
init {
Settings.mainClass = VDMJ::class.java
Properties.init()
val lifecycle: Lifecycle = createLifecycle()
exitProcess(if (lifecycle.run() == ExitStatus.EXIT_OK) 0 else 1)
}
/**
* Creates arguments for VDMJ
*/
private fun createLifecycle(): Lifecycle {
// Creates the arguments for VDMJ - i.e. where the file is located
val args: Array<String> = arrayOf("resources/checklist.vdmsl")
return Lifecycle(args)
}
}

View File

@ -0,0 +1 @@
/home/smyalygames/Documents/dissertation/formal/checklist.vdmsl