This repository has been archived by the owner on Jun 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Android] Split build.gradle file into 5 files. (#2927)
- Loading branch information
1 parent
9b07a12
commit c542823
Showing
7 changed files
with
223 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
def asanAbi = project.hasProperty('asanAbi') ? project.getProperty('asanAbi') : 'arm64-v8a' | ||
def ndkDir = '' | ||
|
||
task checkNdkVersion() { | ||
def rootDir = project.rootDir | ||
def localProperties = new File(rootDir, "local.properties") | ||
if (localProperties.exists()) { | ||
Properties properties = new Properties() | ||
localProperties.withInputStream { instr -> | ||
properties.load(instr) | ||
} | ||
ndkDir = properties.getProperty('ndk.dir') | ||
} | ||
} | ||
|
||
task clearASanLibs(type: Delete){ | ||
delete project.android.sourceSets.main.resources.srcDirs | ||
delete fileTree(project.android.sourceSets.main.jniLibs.srcDirs[-1]) { | ||
include '**/libclang_rt.asan-*-android.so' | ||
} | ||
} | ||
task copyWrapScript(type: Copy,dependsOn: clearASanLibs) { | ||
if(project.hasProperty('enableASan') && "true" == project.getProperty('enableASan')) { | ||
from 'wrap.sh' | ||
into new File(project.android.sourceSets.main.resources.srcDirs[-1], "lib") | ||
eachFile { | ||
it.path = "${asanAbi}/${it.name}" | ||
} | ||
} | ||
} | ||
task copyASanLib(type: Copy,dependsOn: copyWrapScript){ | ||
if(project.hasProperty('enableASan') && "true" == project.getProperty('enableASan')) { | ||
def ndkPath = ndkDir == '' ? System.getenv("ANDROID_NDK_HOME"):ndkDir | ||
def dir = ndkPath + '/toolchains/llvm/prebuilt/' | ||
def renamedAbi = asanAbi | ||
if (asanAbi == "armeabi-v7a" || asanAbi == "armeabi") | ||
renamedAbi = "arm" | ||
if (asanAbi == "arm64-v8a") | ||
renamedAbi = "aarch64" | ||
if (asanAbi == "x86") | ||
renamedAbi = "i686" | ||
new File(dir).eachFileRecurse { file -> | ||
if (file.name == 'libclang_rt.asan-' + renamedAbi + '-android.so') | ||
from file.absolutePath | ||
into project.android.sourceSets.main.jniLibs.srcDirs[-1] | ||
eachFile { | ||
it.path = "${asanAbi}/${it.name}" | ||
} | ||
includeEmptyDirs = false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
task checkstyle(type: Checkstyle) { | ||
configFile file("${project.rootDir}/sdk/config/quality/checkstyle.xml") // Where my checkstyle config is... | ||
// configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath // Where is my suppressions file for checkstyle is... | ||
source 'src' | ||
include '**/*.java' | ||
exclude '**/gen/**' | ||
exclude '**/test/**' | ||
exclude '**/com/taobao/weex/dom/flex/**' | ||
classpath = files() | ||
} | ||
|
||
checkstyle { | ||
toolVersion = '6.9' | ||
} |
Oops, something went wrong.