14
14
15
15
16
16
plugins {
17
- id ' java-library'
18
- id ' com.diffplug.spotless' version ' 5.8.2'
19
- id ' maven-publish'
20
- id ' signing'
17
+ id ' java-library'
18
+ id ' com.diffplug.spotless' version ' 5.8.2'
19
+ id ' maven-publish'
20
+ id ' signing'
21
21
}
22
22
23
23
group " software.amazon.cloudwatchlogs"
24
24
25
25
allprojects {
26
- compileJava {
27
- sourceCompatibility = ' 1.8'
28
- targetCompatibility = ' 1.8'
29
- }
26
+ compileJava {
27
+ sourceCompatibility = ' 1.8'
28
+ targetCompatibility = ' 1.8'
29
+ }
30
30
31
- version = ' 1.0.4'
31
+ version = ' 1.0.4'
32
32
}
33
33
34
34
java {
35
- withJavadocJar()
36
- withSourcesJar()
35
+ withJavadocJar()
36
+ withSourcesJar()
37
37
}
38
38
39
39
repositories {
40
- jcenter()
41
- mavenCentral()
40
+ jcenter()
41
+ mavenCentral()
42
42
}
43
43
44
44
sourceSets {
45
- integrationTest {
46
- java {
47
- compileClasspath + = main. output + test. output
48
- runtimeClasspath + = main. output + test. output
49
- srcDir file(' src/integration-test/java' )
50
- }
51
- resources. srcDir file(' src/integration-test/resources' )
52
- }
45
+ integrationTest {
46
+ java {
47
+ compileClasspath + = main. output + test. output
48
+ runtimeClasspath + = main. output + test. output
49
+ srcDir file(' src/integration-test/java' )
50
+ }
51
+ resources. srcDir file(' src/integration-test/resources' )
52
+ }
53
53
}
54
54
55
55
configurations {
56
- integrationTestImplementation. extendsFrom testImplementation
56
+ integrationTestImplementation. extendsFrom testImplementation
57
57
}
58
58
59
59
dependencies {
60
- annotationProcessor ' org.projectlombok:lombok:1.18.12'
61
-
62
- compileOnly ' org.projectlombok:lombok:1.18.12'
63
- implementation ' com.fasterxml.jackson.core:jackson-core:2.11.1'
64
- implementation ' com.fasterxml.jackson.core:jackson-annotations:2.11.1'
65
- implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.1'
66
- implementation ' org.slf4j:slf4j-api:1.7.30'
67
-
68
- // Use JUnit test framework
69
- testImplementation ' software.amazon.awssdk:cloudwatch:2.13.54'
70
- testImplementation ' junit:junit:4.13'
71
- testImplementation ' org.apache.commons:commons-lang3:3.10'
72
- testImplementation " org.mockito:mockito-core:2.+"
73
- testImplementation " org.powermock:powermock-module-junit4:2.0.2"
74
- testImplementation " org.powermock:powermock-api-mockito2:2.0.2"
75
- testImplementation " com.github.javafaker:javafaker:1.0.2"
76
- testImplementation " com.github.tomakehurst:wiremock-jre8:2.27.0"
77
- testImplementation ' software.amazon.awssdk:cloudwatch:2.13.54'
78
- testCompileOnly ' org.projectlombok:lombok:1.18.12'
79
- testAnnotationProcessor ' org.projectlombok:lombok:1.18.12'
60
+ annotationProcessor ' org.projectlombok:lombok:1.18.12'
61
+
62
+ compileOnly ' org.projectlombok:lombok:1.18.12'
63
+ implementation ' com.fasterxml.jackson.core:jackson-core:2.11.1'
64
+ implementation ' com.fasterxml.jackson.core:jackson-annotations:2.11.1'
65
+ implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.1'
66
+ implementation ' org.slf4j:slf4j-api:1.7.30'
67
+ implementation ' org.javatuples:javatuples:1.2'
68
+
69
+ // Use JUnit test framework
70
+ testImplementation ' software.amazon.awssdk:cloudwatch:2.13.54'
71
+ testImplementation ' junit:junit:4.13'
72
+ testImplementation ' org.apache.commons:commons-lang3:3.10'
73
+ testImplementation " org.mockito:mockito-core:2.+"
74
+ testImplementation " org.powermock:powermock-module-junit4:2.0.2"
75
+ testImplementation " org.powermock:powermock-api-mockito2:2.0.2"
76
+ testImplementation " com.github.javafaker:javafaker:1.0.2"
77
+ testImplementation " com.github.tomakehurst:wiremock-jre8:2.27.0"
78
+ testImplementation ' software.amazon.awssdk:cloudwatch:2.13.54'
79
+ testCompileOnly ' org.projectlombok:lombok:1.18.12'
80
+ testAnnotationProcessor ' org.projectlombok:lombok:1.18.12'
80
81
}
81
82
82
83
spotless {
83
- format ' misc' , {
84
- target ' *.gradle' , ' *.md' , ' .gitignore'
84
+ format ' misc' , {
85
+ target ' *.gradle' , ' *.md' , ' .gitignore'
85
86
86
- trimTrailingWhitespace()
87
- indentWithTabs()
88
- endWithNewline()
89
- }
87
+ trimTrailingWhitespace()
88
+ indentWithTabs()
89
+ endWithNewline()
90
+ }
90
91
91
- java {
92
- importOrder()
93
- googleJavaFormat(' 1.7' ). aosp()
94
- removeUnusedImports()
92
+ java {
93
+ importOrder()
94
+ googleJavaFormat(' 1.7' ). aosp()
95
+ removeUnusedImports()
95
96
96
- }
97
+ }
97
98
}
98
99
99
100
test {
100
- outputs. upToDateWhen {false }
101
+ outputs. upToDateWhen {false }
101
102
}
102
103
103
104
jar {
104
- manifest {
105
- attributes ' Implementation-Version' : archiveVersion. get()
106
- }
105
+ manifest {
106
+ attributes ' Implementation-Version' : archiveVersion. get()
107
+ }
107
108
}
108
109
109
110
110
111
task integrationTest (type : Test ) {
111
- testClassesDirs = sourceSets. integrationTest. output. classesDirs
112
- classpath = sourceSets. integrationTest. runtimeClasspath
113
- testLogging. showStandardStreams = true
112
+ testClassesDirs = sourceSets. integrationTest. output. classesDirs
113
+ classpath = sourceSets. integrationTest. runtimeClasspath
114
+ testLogging. showStandardStreams = true
114
115
}
115
116
116
117
task integ (type : Exec ) {
117
- commandLine ' ./bin/run-integ-tests.sh'
118
+ commandLine ' ./bin/run-integ-tests.sh'
118
119
}
119
120
120
121
121
122
tasks. withType(JavaCompile ) {
122
- options. compilerArgs << " -Xlint:unchecked" << " -Xlint:deprecation"
123
+ options. compilerArgs << " -Xlint:unchecked" << " -Xlint:deprecation"
123
124
}
124
125
125
126
tasks. named(' wrapper' ) {
126
- gradleVersion = ' 6.5.1'
127
- distributionType = Wrapper.DistributionType . ALL
127
+ gradleVersion = ' 6.5.1'
128
+ distributionType = Wrapper.DistributionType . ALL
128
129
}
129
130
130
131
def repoUrl = " https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/"
@@ -134,66 +135,66 @@ def buildNumber = System.getenv('CODEBUILD_BUILD_NUMBER')
134
135
135
136
136
137
publishing {
137
- publications {
138
- mavenJava(MavenPublication ) {
139
- ext. get_version = {
140
- if (buildNumber == null ) {
141
- return version + " .dev"
142
- } else {
143
- return version + " ." + buildNumber
144
- }
145
- }
146
- // TODO: add the build version properly
147
- // version = get_version()
148
- from components. java
149
- versionMapping {
150
- usage(' java-api' ) {
151
- fromResolutionOf(' runtimeClasspath' )
152
- }
153
- usage(' java-runtime' ) {
154
- fromResolutionResult()
155
- }
156
- }
157
- pom {
158
- name = ' aws-embedded-metrics'
159
- description = ' aws-embedded-metrics for java'
160
- url = ' https://github.com/awslabs/aws-embedded-metrics-java'
161
- scm {
162
- url = ' https://github.com/awslabs/aws-embedded-metrics-java'
163
- connection = ' https://github.com/awslabs/aws-embedded-metrics-java'
164
- developerConnection = ' https://github.com/awslabs/aws-embedded-metrics-java'
165
- }
166
- licenses {
167
- license {
168
- name = ' The Apache License, Version 2.0'
169
- url = ' https://github.com/awslabs/aws-embedded-metrics-java/blob/master/LICENSE'
170
- }
171
- }
172
- developers {
173
- developer {
174
- id = ' aws_emf'
175
- name = ' AWS CloudWatch'
176
- email = ' logs-emf@amazon.com'
177
- }
178
- }
179
- }
180
- }
181
- }
182
- repositories {
183
- maven {
184
- name = " mavenRepo"
185
- url = repoUrl
186
- credentials {
187
- username = repoUserName
188
- password = repoPassword
189
- }
190
- }
191
- }
138
+ publications {
139
+ mavenJava(MavenPublication ) {
140
+ ext. get_version = {
141
+ if (buildNumber == null ) {
142
+ return version + " .dev"
143
+ } else {
144
+ return version + " ." + buildNumber
145
+ }
146
+ }
147
+ // TODO: add the build version properly
148
+ // version = get_version()
149
+ from components. java
150
+ versionMapping {
151
+ usage(' java-api' ) {
152
+ fromResolutionOf(' runtimeClasspath' )
153
+ }
154
+ usage(' java-runtime' ) {
155
+ fromResolutionResult()
156
+ }
157
+ }
158
+ pom {
159
+ name = ' aws-embedded-metrics'
160
+ description = ' aws-embedded-metrics for java'
161
+ url = ' https://github.com/awslabs/aws-embedded-metrics-java'
162
+ scm {
163
+ url = ' https://github.com/awslabs/aws-embedded-metrics-java'
164
+ connection = ' https://github.com/awslabs/aws-embedded-metrics-java'
165
+ developerConnection = ' https://github.com/awslabs/aws-embedded-metrics-java'
166
+ }
167
+ licenses {
168
+ license {
169
+ name = ' The Apache License, Version 2.0'
170
+ url = ' https://github.com/awslabs/aws-embedded-metrics-java/blob/master/LICENSE'
171
+ }
172
+ }
173
+ developers {
174
+ developer {
175
+ id = ' aws_emf'
176
+ name = ' AWS CloudWatch'
177
+ email = ' logs-emf@amazon.com'
178
+ }
179
+ }
180
+ }
181
+ }
182
+ }
183
+ repositories {
184
+ maven {
185
+ name = " mavenRepo"
186
+ url = repoUrl
187
+ credentials {
188
+ username = repoUserName
189
+ password = repoPassword
190
+ }
191
+ }
192
+ }
192
193
}
193
194
194
195
signing {
195
- def signingKey = findProperty(" signingKey" )
196
- def signingPassword = findProperty(" signingPassword" )
197
- useInMemoryPgpKeys(signingKey, signingPassword)
198
- sign publishing. publications. mavenJava
196
+ def signingKey = findProperty(" signingKey" )
197
+ def signingPassword = findProperty(" signingPassword" )
198
+ useInMemoryPgpKeys(signingKey, signingPassword)
199
+ sign publishing. publications. mavenJava
199
200
}
0 commit comments