Remove license key leniency (elastic/x-pack-elasticsearch#4277)
If the license key specified by the system property license.key does not exist, Gradle does not care. Gradle should care, so this commit makes it care. Original commit: elastic/x-pack-elasticsearch@afc0a1443c
This commit is contained in:
parent
3d8c438403
commit
ca48a22ca7
|
@ -2,6 +2,7 @@ import org.elasticsearch.gradle.MavenFilteringHack
|
||||||
|
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
import java.nio.file.Paths
|
||||||
import java.nio.file.StandardCopyOption
|
import java.nio.file.StandardCopyOption
|
||||||
|
|
||||||
apply plugin: 'elasticsearch.esplugin'
|
apply plugin: 'elasticsearch.esplugin'
|
||||||
|
@ -62,10 +63,13 @@ processResources {
|
||||||
if (licenseKey != null) {
|
if (licenseKey != null) {
|
||||||
println "Using provided license key from ${licenseKey}"
|
println "Using provided license key from ${licenseKey}"
|
||||||
} else if (snapshot) {
|
} else if (snapshot) {
|
||||||
licenseKey = 'snapshot.key'
|
licenseKey = Paths.get(project.projectDir.path, 'snapshot.key')
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException('Property license.key must be set for release build')
|
throw new IllegalArgumentException('Property license.key must be set for release build')
|
||||||
}
|
}
|
||||||
|
if (Files.exists(Paths.get(licenseKey)) == false) {
|
||||||
|
throw new IllegalArgumentException('license.key at specified path [' + licenseKey + '] does not exist')
|
||||||
|
}
|
||||||
from(licenseKey) {
|
from(licenseKey) {
|
||||||
rename { String filename -> 'public.key' }
|
rename { String filename -> 'public.key' }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue