-
Notifications
You must be signed in to change notification settings - Fork 295
/
Copy pathbuild.gradle
103 lines (87 loc) · 3.16 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
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
archivesBaseName = 'groupie'
android {
compileSdkVersion rootProject.sdkVersion
defaultConfig {
minSdkVersion rootProject.minimumSdkVersion
targetSdkVersion rootProject.sdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation "androidx.recyclerview:recyclerview:1.2.1"
testImplementation "junit:junit:$junit_version"
testImplementation "org.mockito:mockito-core:$mockito_version"
}
group = "com.github.lisawray.groupie"
version = "2.10.1"
task javadoc(type: Javadoc) {
configurations.implementation.canBeResolved(true)
configurations.api.canBeResolved(true)
failOnError false
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
//destinationDir = file("../javadoc/")
classpath += configurations.api
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier = "sources"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
// Because the components are created only during the afterEvaluate phase, you must
// configure your publications using the afterEvaluate() lifecycle method.
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release
artifact(sourcesJar)
// You can then customize attributes of the publication as shown below.
groupId = 'com.github.lisawray.groupie'
artifactId = 'groupie'
version = '2.10.1'
pom.withXml {
def dependenciesNode = (asNode().get("dependencies") as NodeList).get(0) as Node
def configurationNames = ["implementation", "api"]
configurationNames.forEach { configurationName ->
configurations[configurationName].allDependencies.forEach {
if (it.group != null && it.version != "unspecified") {
def dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
dependencyNode.appendNode("version", it.version)
// dependencyNode.appendNode("scope", configurationName)
}
}
}
}
}
}
}
}