-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaven.gradle
69 lines (60 loc) · 1.93 KB
/
maven.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
apply plugin: 'com.github.dcendents.android-maven'
apply from: "${rootProject.projectDir}/constants.gradle"
project.archivesBaseName = mavenArtifactId
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.getSrcDirs()
classifier "sources"
}
artifacts {
archives sourcesJar
}
android.libraryVariants.all { variant ->
task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) {
source = variant.javaCompile.source
classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath())
options {
encoding 'UTF-8'
}
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
task ("javadoc${variant.name.capitalize()}Jar", type: Jar, dependsOn: "generate${variant.name.capitalize()}Javadoc") {
classifier = 'javadoc'
from tasks.getByName("generate${variant.name.capitalize()}Javadoc").destinationDir
}
artifacts {
archives tasks.getByName("javadoc${variant.name.capitalize()}Jar")
}
}
install {
repositories.mavenInstaller {
pom.project {
name projectName
description projectDesc
url githubUrl
inceptionYear Calendar.getInstance().get(Calendar.YEAR);
packaging 'aar'
groupId mavenGroup
artifactId mavenArtifactId
version mavenVersion
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
connection "${githubUrl}.git"
url githubUrl
}
developers {
developer {
id 'ligboy'
name 'ligboy'
email '[email protected]'
}
}
}
}
}