mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2025-07-08 00:21:00 +02:00
feat(connector): start VDMJ connection
This commit is contained in:
parent
507c4b5f6d
commit
609c8393ae
@ -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)
|
||||
}
|
BIN
connector/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
connector/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -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
|
||||
|
@ -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()
|
||||
}
|
33
connector/src/main/kotlin/VDMJ.kt
Normal file
33
connector/src/main/kotlin/VDMJ.kt
Normal 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)
|
||||
}
|
||||
|
||||
}
|
1
connector/src/main/resources/checklist.vdmsl
Symbolic link
1
connector/src/main/resources/checklist.vdmsl
Symbolic link
@ -0,0 +1 @@
|
||||
/home/smyalygames/Documents/dissertation/formal/checklist.vdmsl
|
Loading…
x
Reference in New Issue
Block a user