1+ apply plugin : ' com.android.library'
2+
3+ android {
4+ compileSdkVersion 28
5+ defaultConfig {
6+ minSdkVersion 16
7+ targetSdkVersion 28
8+ versionCode 1
9+ versionName " 1.0"
10+ testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
11+ externalNativeBuild {
12+ cmake {
13+ abiFilters " x86" , " armeabi-v7a" , " x86_64" , " arm64-v8a"
14+ arguments " -DANDROID_STL=c++_static"
15+ }
16+ }
17+ }
18+ buildTypes {
19+ release {
20+ minifyEnabled false
21+ proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
22+ }
23+ }
24+ externalNativeBuild {
25+ cmake {
26+ path " src/main/cpp/CMakeLists.txt"
27+ }
28+ }
29+ }
30+
31+ configurations {
32+ liquidcore {}
33+ }
34+
35+ dependencies {
36+ implementation fileTree(dir : ' libs' , include : [' *.jar' ])
37+ implementation ' com.android.support:appcompat-v7:28.0.0'
38+ implementation ' com.android.support.constraint:constraint-layout:1.1.3'
39+ testImplementation ' junit:junit:4.12'
40+ androidTestImplementation ' com.android.support.test:runner:1.0.2'
41+ androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2'
42+
43+ if (findProject(' :LiquidCoreAndroid' ) != null ) {
44+ liquidcore project(path : ' :LiquidCoreAndroid' , configuration : ' default' )
45+ implementation project(' :LiquidCoreAndroid' )
46+ } else {
47+ liquidcore ' com.github.LiquidPlayer:LiquidCore:0.6.0'
48+ implementation ' com.github.LiquidPlayer:LiquidCore:0.6.0'
49+ }
50+ }
51+
52+ task extractAddOnLibsAndHeaders (type : Sync ) {
53+ dependsOn configurations. liquidcore
54+
55+ from {
56+ configurations. liquidcore. collect {zipTree(it)}
57+ }
58+ include " jni/**/*.so" , " include/**/*"
59+ into " build/liquidcore-addon"
60+ }
61+
62+ afterEvaluate {
63+ def addon = file(' build/liquidcore-addon' )
64+ if (! addon. exists()) {
65+ if (project. hasProperty(" externalNativeBuildDebug" )) {
66+ externalNativeBuildDebug. dependsOn extractAddOnLibsAndHeaders
67+ }
68+ if (project. hasProperty(" externalNativeBuildRelease" )) {
69+ externalNativeBuildRelease. dependsOn extractAddOnLibsAndHeaders
70+ }
71+ }
72+ }
73+
74+ // build a jar with source files
75+ task sourcesJar (type : Jar ) {
76+ from android. sourceSets. main. java. srcDirs
77+ classifier = ' sources'
78+ }
79+
80+ task javadoc (type : Javadoc ) {
81+ failOnError false
82+ source = android. sourceSets. main. java. sourceFiles
83+ classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
84+ classpath + = configurations. compile
85+ }
86+
87+ // build a jar with javadoc
88+ task javadocJar (type : Jar , dependsOn : javadoc) {
89+ classifier = ' javadoc'
90+ from javadoc. destinationDir
91+ }
92+
93+ artifacts {
94+ archives sourcesJar
95+ archives javadocJar
96+ }
97+
98+
99+ apply plugin : ' com.github.dcendents.android-maven'
100+
101+ group= ' com.github.liquidplayer'
0 commit comments