forked from Tencent/matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/dev-publish-static' into 'feature/dev' (merge r…
…equest !152) feature/dev-publish-static 增加静态链接 libc++ 版本,通过版本号后缀 -STATIC 区分,默认关闭,通过 gradle 参数控制开启,publish 到 maven central 时开启
- Loading branch information
Showing
11 changed files
with
275 additions
and
34 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
85 changes: 85 additions & 0 deletions
85
matrix/matrix-android/matrix-backtrace/cxx-static/build.gradle
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,85 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') | ||
|
||
android { | ||
compileSdkVersion rootProject.compileSdkVersion | ||
|
||
defaultConfig { | ||
minSdkVersion rootProject.MIN_SDK_VERSION_FOR_HOOK | ||
targetSdkVersion rootProject.targetSdkVersion | ||
versionCode rootProject.VERSION_CODE | ||
versionName rootProject.VERSION_NAME | ||
|
||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' | ||
|
||
ndk { | ||
abiFilters rootProject.ABI_FILTERS as String[] | ||
} | ||
|
||
externalNativeBuild { | ||
cmake { | ||
targets = ['wechatbacktrace', 'unwindstack'] | ||
arguments = ['-DANDROID_STL=c++_static', | ||
"-DEnableLOG=${gradle.enableLog() ? "ON" : "OFF"}" as String, | ||
"-DQUT_STATISTIC_ENABLE=${gradle.enableLog() ? "ON" : "OFF"}" as String] | ||
} | ||
|
||
exportHeaders { | ||
from('../src/main/cpp') { | ||
include 'common/*.h' | ||
moveToDir 'backtrace' | ||
} | ||
from('../src/main/cpp/libwechatbacktrace/include') { | ||
include '**/*.h' | ||
moveToDir 'backtrace' | ||
} | ||
from('../src/main/cpp/external/libunwindstack/include') { | ||
include '**/*.h' | ||
moveToDir 'backtrace' | ||
} | ||
from('../src/main/cpp/dexfile/include') { | ||
include '**/*.h' | ||
moveToDir 'backtrace' | ||
} | ||
} | ||
} | ||
} | ||
|
||
buildTypes { | ||
|
||
release { | ||
minifyEnabled false | ||
} | ||
} | ||
|
||
externalNativeBuild { | ||
cmake { | ||
path "../CMakeLists.txt" | ||
} | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java.srcDirs = ['../src/main/java'] | ||
res.srcDirs = ['../src/main/res'] | ||
manifest.srcFile '../src/main/AndroidManifest.xml' | ||
} | ||
} | ||
|
||
} | ||
|
||
apply from: project.file('../dependencies.gradle') | ||
|
||
group = rootProject.GROUP | ||
version = "${rootProject.VERSION_NAME}-STATIC" | ||
|
||
if("External" == rootProject.ext.PUBLISH_CHANNEL) { | ||
apply from: rootProject.file('gradle/android-publish.gradle') | ||
} | ||
else { | ||
apply from: rootProject.file('gradle/WeChatPublish.gradle') | ||
wechatPublish { | ||
artifactId = POM_ARTIFACT_ID | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
matrix/matrix-android/matrix-backtrace/dependencies.gradle
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,10 @@ | ||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
|
||
implementation 'androidx.annotation:annotation:1.0.0' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.1' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' | ||
// implementation "com.tencent.stubs:logger:${rootProject.LOGGER_VERSION}" | ||
implementation project(':matrix-android-lib') | ||
} |
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
71 changes: 71 additions & 0 deletions
71
matrix/matrix-android/matrix-hooks/cxx-static/build.gradle
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,71 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') | ||
|
||
android { | ||
compileSdkVersion rootProject.compileSdkVersion | ||
|
||
defaultConfig { | ||
minSdkVersion MIN_SDK_VERSION_FOR_HOOK | ||
targetSdkVersion rootProject.targetSdkVersion | ||
versionCode rootProject.VERSION_CODE | ||
versionName rootProject.VERSION_NAME | ||
|
||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' | ||
|
||
ndk { | ||
abiFilters rootProject.ABI_FILTERS as String[] | ||
} | ||
|
||
externalNativeBuild { | ||
cmake { | ||
arguments = ['-DANDROID_STL=c++_static', "-DEnableLOG=${gradle.enableLog() ? "ON" : "OFF"}" as String] | ||
} | ||
|
||
exportHeaders { | ||
from('../src/main/cpp/common') { | ||
include '**/*.h' | ||
include '*.h' | ||
} | ||
} | ||
} | ||
} | ||
|
||
buildTypes { | ||
|
||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
externalNativeBuild { | ||
cmake { | ||
path "../CMakeLists.txt" | ||
} | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java.srcDirs = ['../src/main/java'] | ||
res.srcDirs = ['../src/main/res'] | ||
manifest.srcFile '../src/main/AndroidManifest.xml' | ||
} | ||
} | ||
|
||
} | ||
|
||
apply from: project.file('../dependencies.gradle') | ||
|
||
group = rootProject.GROUP | ||
version = "${rootProject.VERSION_NAME}-STATIC" | ||
|
||
if("External" == rootProject.ext.PUBLISH_CHANNEL) { | ||
apply from: rootProject.file('gradle/android-publish.gradle') | ||
} | ||
else { | ||
apply from: rootProject.file('gradle/WeChatPublish.gradle') | ||
wechatPublish { | ||
artifactId = POM_ARTIFACT_ID | ||
} | ||
} |
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,12 @@ | ||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
|
||
testImplementation 'junit:junit:4.12' | ||
implementation 'androidx.annotation:annotation:1.0.0' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.1' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' | ||
// implementation "com.tencent.stubs:logger:${rootProject.LOGGER_VERSION}" | ||
implementation project(':matrix-android-lib') | ||
implementation project(':matrix-backtrace') | ||
implementation project(':matrix-android-commons') | ||
} |
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
72 changes: 72 additions & 0 deletions
72
matrix/matrix-android/matrix-opengl-leak/cxx-static/build.gradle
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,72 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') | ||
|
||
android { | ||
compileSdkVersion rootProject.compileSdkVersion | ||
|
||
defaultConfig { | ||
minSdkVersion MIN_SDK_VERSION_FOR_HOOK | ||
targetSdkVersion rootProject.targetSdkVersion | ||
versionCode rootProject.VERSION_CODE | ||
versionName rootProject.VERSION_NAME | ||
|
||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' | ||
|
||
ndk { | ||
abiFilters rootProject.ABI_FILTERS as String[] | ||
} | ||
|
||
externalNativeBuild { | ||
cmake { | ||
arguments = ['-DANDROID_STL=c++_static', "-DEnableLOG=${gradle.enableLog() ? "ON" : "OFF"}" as String] | ||
} | ||
|
||
exportHeaders { | ||
from('../src/main/cpp/common') { | ||
include '**/*.h' | ||
include '*.h' | ||
} | ||
} | ||
} | ||
} | ||
|
||
buildTypes { | ||
|
||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
externalNativeBuild { | ||
cmake { | ||
path "../CMakeLists.txt" | ||
} | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java.srcDirs = ['../src/main/java'] | ||
res.srcDirs = ['../src/main/res'] | ||
aidl.srcDirs = ['../src/main/aidl'] | ||
manifest.srcFile '../src/main/AndroidManifest.xml' | ||
} | ||
} | ||
|
||
} | ||
|
||
apply from: project.file('../dependencies.gradle') | ||
|
||
group = rootProject.GROUP | ||
version = "${rootProject.VERSION_NAME}-STATIC" | ||
|
||
if("External" == rootProject.ext.PUBLISH_CHANNEL) { | ||
apply from: rootProject.file('gradle/android-publish.gradle') | ||
} | ||
else { | ||
apply from: rootProject.file('gradle/WeChatPublish.gradle') | ||
wechatPublish { | ||
artifactId = POM_ARTIFACT_ID | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
matrix/matrix-android/matrix-opengl-leak/dependencies.gradle
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,11 @@ | ||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
|
||
implementation project(':matrix-android-lib') | ||
implementation project(':matrix-android-commons') | ||
implementation project(':matrix-backtrace') | ||
|
||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'androidx.annotation:annotation:1.0.0' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.1' | ||
} |
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