-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.gradle
50 lines (43 loc) · 1.61 KB
/
publish.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
/* To test everything builds and artifacts are published to
* mavenLocal ($HOME/.m2/repository),
* run `./gradlew publishToMavenLocal` at the root of the project.
*/
// Required plugin for publishing library module
apply plugin: 'maven-publish'
// Replace nisrulz with <your_github_username>
final group = "com.github.wufuqi123"
final artifact = "RecyclerViewBindingAdapter"
final versionCode = 9
final versionName = "1.0.9"
android {
defaultConfig {
// define version
buildConfigField 'int', 'VERSION_CODE', "${versionCode}"
buildConfigField 'String', 'VERSION_NAME', "\"${versionName}\""
}
}
// 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
// You can then customize attributes of the publication as shown below.
groupId = group
artifactId = artifact
version = versionName
}
// Creates a Maven publication called “debug”.
debug(MavenPublication) {
// Applies the component for the debug build variant.
from components.debug
groupId = group + ".debug"
artifactId = artifact + "-debug"
version = versionName
}
}
}
}