1+ apply plugin : ' maven-publish'
2+ apply plugin : ' signing'
3+
4+ task androidSourcesJar (type : Jar ) {
5+ archiveClassifier. set(' sources' )
6+ if (project. plugins. findPlugin(" com.android.library" )) {
7+ from android. sourceSets. main. java. srcDirs
8+ } else {
9+ from sourceSets. main. java. srcDirs
10+ }
11+ }
12+
13+ artifacts {
14+ archives androidSourcesJar
15+ }
16+ group = PUBLISH_GROUP_ID
17+ version = PUBLISH_VERSION
18+
19+ afterEvaluate {
20+ publishing {
21+ publications {
22+ release(MavenPublication ) {
23+ // The coordinates of the library, being set from variables that
24+ // we'll set up later
25+ groupId PUBLISH_GROUP_ID
26+ artifactId PUBLISH_ARTIFACT_ID
27+ version PUBLISH_VERSION
28+
29+ // / Two artifacts, the `aar` (or `jar`) and the sources
30+ if (project. plugins. findPlugin(" com.android.library" )) {
31+ from components. release
32+ } else {
33+ artifact(" $buildDir /libs/${ project.getName()} -${ version} .jar" )
34+ }
35+
36+ artifact androidSourcesJar
37+
38+ // Mostly self-explanatory metadata
39+ pom {
40+ name = PUBLISH_ARTIFACT_ID
41+ description = ' Highlight different features of the app using Jetpack Compose'
42+ url = ' https://github.com/canopas/Intro-showcase-view'
43+ licenses {
44+ license {
45+ name = ' License'
46+ url = ' https://github.com/canopas/Intro-showcase-view/blob/master/License'
47+ }
48+ }
49+ developers {
50+ developer {
51+ id = ' cp-radhika-s'
52+ name = ' Radhika canopas'
53+ email = ' radhika.s@canopas.com'
54+ }
55+ // Add all other devs here...
56+ }
57+
58+ // Version control info - if you're using GitHub, follow the
59+ // format as seen here
60+ scm {
61+ connection = ' scm:git:github.com/canopas/Intro-showcase-view.git'
62+ developerConnection = ' scm:git:ssh://github.com/canopas/Intro-showcase-view.git'
63+ url = ' https://github.com/canopas/Intro-showcase-view.git'
64+ }
65+ }
66+ }
67+ }
68+ }
69+ }
70+ signing {
71+ useInMemoryPgpKeys(
72+ rootProject. ext[" signing.keyId" ],
73+ rootProject. ext[" signing.key" ],
74+ rootProject. ext[" signing.password" ],
75+ )
76+
77+ sign publishing. publications
78+ }
0 commit comments