From 155ee948efe2414f91bdc9c03f83d78429d777a2 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Thu, 17 Nov 2016 19:34:39 +0000 Subject: [PATCH] Strip the C++ binaries when built via gradle to reduce download size (elastic/elasticsearch#323) By default this isn't done when building directly with make, so developers should still have debugging symbols in binaries they build themselves Original commit: elastic/x-pack-elasticsearch@64cd92431b8dbf9b591c77b6602949c1df531564 --- build.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fc016a8b0ca..41093322d19 100644 --- a/build.gradle +++ b/build.gradle @@ -55,6 +55,11 @@ task cppMake(type: Exec) { args '-c', 'source cpp/set_env.sh && ' + make + ' -j' + numCpus } +task cppStrip(type: Exec) { + commandLine bash + args '-c', 'source cpp/set_env.sh && cpp/strip_binaries.sh' +} + task cppTest(type: Exec) { commandLine bash args '-c', 'source cpp/set_env.sh && ' + make + ' -j' + numCpus + ' test' @@ -63,9 +68,11 @@ task cppTest(type: Exec) { task cppAll { dependsOn 'cppObjCompile' dependsOn 'cppMake' + dependsOn 'cppStrip' dependsOn 'cppTest' tasks.findByName('cppMake').mustRunAfter 'cppObjCompile' - tasks.findByName('cppTest').mustRunAfter 'cppMake' + tasks.findByName('cppStrip').mustRunAfter 'cppMake' + tasks.findByName('cppTest').mustRunAfter 'cppStrip' } subprojects {