https://github.com/dafny-lang/dafny-gradle-plugin

Dafny plugin for Gradle

https://github.com/dafny-lang/dafny-gradle-plugin

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Dafny plugin for Gradle

Basic Info
  • Host: GitHub
  • Owner: dafny-lang
  • License: mit
  • Language: Java
  • Default Branch: main
  • Size: 135 KB
Statistics
  • Stars: 2
  • Watchers: 7
  • Forks: 2
  • Open Issues: 7
  • Releases: 0
Created over 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

Dafny Gradle Plugin

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.

Installation

The Dafny Gradle plugin is applied using the org.dafny.dafny plugin ID. For example:

```kotlin plugins { id("org.dafny.dafny").version("0.2.0") }

dafny { dafnyVersion.set("4.9.1") }

dependencies { implementation("org.dafny:DafnyRuntime:4.9.1") }

```

Documentation

The plugin provides two tasks:

  • verifyDafny, which verifies all Dafny code under the src/main/dafny directory.
  • translateDafnyToJava, which translates Dafny code verified by verifyDafny to Java code, and ensures the result is also compiled together with the main Java source set.

Both tasks are executed automatically as dependencies of tasks from the Java plugin, but can be executed manually as well.

The plugin also embeds the built Dafny code in the resulting Jar file, and automatically discovers any Dafny code embedded in this way in the project's dependencies, making them available to the Dafny tool as libraries. This allows Dafny projects to define Dafny dependencies and distribute themselves as libraries through Gradle-supported repositories such as Maven central. For details see this example.

Projects can also configure command-line options to pass to the Dafny CLI in the dafny extension:

```kotlin dafny { dafnyVersion.set("4.9.1")

optionsMap.put("unicode-char", false)
optionsMap.put("isolate-assertions", true)

} ```

Note there is no support for different Dafny CLI options on a per-file basis. We recommend organizing Dafny source into subprojects with the same set of options instead.

Known Limitations

  • The collection of Dafny files to verify or translate is not yet configurable.
  • The plugin only supports a main source set, and only integrates with Java code in the Java plugin's main source set.
  • The Dafny CLI is only resolved through the current PATH, and there is no support for bootstrapping it.

License

This library is licensed under the Apache 2.0 License.

Owner

  • Name: Dafny
  • Login: dafny-lang
  • Kind: organization

Dafny is a verification-aware programming language

GitHub Events

Total
  • Issues event: 7
  • Watch event: 2
  • Member event: 1
  • Issue comment event: 3
  • Push event: 6
  • Pull request review comment event: 5
  • Pull request event: 13
  • Pull request review event: 16
  • Fork event: 2
  • Create event: 1
Last Year
  • Issues event: 7
  • Watch event: 2
  • Member event: 1
  • Issue comment event: 3
  • Push event: 6
  • Pull request review comment event: 5
  • Pull request event: 13
  • Pull request review event: 16
  • Fork event: 2
  • Create event: 1

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 10
  • Total pull requests: 17
  • Average time to close issues: 13 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.29
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 14
  • Average time to close issues: 12 days
  • Average time to close pull requests: 1 day
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.21
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • robin-aws (9)
Pull Request Authors
  • robin-aws (10)
  • hillcg-aws (8)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/gradle.yml actions
  • actions/checkout v3 composite
  • actions/setup-java v3 composite
  • dafny-lang/setup-dafny-action v1.6.1 composite
  • gradle/gradle-build-action v2 composite
build.gradle.kts maven
  • org.junit.jupiter:junit-jupiter 5.9.1 testImplementation
examples/multi-project/build.gradle.kts maven
examples/multi-project/consumer/build.gradle.kts maven
  • org.dafny:DafnyRuntime 4.0.0 implementation
examples/multi-project/producer/build.gradle.kts maven
  • org.dafny:DafnyRuntime 4.0.0 implementation
examples/multi-project-incompatible/build.gradle.kts maven
examples/multi-project-incompatible/consumer/build.gradle.kts maven
  • org.dafny:DafnyRuntime 4.0.0 implementation
examples/multi-project-incompatible/producer/build.gradle.kts maven
  • org.dafny:DafnyRuntime 4.0.0 implementation
examples/no-dafny/build.gradle.kts maven
examples/simple-verify/build.gradle.kts maven
examples/wrong-dafny-version/build.gradle.kts maven
examples/using-standard-libraries/build.gradle.kts maven
  • org.dafny:DafnyRuntime 4.9.0 implementation