From a7152eb574ab7ad233e7482e10180011f503658f Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Mon, 13 Feb 2017 22:15:49 -0800 Subject: [PATCH] Eliminate the need for `import re` in a BUCK file. Reviewed By: mzlee Differential Revision: D4550304 fbshipit-source-id: 59a101a35ea33aa8043046f64b675fab0f6f889a --- local-cli/templates/HelloWorld/android/app/BUCK | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/local-cli/templates/HelloWorld/android/app/BUCK b/local-cli/templates/HelloWorld/android/app/BUCK index a952351d9d2d62..fa867f628f911d 100644 --- a/local-cli/templates/HelloWorld/android/app/BUCK +++ b/local-cli/templates/HelloWorld/android/app/BUCK @@ -1,5 +1,3 @@ -import re - # To learn about Buck see [Docs](https://buckbuild.com/). # To run your application with Buck: # - install Buck @@ -12,7 +10,7 @@ import re lib_deps = [] for jarfile in glob(['libs/*.jar']): - name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) + name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] lib_deps.append(':' + name) prebuilt_jar( name = name, @@ -20,7 +18,7 @@ for jarfile in glob(['libs/*.jar']): ) for aarfile in glob(['libs/*.aar']): - name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) + name = 'aars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.aar')] lib_deps.append(':' + name) android_prebuilt_aar( name = name,