-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f2d7cc
commit 0b6f104
Showing
13 changed files
with
202 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
TestModels/Constraints/runtimes/net/ImplementationFromDafny-cs.dtr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
file_format_version = "1.0" | ||
dafny_version = "4.6.0.0" | ||
[options_by_module.SimpleConstraintsTypes] | ||
[options_by_module.AbstractSimpleConstraintsOperations] | ||
[options_by_module.AbstractSimpleConstraintsService] | ||
[options_by_module.SimpleConstraintsImpl] | ||
[options_by_module.SimpleConstraints] |
7 changes: 7 additions & 0 deletions
7
TestModels/Constraints/runtimes/net/tests/TestsFromDafny-cs.dtr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
file_format_version = "1.0" | ||
dafny_version = "4.6.0.0" | ||
[options_by_module.Helpers] | ||
[options_by_module.SimpleConstraintsImplTest] | ||
[options_by_module.WrappedAbstractSimpleConstraintsService] | ||
[options_by_module.WrappedSimpleConstraintsService] | ||
[options_by_module.WrappedSimpleConstraintsTest] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Ignore Gradle project-specific cache directory | ||
.gradle | ||
|
||
# Ignore Gradle build output directory | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import java.io.File | ||
import java.io.FileInputStream | ||
import java.util.Properties | ||
|
||
tasks.wrapper { | ||
gradleVersion = "7.6" | ||
} | ||
|
||
plugins { | ||
`java-library` | ||
`maven-publish` | ||
} | ||
|
||
var props = Properties().apply { | ||
load(FileInputStream(File(rootProject.rootDir, "../../project.properties"))) | ||
} | ||
var dafnyVersion = props.getProperty("dafnyVersion") | ||
|
||
group = "simple" | ||
version = "1.0-SNAPSHOT" | ||
description = "Constraints" | ||
|
||
java { | ||
toolchain.languageVersion.set(JavaLanguageVersion.of(8)) | ||
sourceSets["main"].java { | ||
srcDir("src/main/java") | ||
srcDir("src/main/dafny-generated") | ||
srcDir("src/main/smithy-generated") | ||
} | ||
sourceSets["test"].java { | ||
srcDir("src/test/java") | ||
srcDir("src/test/dafny-generated") | ||
srcDir("src/test/smithy-generated") | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
implementation("org.dafny:DafnyRuntime:${dafnyVersion}") | ||
implementation("software.amazon.smithy.dafny:conversion:0.1") | ||
implementation("software.amazon.cryptography:StandardLibrary:1.0-SNAPSHOT") | ||
testImplementation("org.testng:testng:7.5") | ||
} | ||
|
||
publishing { | ||
publications.create<MavenPublication>("maven") { | ||
groupId = "simple" | ||
artifactId = "Constraints" | ||
from(components["java"]) | ||
} | ||
repositories { mavenLocal() } | ||
} | ||
|
||
tasks.withType<JavaCompile>() { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
tasks { | ||
register("runTests", JavaExec::class.java) { | ||
mainClass.set("TestsFromDafny") | ||
classpath = sourceSets["test"].runtimeClasspath | ||
} | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
useTestNG() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This generated file contains a sample Java library project to get you started. | ||
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.7/userguide/building_java_projects.html in the Gradle documentation. | ||
*/ | ||
|
||
plugins { | ||
// Apply the java-library plugin for API and implementation separation. | ||
`java-library` | ||
} | ||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
// Use JUnit Jupiter for testing. | ||
testImplementation(libs.junit.jupiter) | ||
|
||
testRuntimeOnly("org.junit.platform:junit-platform-launcher") | ||
|
||
// This dependency is exported to consumers, that is to say found on their compile classpath. | ||
api(libs.commons.math3) | ||
|
||
// This dependency is used internally, and not exposed to consumers on their own compile classpath. | ||
implementation(libs.guava) | ||
} | ||
|
||
// Apply a specific Java toolchain to ease working on different environments. | ||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
// Use JUnit Platform for unit tests. | ||
useJUnitPlatform() | ||
} |
10 changes: 10 additions & 0 deletions
10
TestModels/Union/runtimes/java/lib/src/main/java/org/example/Library.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* This source file was generated by the Gradle 'init' task | ||
*/ | ||
package org.example; | ||
|
||
public class Library { | ||
public boolean someLibraryMethod() { | ||
return true; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
TestModels/Union/runtimes/java/lib/src/test/java/org/example/LibraryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* This source file was generated by the Gradle 'init' task | ||
*/ | ||
package org.example; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class LibraryTest { | ||
@Test void someLibraryMethodReturnsTrue() { | ||
Library classUnderTest = new Library(); | ||
assertTrue(classUnderTest.someLibraryMethod(), "someLibraryMethod should return 'true'"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* The settings file is used to specify which projects to include in your build. | ||
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.7/userguide/multi_project_builds.html in the Gradle documentation. | ||
*/ | ||
|
||
plugins { | ||
// Apply the foojay-resolver plugin to allow automatic download of JDKs | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" | ||
} | ||
|
||
rootProject.name = "java" | ||
include("lib") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
file_format_version = "1.0" | ||
dafny_version = "4.6.0.0" | ||
[options_by_module.SimpleUnionTypes] | ||
[options_by_module.AbstractSimpleUnionOperations] | ||
[options_by_module.AbstractSimpleUnionService] | ||
[options_by_module.SimpleUnionImpl] | ||
[options_by_module.SimpleUnion] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
file_format_version = "1.0" | ||
dafny_version = "4.6.0.0" | ||
[options_by_module.SimpleUnionImplTest] | ||
[options_by_module.WrappedAbstractSimpleUnionService] | ||
[options_by_module.WrappedSimpleUnionService] | ||
[options_by_module.WrappedSimpleUnionTest] |