Skip to content
Draft
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
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ hs_err_pid*
replay_pid*

# End of https://www.toptal.com/developers/gitignore/api/java

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions Makefile

This file was deleted.

117 changes: 117 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import java.util.*

plugins {
`java-library`
}

repositories {
mavenCentral()
}

dependencies {
// Use JUnit Jupiter for testing.
testImplementation("org.junit.jupiter:junit-jupiter:5.9.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

tasks.named<Test>("test") {
useJUnitPlatform()
}


// Fun with KeY
val KEY_PROJECT_FILE = file("src/main/project.key").toString()

val cfgKey = configurations.create("key")

repositories {
maven("https://s01.oss.sonatype.org/content/repositories/iogithubwadoon-1001")
}

dependencies {
// use local versions of the tools
// cfgKey(
// "tools/key-2.10.0-exe.jar",
// "tools/citool-1.4.0-mini.jar")

cfgKey("org.key-project:key.ui:2.12.1")
cfgKey("io.github.wadoon.key:key-citool:1.6.0") {
exclude("org.key-project:key.ui:2.12.1")
exclude("org.key-project:key.core:2.12.1")
}
}

tasks.create<JavaExec>("runkey") {
classpath = cfgKey
args = listOf(KEY_PROJECT_FILE)
mainClass = "de.uka.ilkd.key.core.Main"
}

tasks.create<JavaExec>("keycheck") {
classpath = cfgKey
args = listOf("--proof-path", "src/main/proofs", "-s", "statistics.json", KEY_PROJECT_FILE)
mainClass = "de.uka.ilkd.key.CheckerKt"
}



abstract class GenerateKeyProjectFile : DefaultTask() {
@get:Input
abstract val destinationFile: Property<File>

@get:Input
abstract val srcFolders : ListProperty<File>

@get:Input
abstract val classpath : ListProperty<File>

@get:Input
abstract val includes : ListProperty<File>


@TaskAction
fun generate() {
val dest = destinationFile.get().toPath()
dest.toFile().bufferedWriter().use { out ->
out.write(
"""
// This file is automatically created by `gradle generateKeyProject`
// Created on: ${Date()}

""".trimIndent()
)

includes.get().forEach {
val p = dest.relativize(it.toPath())
out.write("\\include \"$p\";\n")
}

srcFolders.get().forEach {
val p = dest.relativize(it.toPath())
out.write("\\javaSrc \"$p\";\n")
}

classpath.get().forEach {
val p = dest.relativize(it.toPath())
out.write("\\classpath \"$p\";\n")
}

out.write("\n\\chooseContract\n")
}
}
}


tasks.create<GenerateKeyProjectFile>("generateKeyProject") {
srcFolders = sourceSets.main.get().java.srcDirs.toList()
classpath = sourceSets.main.get().compileClasspath.files.toList()
destinationFile = file(KEY_PROJECT_FILE)

}
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading