-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle
More file actions
127 lines (113 loc) · 3.95 KB
/
build.gradle
File metadata and controls
127 lines (113 loc) · 3.95 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
repositories {
mavenCentral()
maven {
url 'https://central.sonatype.com/repository/maven-snapshots/'
}
}
dependencies {
implementation platform("software.amazon.awssdk:bom:2.40.11")
implementation 'software.amazon.awssdk:s3'
implementation 'software.amazon.awssdk:s3-event-notifications'
implementation 'com.amazonaws:aws-lambda-java-core:1.2.3'
implementation 'com.amazonaws:aws-lambda-java-events:3.15.0'
implementation('io.opentracing:opentracing-api:0.33.0')
implementation('io.opentracing:opentracing-util:0.33.0')
implementation('io.opentracing:opentracing-noop:0.33.0')
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'io.opentracing:opentracing-mock:0.33.0'
}
// -Prelease=true will render a non-snapshot version
// All other values (including unset) will render a snapshot version.
def release = findProperty("release")
version = project.findProperty("version")
if (!release) {
version += "-SNAPSHOT"
}
jar {
from(projectDir) { include "README.md" }
manifest {
attributes 'Implementation-Title': 'AWS Lambda OpenTracing Java SDK',
'Implementation-Version': project.version,
'Created-By': 'New Relic, Inc',
'Built-Date': new Date(),
'Specification-Version': project.version,
'Build-Id': System.getProperty('BUILD_ID') || "None"
}
}
publishing {
repositories {
maven {
def releasesRepoUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
def snapshotsRepoUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
if (version.toString().endsWith("SNAPSHOT")) {
url = snapshotsRepoUrl
} else {
url = releasesRepoUrl
}
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
publications {
register("mavenJava", MavenPublication.class) {
from(components["java"])
}
// customize all publications here
withType(MavenPublication.class) {
pom {
name.set(project.name)
description.set("SDK that provides open tracing instrumentation for AWS Lambda")
url.set("https://github.com/newrelic/java-aws-lambda")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("newrelic")
name.set("New Relic")
email.set("opensource@newrelic.com")
}
}
scm {
url.set("git@github.com:newrelic/java-aws-lambda.git")
connection.set("scm:git@github.com:newrelic/java-aws-lambda.git")
}
}
}
}
}
signing {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
setRequired({ gradle.taskGraph.hasTask("uploadArchives") })
sign publishing.publications["mavenJava"]
}