-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
76 lines (63 loc) · 2.66 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Gradle plugin project to get you started.
* For more details take a look at the Writing Custom Plugins chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.6/userguide/custom_plugins.html
*/
plugins {
// Apply the Plugin Publish plugin to make plugin publication possible
// The Plugin Publish plugin will in turn auto-apply the Gradle Plugin Development Plugin (java-gradle-plugin)
// and the Maven Publish plugin (maven-publish)
id("com.gradle.plugin-publish") version "1.2.0"
`maven-publish`
}
group = "org.dafny"
version = "0.1.0"
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
implementation("org.semver4j:semver4j:5.4.1")
// Use JUnit Jupiter for testing.
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
}
gradlePlugin {
website.set("https://github.com/dafny-lang/dafny-gradle-plugin")
vcsUrl.set("https://github.com/dafny-lang/dafny-gradle-plugin")
// Define the plugin
plugins {
create("org.dafny.dafny") {
id = "org.dafny.dafny"
implementationClass = "org.dafny.gradle.plugin.DafnyPlugin"
displayName = "Gradle plugin for Dafny"
description = "This plugin offers tight integration of the " +
"Dafny verification-aware programming language with Java: " +
"automatically verifying Dafny source code and compiling it to Java source code, " +
"which the Java plugin will then build together with any hand-written Java in the project. " +
"It also provides a robust approach to distributing and managing Dafny dependencies " +
"through Gradle-supported repositories such as Maven Central."
tags.set(listOf("dafny", "verification", "building"))
}
}
}
// Add a source set for the functional test suite
val functionalTestSourceSet = sourceSets.create("functionalTest") {
}
configurations["functionalTestImplementation"].extendsFrom(configurations["testImplementation"])
// Add a task to run the functional tests
val functionalTest by tasks.registering(Test::class) {
testClassesDirs = functionalTestSourceSet.output.classesDirs
classpath = functionalTestSourceSet.runtimeClasspath
useJUnitPlatform()
}
gradlePlugin.testSourceSets(functionalTestSourceSet)
tasks.named<Task>("check") {
// Run the functional tests as part of `check`
dependsOn(functionalTest)
}
tasks.named<Test>("test") {
// Use JUnit Jupiter for unit tests.
useJUnitPlatform()
}