Skip to content

Commit 35fecc5

Browse files
committed
Make use of new layout.settingsFolder api to address some cross project references
1 parent 9d510b6 commit 35fecc5

File tree

25 files changed

+40
-42
lines changed

25 files changed

+40
-42
lines changed

build-tools-internal/src/integTest/resources/org/elasticsearch/gradle/internal/fake_git/remote/distribution/archives/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ subprojects {
3434
}
3535

3636
def calculateBranchVersion() {
37-
File f = rootProject.file(".git/refs/heads/origin")
37+
File f = layout.settingsDirectory.file(".git/refs/heads/origin").asFile
3838
def branchName = f.list()?.first().trim()
3939
return branchName + ".1"
4040

client/rest/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ base {
3737

3838
// LLRC is licenses under Apache 2.0
3939
projectLicenses.set(['The Apache Software License, Version 2.0': providers.provider(() -> 'http://www.apache.org/licenses/LICENSE-2.0')])
40-
licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt'))
40+
licenseFile.set(layout.getSettingsDirectory().file('licenses/APACHE-LICENSE-2.0.txt').asFile)
4141

4242
dependencies {
4343
api "org.apache.httpcomponents:httpclient:${versions.httpclient}"

client/sniffer/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ base {
3333

3434
// rest client sniffer is licenses under Apache 2.0
3535
projectLicenses.set(['The Apache Software License, Version 2.0': providers.provider(() -> 'http://www.apache.org/licenses/LICENSE-2.0')])
36-
licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt'))
36+
licenseFile.set(layout.getSettingsDirectory().file('licenses/APACHE-LICENSE-2.0.txt').asFile)
3737

3838
dependencies {
3939
api project(":client:rest")

client/test/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ group = "${group}.client.test"
1919

2020
// rest client sniffer is licenses under Apache 2.0
2121
projectLicenses.set(['The Apache Software License, Version 2.0': providers.provider(() -> 'http://www.apache.org/licenses/LICENSE-2.0')])
22-
licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt'))
22+
licenseFile.set(layout.getSettingsDirectory().file('licenses/APACHE-LICENSE-2.0.txt').asFile)
2323

2424
dependencies {
2525
api "org.apache.httpcomponents:httpcore:${versions.httpcore}"

distribution/archives/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ CopySpec archiveFiles(String distributionType, String os, String architecture, b
5757
pluginsDir.getParent()
5858
}
5959
}
60-
from(rootProject.projectDir) {
60+
from(layout.settingsDirectory.asFile) {
6161
filePermissions {
6262
unix(0644)
6363
}
6464
include 'README.asciidoc'
6565
}
66-
from(rootProject.file('licenses')) {
66+
from(layout.settingsDirectory.file('licenses').asFile) {
6767
include isTestDistro ? 'AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt' : 'ELASTIC-LICENSE-2.0.txt'
6868
filePermissions {
6969
unix(0644)

distribution/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,9 @@ subprojects {
518518

519519
String licenseText
520520
if (isTestDistro) {
521-
licenseText = rootProject.file('licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt').getText('UTF-8')
521+
licenseText = layout.settingsDirectory.file('licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt').asFile.getText('UTF-8')
522522
} else {
523-
licenseText = rootProject.file('licenses/ELASTIC-LICENSE-2.0.txt').getText('UTF-8')
523+
licenseText = layout.settingsDirectory.file('licenses/ELASTIC-LICENSE-2.0.txt').asFile.getText('UTF-8')
524524
}
525525
// license text needs to be indented with a single space
526526
licenseText = ' ' + licenseText.replace('\n', '\n ')

distribution/packages/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def commonPackageConfig(String type, String architecture) {
174174
} else {
175175
assert type == 'rpm'
176176
into('/usr/share/elasticsearch') {
177-
from(rootProject.file('licenses')) {
177+
from(layout.settingsDirectory.file('licenses').asFile) {
178178
include 'ELASTIC-LICENSE-2.0.txt'
179179
rename { 'LICENSE.txt' }
180180
}

libs/h3/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tasks.named('forbiddenApisMain').configure {
3636
}
3737

3838
ext.projectLicenses.set(['The Apache Software License, Version 2.0': providers.provider(() -> 'http://www.apache.org/licenses/LICENSE-2.0')])
39-
licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt'))
39+
licenseFile.set(layout.settingsDirectory.file('licenses/APACHE-LICENSE-2.0.txt').asFile)
4040

4141
tasks.withType(LicenseHeadersTask.class).configureEach {
4242
approvedLicenses = ['Apache', 'Generated', 'Vendored']

libs/tdigest/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tasks.named('forbiddenApisMain').configure {
3737
}
3838

3939
ext.projectLicenses.set(['The Apache Software License, Version 2.0': providers.provider(() -> 'http://www.apache.org/licenses/LICENSE-2.0')])
40-
licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt'))
40+
licenseFile.set(layout.settingsDirectory.file('licenses/APACHE-LICENSE-2.0.txt').asFile)
4141

4242
tasks.withType(LicenseHeadersTask.class).configureEach {
4343
approvedLicenses = ['Apache', 'Generated', 'Vendored']

plugins/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ configure(subprojects.findAll { it.parent.path == project.path }) {
2323
esplugin {
2424
// for local ES plugins, the name of the plugin is the same as the directory
2525
name = project.name
26-
27-
licenseFile = rootProject.file('licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt')
28-
noticeFile = rootProject.file('NOTICE.txt')
26+
licenseFile = layout.settingsDirectory.file('licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt').asFile
27+
noticeFile = layout.settingsDirectory.file('NOTICE.txt').asFile
2928
}
3029

31-
3230
parent.artifacts.add('allPlugins', tasks.named('bundlePlugin'))
3331
}

0 commit comments

Comments
 (0)