mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2025-07-08 00:11:00 +02:00
feat(connector): start VDMJ connection
This commit is contained in:
parent
507c4b5f6d
commit
609c8393ae
@ -10,12 +10,14 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation("dk.au.ece.vdmj:vdmj:4.5.0")
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
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
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
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
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -1,16 +1,6 @@
|
|||||||
package io.anthonyberg
|
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() {
|
fun main() {
|
||||||
val name = "Kotlin"
|
// Open VDMJ
|
||||||
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
|
val VDMJ = VDMJ()
|
||||||
// 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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
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