Skip to content

Commit 701d36a

Browse files
committed
Fix tools sub-dir
1 parent 1f7b1ba commit 701d36a

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

distribution/archives/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ task createPluginsDir(type: EmptyDirTask) {
4949
CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, boolean oss) {
5050
return copySpec {
5151
into("elasticsearch-${version}") {
52-
with libFiles
52+
into('lib') {
53+
with libFiles
54+
}
5355
into('config') {
5456
dirMode 0750
5557
fileMode 0660

distribution/build.gradle

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,14 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
227227
* Common files in all distributions *
228228
*****************************************************************************/
229229
libFiles = copySpec {
230-
into('lib') {
231-
// delay by using closures, since they have not yet been configured, so no jar task exists yet
232-
from { project(':server').jar }
233-
from { project(':server').configurations.runtime }
234-
from { project(':libs:plugin-classloader').jar }
235-
from { project(':distribution:tools:launchers').jar }
236-
into('tools/plugin-cli') {
237-
from { project(':distribution:tools:plugin-cli').jar }
238-
from { project(':distribution:tools:plugin-cli').configurations.runtime }
239-
}
230+
// delay by using closures, since they have not yet been configured, so no jar task exists yet
231+
from { project(':server').jar }
232+
from { project(':server').configurations.runtime }
233+
from { project(':libs:plugin-classloader').jar }
234+
from { project(':distribution:tools:launchers').jar }
235+
into('tools/plugin-cli') {
236+
from { project(':distribution:tools:plugin-cli').jar }
237+
from { project(':distribution:tools:plugin-cli').configurations.runtime }
240238
}
241239
}
242240

distribution/packages/build.gradle

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,27 @@ Closure commonPackageConfig(String type, boolean oss) {
123123
from(rootProject.projectDir) {
124124
include 'README.textile'
125125
}
126+
into('lib') {
127+
with copySpec {
128+
with libFiles
129+
// we need to specify every intermediate directory so we iterate through the parents; duplicate calls with the same part are fine
130+
eachFile { FileCopyDetails fcp ->
131+
String[] segments = fcp.relativePath.segments
132+
for (int i = segments.length - 2; i > 0 && segments[i] != 'lib'; --i) {
133+
System.out.println(segments[0..i])
134+
directory('/' + segments[0..i].join('/'), 0755)
135+
}
136+
}
137+
}
138+
}
126139
into('modules') {
127140
with copySpec {
128141
with modulesFiles(oss)
129-
// we need to specify every intermediate directory, but modules could have sub directories
130-
// and there might not be any files as direct children of intermediates (eg platform)
131-
// so we must iterate through the parents, but duplicate calls with the same path
132-
// are ok (they don't show up in the built packages)
142+
// we need to specify every intermediate directory so we iterate through the parents; duplicate calls with the same part are fine
133143
eachFile { FileCopyDetails fcp ->
134144
String[] segments = fcp.relativePath.segments
135145
for (int i = segments.length - 2; i > 0 && segments[i] != 'modules'; --i) {
146+
System.out.println(segments[0..i])
136147
directory('/' + segments[0..i].join('/'), 0755)
137148
}
138149
}
@@ -241,8 +252,8 @@ ospackage {
241252
signingKeyId = project.hasProperty('signing.keyId') ? project.property('signing.keyId') : 'D88E42B4'
242253
signingKeyPassphrase = project.property('signing.password')
243254
signingKeyRingFile = project.hasProperty('signing.secretKeyRingFile') ?
244-
project.file(project.property('signing.secretKeyRingFile')) :
245-
new File(new File(System.getProperty('user.home'), '.gnupg'), 'secring.gpg')
255+
project.file(project.property('signing.secretKeyRingFile')) :
256+
new File(new File(System.getProperty('user.home'), '.gnupg'), 'secring.gpg')
246257
}
247258

248259
requires('coreutils')
@@ -253,7 +264,6 @@ ospackage {
253264
permissionGroup 'root'
254265

255266
into '/usr/share/elasticsearch'
256-
with libFiles
257267
with noticeFile
258268
}
259269

0 commit comments

Comments
 (0)