This repository has been archived by the owner on Jan 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
117 lines (96 loc) · 2.54 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:1.3.1"
classpath "com.jakewharton.sdkmanager:gradle-plugin:0.12.0"
}
}
apply plugin: "android-sdk-manager"
apply plugin: "com.android.library"
apply plugin: "maven"
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
}
}
dependencies {
repositories {
mavenCentral()
}
dependencies {
compile "com.android.support:support-annotations:22.2.1"
}
}
task cloneSdk << {
exec {
commandLine "git", "clone", "git://git.videolan.org/vlc-ports/android.git", "vlc-android"
}
exec {
workingDir file("vlc-android")
commandLine "git", "checkout", readSdkProperty("version.vlc.android")
}
exec {
workingDir file("vlc-android")
commandLine "git", "clone", "git://git.videolan.org/vlc.git", "vlc"
}
exec {
workingDir file("vlc-android/vlc")
commandLine "git", "checkout", readSdkProperty("version.vlc")
}
}
cloneSdk.onlyIf {
!file("vlc-android").exists() && !file("vlc-android/vlc").exists()
}
task compileSdk(dependsOn: cloneSdk) << {
exec {
workingDir file("vlc-android")
commandLine "sh", "compile-libvlc.sh", "--release"
}
}
task buildSdk(dependsOn: compileSdk) << {
copy {
from "vlc-android/libvlc/jni/libs"
into "src/main/jniLibs"
}
copy {
from "vlc-android/libvlc/src"
into "src/main/java"
}
}
task cleanSdk << {
file("vlc-android").deleteDir()
}
uploadArchives {
repositories {
mavenDeployer {
repository url: "file://${mavenLocalPath()}"
pom {
groupId = readMavenProperty("pom.group")
artifactId = readMavenProperty("pom.artifact")
version = readMavenProperty("pom.version")
}
}
}
}
def readSdkProperty(property) {
return readProperty("sdk.properties", property)
}
def readMavenProperty(property) {
return readProperty("maven.properties", property)
}
def readProperty(propertiesFileName, property) {
def propertiesFile = file(propertiesFileName)
def properties = new Properties()
properties.load(propertiesFile.newInputStream())
return properties[property]
}
def mavenLocalPath() {
def homePath = System.getProperty("user.home")
def mavenPath = ".m2/repository"
return new File(homePath, mavenPath).absolutePath
}