-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
131 lines (118 loc) · 4.19 KB
/
build.gradle
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
128
129
130
131
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9"
}
}
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
apply plugin: 'com.github.sherter.google-java-format'
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
implementation 'com.amazonaws:aws-lambda-java-core:1.1.0'
// 2.2.7 is earliest version that has all needed event sources
implementation 'com.amazonaws:aws-lambda-java-events:2.2.7'
implementation 'com.amazonaws:aws-java-sdk-s3:1.12.771'
implementation 'com.amazonaws:aws-java-sdk-kinesis:1.11.163'
implementation 'com.amazonaws:aws-java-sdk-dynamodb:1.11.163'
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://oss.sonatype.org/service/local/staging/deploy/maven2/")
def snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/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"]
}