File tree 5 files changed +57
-5
lines changed
5 files changed +57
-5
lines changed File renamed without changes.
Original file line number Diff line number Diff line change
1
+ Elasticsearch Java Client
2
+ Copyright 2021 Elasticsearch B.V.
Original file line number Diff line number Diff line change @@ -25,8 +25,16 @@ subprojects {
25
25
apply (plugin = " checkstyle" )
26
26
}
27
27
28
- /*
29
- TODO:
30
- - checkstyle + reformat
31
- - license check
32
- */
28
+ val grgit = org.ajoberstar.grgit.Grgit .open(mapOf (" currentDir" to project.rootDir))
29
+ try {
30
+ allprojects {
31
+ project.extra[" gitHashFull" ] = grgit.head().id
32
+ project.extra[" gitCommitTime" ] = grgit.head().dateTime.withZoneSameLocal(java.time.ZoneOffset .UTC )
33
+ }
34
+ } finally {
35
+ grgit.close()
36
+ }
37
+
38
+ allprojects {
39
+ project.extra[" buildTime" ] = java.time.Instant .now().atZone(java.time.ZoneOffset .UTC )
40
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Licensed to Elasticsearch B.V. under one or more contributor
3
+ * license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright
5
+ * ownership. Elasticsearch B.V. licenses this file to you under
6
+ * the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ dependencies {
21
+ implementation(" org.ajoberstar.grgit:grgit-gradle:4.0.1" )
22
+ }
23
+
24
+ repositories {
25
+ maven(" https://plugins.gradle.org/m2/" )
26
+ }
Original file line number Diff line number Diff line change @@ -31,6 +31,22 @@ java {
31
31
sourceCompatibility = JavaVersion .VERSION_1_8
32
32
}
33
33
34
+ tasks.withType<Jar > {
35
+ manifest {
36
+ attributes[" Implementation-Title" ] = " Elasticsearch Java client"
37
+ attributes[" Implementation-Vendor" ] = " Elastic"
38
+ attributes[" Implementation-URL" ] = " https://github.com/elastic/elasticsearch-java/"
39
+ attributes[" Build-Date" ] = project.extra[" buildTime" ]
40
+ attributes[" X-Git-Revision" ] = project.extra[" gitHashFull" ]
41
+ attributes[" X-Git-Commit-Time" ] = project.extra[" gitCommitTime" ]
42
+ }
43
+
44
+ metaInf {
45
+ into(" ." ).from(" ../LICENSE.txt" )
46
+ into(" ." ).from(" ../NOTICE.txt" )
47
+ }
48
+ }
49
+
34
50
publishing {
35
51
repositories {
36
52
maven {
You can’t perform that action at this time.
0 commit comments