|
| 1 | +import java.net.URI |
| 2 | +import javax.annotation.Nullable |
| 3 | + |
| 4 | +plugins { |
| 5 | + `java` |
| 6 | + `java-library` |
| 7 | + `maven-publish` |
| 8 | +} |
| 9 | + |
| 10 | +group = "software.amazon.cryptography" |
| 11 | +version = "1.0-SNAPSHOT" |
| 12 | +description = "AwsCryptographyDynamoDbEncryption" |
| 13 | + |
| 14 | +java { |
| 15 | + toolchain.languageVersion.set(JavaLanguageVersion.of(8)) |
| 16 | + sourceSets["main"].java { |
| 17 | + srcDir("src/main/java") |
| 18 | + } |
| 19 | + sourceSets["test"].java { |
| 20 | + srcDir("src/test") |
| 21 | + } |
| 22 | +} |
| 23 | + |
| 24 | +var caUrl: URI? = null |
| 25 | +@Nullable |
| 26 | +val caUrlStr: String? = System.getenv("CODEARTIFACT_URL_JAVA_CONVERSION") |
| 27 | +if (!caUrlStr.isNullOrBlank()) { |
| 28 | + caUrl = URI.create(caUrlStr) |
| 29 | +} |
| 30 | + |
| 31 | +var caPassword: String? = null |
| 32 | +@Nullable |
| 33 | +val caPasswordString: String? = System.getenv("CODEARTIFACT_AUTH_TOKEN") |
| 34 | +if (!caPasswordString.isNullOrBlank()) { |
| 35 | + caPassword = caPasswordString |
| 36 | +} |
| 37 | + |
| 38 | +repositories { |
| 39 | + mavenCentral() |
| 40 | + mavenLocal() |
| 41 | + if (caUrl != null && caPassword != null) { |
| 42 | + maven { |
| 43 | + name = "CodeArtifact" |
| 44 | + url = caUrl!! |
| 45 | + credentials { |
| 46 | + username = "aws" |
| 47 | + password = caPassword!! |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +dependencies { |
| 54 | + implementation("dafny.lang:DafnyRuntime:3.10.0") |
| 55 | + implementation("software.amazon.dafny:conversion:1.0-SNAPSHOT") |
| 56 | + implementation("software.amazon.cryptography:StandardLibrary:1.0-SNAPSHOT") |
| 57 | + implementation("software.amazon.cryptography:AwsCryptographyPrimitives:1.0-SNAPSHOT") |
| 58 | + implementation("software.amazon.cryptography:AwsCryptographyDynamoDbItemEncryptor:1.0-SNAPSHOT") |
| 59 | + implementation("software.amazon.cryptography:AwsCryptographyDynamoDbEncryptionMiddlewareInternal:1.0-SNAPSHOT") |
| 60 | + implementation("software.amazon.cryptography:AwsCryptographyStructuredEncryption:1.0-SNAPSHOT") |
| 61 | + implementation("software.amazon.cryptography:AwsCryptographicMaterialProviders:1.0-SNAPSHOT") |
| 62 | + implementation("software.amazon.cryptography:ComAmazonawsDynamodb:1.0-SNAPSHOT") |
| 63 | + implementation("software.amazon.cryptography:ComAmazonawsKms:1.0-SNAPSHOT") |
| 64 | + implementation("com.amazonaws:aws-java-sdk:1.12.347") |
| 65 | + implementation(platform("software.amazon.awssdk:bom:2.19.1")) |
| 66 | + implementation("software.amazon.awssdk:dynamodb") |
| 67 | + implementation("software.amazon.awssdk:dynamodb-enhanced") |
| 68 | + implementation("software.amazon.awssdk:kms") |
| 69 | + implementation("software.amazon.awssdk:core:2.19.1") |
| 70 | + implementation("com.amazonaws:aws-dynamodb-encryption-java:2.0.3") |
| 71 | + |
| 72 | + testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") |
| 73 | + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") |
| 74 | +} |
| 75 | + |
| 76 | +tasks.test { |
| 77 | + useJUnitPlatform() |
| 78 | +} |
| 79 | + |
| 80 | +publishing { |
| 81 | + publications.create<MavenPublication>("maven") { |
| 82 | + groupId = "software.amazon.cryptography" |
| 83 | + artifactId = "AwsCryptographyDynamoDbEncryption" |
| 84 | + from(components["java"]) |
| 85 | + } |
| 86 | + repositories { mavenLocal() } |
| 87 | +} |
| 88 | + |
| 89 | +tasks.withType<JavaCompile>() { |
| 90 | + options.encoding = "UTF-8" |
| 91 | +} |
0 commit comments