@@ -116,9 +116,6 @@ android {
116
116
}
117
117
}
118
118
119
- def ARMEABI_Size = new File (projectDir," libs/armeabi/libweexcore.so" ). length();
120
- def ARMEABIV7_Size = new File (projectDir," libs/armeabi-v7/libweexcore.so" ). length();
121
- def X86_Size = new File (projectDir," libs/x86/libweexcore.so" ). length();
122
119
def ndkversion = 16 ;
123
120
def api_level = " " ;
124
121
def compile_tool = " clang" ;
@@ -128,14 +125,8 @@ android {
128
125
} else {
129
126
api_level = " android-19" ;
130
127
}
131
- println " ARMEABI_Size: " + ARMEABI_Size ;
132
- println " ARMEABIV7_Size:" + ARMEABIV7_Size ;
133
- println " X86_Size:" + X86_Size ;
134
128
135
129
defaultConfig {
136
- buildConfigField " long" , " ARMEABI_Size" , " ${ ARMEABI_Size} "
137
- buildConfigField " long" , " ARMEABIV7_Size" , " ${ ARMEABIV7_Size} "
138
- buildConfigField " long" , " X86_Size" , " ${ X86_Size} "
139
130
buildConfigField " String" , " buildJavascriptFrameworkVersion" , " \" ${ jsfmVersion} \" "
140
131
buildConfigField " String" , " buildVersion" , " \" ${ version} \" "
141
132
minSdkVersion project. minSdkVersion
@@ -152,15 +143,13 @@ android {
152
143
abiFilters " armeabi-v7a" , " armeabi" , " x86"
153
144
}
154
145
}
155
- if (project. buildCpp) {
156
- externalNativeBuild {
157
- cmake {
158
- arguments ' -DANDROID_PLATFORM=' + " ${ api_level} " ,
159
- ' -DANDROID_TOOLCHAIN=' + " ${ compile_tool} " ,
160
- ' -DANDROID_STL=' + " ${ cxx_stl} " ,
161
- ' -DCMAKE_BUILD_TYPE=Release' ,
162
- ' -DENABLE_ASAN=false'
163
- }
146
+ externalNativeBuild {
147
+ cmake {
148
+ arguments ' -DANDROID_PLATFORM=' + " ${ api_level} " ,
149
+ ' -DANDROID_TOOLCHAIN=' + " ${ compile_tool} " ,
150
+ ' -DANDROID_STL=' + " ${ cxx_stl} " ,
151
+ ' -DCMAKE_BUILD_TYPE=Release' ,
152
+ ' -DENABLE_ASAN=false'
164
153
}
165
154
}
166
155
}
@@ -181,11 +170,9 @@ android {
181
170
}
182
171
}
183
172
184
- if (project. buildCpp) {
185
- externalNativeBuild {
186
- cmake {
187
- path ' ../../weex_core/CMakeLists.txt'
188
- }
173
+ externalNativeBuild {
174
+ cmake {
175
+ path ' ../../weex_core/CMakeLists.txt'
189
176
}
190
177
}
191
178
@@ -371,54 +358,4 @@ bintray {
371
358
name = project. version
372
359
}
373
360
}
374
- }
375
-
376
- def copy_so_and_backup () {
377
- def cpu_list = [" armeabi" , " armeabi-v7a" , " x86" ]
378
- cpu_list. forEach { cpu_name ->
379
- File so_file = new File (project. buildDir, " /intermediates/bundles/default/jni/" + cpu_name)
380
- if (so_file. exists()) {
381
- println (so_file. getAbsolutePath())
382
- copy {
383
- from so_file. getAbsolutePath()
384
- into new File (" libs/" + cpu_name)
385
- include ' libweexjss.so' , ' libweexcore.so'
386
- }
387
-
388
- if (cpu_name == " armeabi" ) {
389
- File back_file = new File (project. buildDir, " /intermediates/cmake/release/obj/armeabi/" )
390
- // backup so to project'parent's path
391
- File backup_des = new File (project. buildDir. parentFile. parentFile. parentFile. parentFile," weex_so_armeabi" )
392
- if (backup_des. exists()){
393
- backup_des. deleteDir()
394
- backup_des. mkdir()
395
- }
396
- println (backup_des. absolutePath)
397
-
398
- println (" so backup to " + backup_des. absolutePath)
399
- copy {
400
- from back_file. getAbsolutePath()
401
- into backup_des
402
- include ' libweexjss.so' , ' libweexcore.so'
403
- }
404
- }
405
- }
406
- }
407
- }
408
-
409
- task deleteLibs (type : Delete ){ item ->
410
- project. android. defaultConfig. ndk. abiFilters. each{
411
- item. delete " libs/${ it} /libweexcore.so" , " libs/${ it} /libweexjss.so"
412
- }
413
- }
414
-
415
- afterEvaluate { project ->
416
- project. tasks. find { (it. name. contains(" assembleRelease" )) }?. doLast {
417
- println (" begin_copy_so" )
418
- copy_so_and_backup()
419
- }
420
-
421
- if (project. buildCpp){
422
- transformNativeLibsWithStripDebugSymbolForRelease. dependsOn deleteLibs
423
- }
424
361
}
0 commit comments