File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 4
4
from six import PY2 , with_metaclass
5
5
6
6
import hashlib
7
- from re import match
7
+ from re import match , IGNORECASE
8
8
9
9
import sh
10
10
import shutil
@@ -758,6 +758,15 @@ class BootstrapNDKRecipe(Recipe):
758
758
759
759
dir_name = None # The name of the recipe build folder in the jni dir
760
760
761
+ def should_build (self , arch ):
762
+ lib_dir = self .get_lib_dir (arch )
763
+ if not exists (lib_dir ):
764
+ return True
765
+ for f in listdir (lib_dir ):
766
+ if match ('lib{name}.so' .format (name = self .name ), f , IGNORECASE ):
767
+ return False
768
+ return True
769
+
761
770
def clean_build (self , arch = None ):
762
771
# we must set python recipe first or `get_recipe_env` will fail
763
772
self .ctx .python_recipe = Recipe .get_recipe (
@@ -782,6 +791,9 @@ def get_build_dir(self, arch):
782
791
'this is necessary' .format (self .name ))
783
792
return join (self .get_build_container_dir (arch ), self .dir_name )
784
793
794
+ def get_lib_dir (self , arch ):
795
+ return join (self .ctx .bootstrap .build_dir , 'obj' , 'local' , arch .arch )
796
+
785
797
def get_jni_dir (self ):
786
798
return join (self .ctx .bootstrap .build_dir , 'jni' )
787
799
You can’t perform that action at this time.
0 commit comments