File tree Expand file tree Collapse file tree 3 files changed +45
-5
lines changed Expand file tree Collapse file tree 3 files changed +45
-5
lines changed Original file line number Diff line number Diff line change @@ -152,9 +152,9 @@ if [[ "$CMD" == "assemble" ]]; then
152
152
docker run --rm --env VERSION=$VERSION \
153
153
$git_mount $src_mount $output_mount \
154
154
$docker_image \
155
- java-client:publishAllPublicationsToBuildRepository
155
+ publishForReleaseManager
156
156
157
- if compgen -G " .ci/output/*" > /dev/null; then
157
+ if compgen -G " .ci/output/release/ *" > /dev/null; then
158
158
echo -e " \033[32;1mTARGET: successfully assembled client version $VERSION \033[0m"
159
159
else
160
160
echo -e " \033[31;1mTARGET: assemble failed, empty workspace!\033[0m"
Original file line number Diff line number Diff line change 17
17
* under the License.
18
18
*/
19
19
20
-
21
- subprojects {
20
+ allprojects {
22
21
group = " co.elastic.clients"
23
22
version = System .getenv(" VERSION" ) ? : " 8.0.0-SNAPSHOT"
24
23
@@ -50,3 +49,41 @@ tasks.register<Task>(name = "resolveDependencies") {
50
49
}
51
50
}
52
51
}
52
+
53
+ tasks.register<Task >(name = " publishForReleaseManager" ) {
54
+ group = " Publishing"
55
+ description = " Publishes artifacts in a format suitable for the Elastic release manager"
56
+ dependsOn(" :java-client:publishAllPublicationsToBuildRepository" )
57
+ doLast {
58
+ val version = this .project.version.toString()
59
+ val isSnapshot = version.endsWith(" SNAPSHOT" )
60
+
61
+ println (" Releasing version $version " )
62
+
63
+ val releaseDir = File (rootProject.buildDir, " release" )
64
+ releaseDir.mkdirs()
65
+
66
+ File (rootProject.buildDir, " repository/co/elastic/clients" ).listFiles()?.forEach { artifact ->
67
+ println (" Releasing artifact " + artifact.name)
68
+
69
+ val versionDir = File (artifact, version)
70
+ var gotPom = false ;
71
+
72
+ versionDir.listFiles()?.forEach { file ->
73
+ if (file.name.endsWith(" .jar" ) || file.name.endsWith(" .pom" )) {
74
+ var name = file.name
75
+
76
+ if (isSnapshot) {
77
+ if (file.name.endsWith(" .pom" )) {
78
+ if (gotPom) throw GradleException (" Multiple snapshots found in " + file.parentFile)
79
+ gotPom = true
80
+ }
81
+ name = name.replace(Regex (" -\\ d{8}\\ .\\ d{6}-\\ d+" ), " -SNAPSHOT" )
82
+ }
83
+
84
+ file.copyTo(File (releaseDir, name), overwrite = true )
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ plugins {
28
28
java {
29
29
targetCompatibility = JavaVersion .VERSION_1_8
30
30
sourceCompatibility = JavaVersion .VERSION_1_8
31
+
32
+ withJavadocJar()
33
+ withSourcesJar()
31
34
}
32
35
33
36
tasks.withType<Jar > {
@@ -79,7 +82,7 @@ publishing {
79
82
url.set(" https://github.com/elastic/elasticsearch-java/" )
80
83
licenses {
81
84
license {
82
- name.set(" The Apache License, Version 2.0" )
85
+ name.set(" The Apache Software License, Version 2.0" )
83
86
url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
84
87
}
85
88
}
You can’t perform that action at this time.
0 commit comments