-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
147 lines (120 loc) · 3.78 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3")
}
}
apply plugin: 'java-library'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
version = '0.1.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk:1.3.0'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'commons-logging:commons-logging:1.2'
// Use JUnit test framework
testImplementation (
'junit:junit:4.12',
'com.amazonaws:aws-java-sdk-dynamodb:1.11.268',
'com.amazonaws:aws-java-sdk-kinesis:1.11.268',
)
}
archivesBaseName = 'aws-xray-parameter-whitelist-instrumentor'
def githubUrl = 'https://github.com/functionalone/aws-xray-parameter-whitelist-java'
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// Create the pom configuration:
def pomConfig = {
licenses {
license {
name "MIT"
url "https://opensource.org/licenses/MIT"
distribution "repo"
}
}
scm {
url githubUrl
}
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
artifact sourceJar
artifact javadocJar
groupId 'com.github.functionalone'
artifactId project.archivesBaseName
version project.version
pom.withXml {
def root = asNode()
root.appendNode('description', 'Configure AWS X-Ray (Java) with an alternate parameter whitelist')
root.appendNode('name', project.archivesBaseName)
root.appendNode('url', githubUrl)
root.children().last() + pomConfig
}
}
}
}
model {
tasks.generatePomFileForMyPublicationPublication {
destination = file("$buildDir/libs/${project.archivesBaseName}-${project.version}.pom")
}
}
bintray {
user = System.getProperty("bintray.user")
key = System.getProperty("bintray.api_key")
publications = ['MyPublication']
publish = true //[Default: false] Whether version should be auto published after an upload
pkg {
repo = 'maven'
name = project.archivesBaseName
userOrg = 'functionalone'
desc = 'Configure AWS X-Ray (Java) with an alternate parameter whitelist'
licenses = ['MIT']
vcsUrl = githubUrl
labels = ['aws', 'xray', 'whitelist']
publicDownloadNumbers = false
version {
name = project.version
desc = project.version
vcsTag = 'master'
//attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
}
}
}
test {
testLogging {
events "passed", "skipped", "failed"
}
systemProperty "aws-xray-whitelist.s3-bucket", System.getProperty("aws-xray-whitelist.s3-bucket")
}
task generateWhitelist (type:JavaExec) {
main = "com.github.functionalone.xray.handlers.GenerateParameterWhitelist"
classpath = sourceSets.test.runtimeClasspath
/* Pass all system proprties*/
systemProperties System.getProperties()
}
jar {
manifest {
attributes('Implementation-Title': project.archivesBaseName,
'Implementation-Version': project.version)
}
}