forked from mrmaffen/vlc-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
168 lines (141 loc) · 4.67 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'org.ajoberstar:gradle-git:1.3.2'
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile "com.android.support:support-v4:23.1.1"
compile 'com.android.support:support-annotations:23.1.1'
}
allprojects {
version = VERSION_NAME
group = GROUP
repositories {
mavenCentral()
}
}
import org.ajoberstar.grgit.Grgit
project.ext.vlcAndroidSource = file('vlc-android')
project.ext.vlcSource = file('vlc-android/vlc')
task cloneVlcAndroid << {
Grgit.clone(uri: 'https://code.videolan.org/videolan/vlc-android.git',
dir: project.ext.vlcAndroidSource)
}
// Only clone once.
cloneVlcAndroid.onlyIf { !project.ext.vlcAndroidSource.exists() }
task updateVlcCheckout(dependsOn: 'cloneVlcAndroid') << {
try {
def repo = Grgit.open(project.ext.vlcSource)
repo.pull(rebase: true)
}
catch (RuntimeException e) {
logger.warn("Wasn't able to update checkout at " + project.ext.vlcSource + ": "
+ e.getClass() + " - " + e.getLocalizedMessage());
}
}
// Don't update vlc checkout if it doesn't exist yet.
// This is the case when we're building for the first time.
updateVlcCheckout.onlyIf { project.ext.vlcSource.exists() }
task purgeOldJniLibs(type: Delete, dependsOn: 'updateVlcCheckout') {
delete "src/main/jniLibs"
}
task purgeOldJava(type: Delete, dependsOn: 'purgeOldJniLibs') {
delete "src/main/java"
}
task compileVlcArmv7a(type: Exec, dependsOn: 'purgeOldJava') {
workingDir project.ext.vlcAndroidSource
commandLine './compile.sh'
args "-a", "armeabi-v7a"
args "release" // Remove this to build a debug libvlc
args "-l" // only build libvlc
}
task buildVlcArmv7a(type: Copy, dependsOn: 'compileVlcArmv7a') {
from(vlcAndroidSource.getAbsolutePath() + '/libvlc/jni/libs/armeabi-v7a/')
into('src/main/jniLibs/armeabi-v7a/')
finalizedBy 'copyLibVlcFiles'
}
/*
task compileVlcArmv8a(type: Exec, dependsOn: 'purgeOldJava') {
workingDir project.ext.vlcAndroidSource
commandLine './compile.sh'
args "-a", "arm64-v8a"
args "release" // Remove this to build a debug libvlc
args "-l" // only build libvlc
}
task buildVlcArmv8a(type: Copy, dependsOn: 'compileVlcArmv8a') {
from(vlcAndroidSource.getAbsolutePath() + '/libvlc/jni/libs/arm64-v8a/')
into('src/main/jniLibs/arm64-v8a/')
finalizedBy 'copyLibVlcFiles'
}
*/
task compileVlcMips(type: Exec, dependsOn: 'purgeOldJava') {
workingDir project.ext.vlcAndroidSource
commandLine './compile.sh'
args "-a", "mips"
args "release" // Remove this to build a debug libvlc
args "-l" // only build libvlc
}
task buildVlcMips(type: Copy, dependsOn: 'compileVlcMips') {
from(vlcAndroidSource.getAbsolutePath() + '/libvlc/jni/libs/mips/')
into('src/main/jniLibs/mips/')
finalizedBy 'copyLibVlcFiles'
}
task compileVlcX86(type: Exec, dependsOn: 'purgeOldJava') {
workingDir project.ext.vlcAndroidSource
commandLine './compile.sh'
args "-a", "x86"
args "release" // Remove this to build a debug libvlc
args "-l" // only build libvlc
}
task buildVlcX86(type: Copy, dependsOn: 'compileVlcX86') {
from(vlcAndroidSource.getAbsolutePath() + '/libvlc/jni/libs/x86/')
into('src/main/jniLibs/x86/')
finalizedBy 'copyLibVlcFiles'
}
/*
task compileVlcX8664(type: Exec, dependsOn: 'purgeOldJava') {
workingDir project.ext.vlcAndroidSource
commandLine './compile.sh'
args "-a", "x86_64"
args "release" // Remove this to build a debug libvlc
args "-l" // only build libvlc
}
task buildVlcX8664(type: Copy, dependsOn: 'compileVlcX8664') {
from(vlcAndroidSource.getAbsolutePath() + '/libvlc/jni/libs/x86_64/')
into('src/main/jniLibs/x86_64/')
finalizedBy 'copyLibVlcFiles'
}
*/
task copyLibVlcFiles(type: Copy) {
from(vlcAndroidSource.getAbsolutePath() + '/libvlc/src/')
into('src/main/java')
}
task buildLibVlc() {
}
buildLibVlc.dependsOn {
tasks.findAll { task -> task.name.startsWith('buildVlc') }
}
tasks.withType(Javadoc).all { enabled = false }
//upload aar to maven central with sonatype
apply from: 'https://raw.githubusercontent.com/chrisbanes/gradle-mvn-push/97de89785bdbf0bc0b380fb60851cabc552811dc/gradle-mvn-push.gradle'