-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
119 lines (106 loc) · 3.88 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
buildscript {
repositories {
maven { url 'file:///usr/share/maven-repo' }
jcenter()
}
dependencies {
// 2.2.2 is the version that is included in Debian/stretch
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
apply plugin: 'com.android.library'
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--always'
standardOutput = stdout
}
def versionName = stdout.toString().trim()
allprojects {
setVersion versionName
setGroup 'info.guardianproject.panic'
}
android {
// these are the versions that are included in Debian/stretch
compileSdkVersion 23
buildToolsVersion '24.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
lintOptions {
htmlReport true
xmlReport false
textReport false
}
}
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
return; // Skip debug builds.
}
def task = project.tasks.create "jar${name.capitalize()}", Jar
task.dependsOn variant.javaCompile, sourcesJar, javadocJar, createPom
task.from variant.javaCompile.destinationDir
task.exclude('info/guardianproject/**/BuildConfig.**')
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
options.addStringOption('notimestamp')
failOnError false
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
apply plugin: 'maven'
task createPom << {
pom {
project {
name 'PanicKit'
artifactId 'panic'
inceptionYear '2015'
url "https://github.com/guardianproject/PanicKit"
description "PanicKit is a collection of tools for letting panic trigger and panic receiver apps safely and easily connect to each other. The trigger apps are the part that the user will actual engage when in a panic situation. The receiver apps receive the trigger signal from the trigger apps when the user has initiated the panic response. The connections between trigger and receiver can be strictly enforced based on Package Name and APK signing key."
issueManagement {
system 'GitHub'
url 'https://github.com/guardianproject/PanicKit/issues'
}
mailingLists {
mailingList {
name 'Guardian Project Dev Mailing List'
subscribe 'https://lists.mayfirst.org/mailman/listinfo/guardian-dev'
archive 'http://lists.mayfirst.org/pipermail/guardian-dev/'
}
}
licenses {
license {
name 'GNU Lesser General Public License, version 2.1 or newer (LGPLv2.1+)'
url 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html'
distribution 'repo'
}
}
scm {
connection 'scm:https://github.com/guardianproject/PanicKit.git'
developerConnection 'scm:[email protected]:guardianproject/PanicKit.git'
url 'scm:https://github.com/guardianproject/PanicKit'
}
}
}.writeTo(project.getBuildDir().toString() + "/libs/" + project.name + "-" + project.version + ".pom")
}