-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
121 lines (103 loc) · 3.93 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
120
121
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.5.30' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext.projectArtifactId = { project ->
if (project.name == 'AlsatIPGAndroid') {
return 'alsatipgandroid'
} else {
return null
}
}
allprojects {
group = 'com.alsatpardakht'
version = '1.2.5'
project.ext.artifactId = rootProject.ext.projectArtifactId(project)
}
subprojects { project ->
if (project.ext.artifactId == null) return
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.srcDirs
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
aar(MavenPublication) {
groupId project.group
artifactId project.ext.artifactId
version project.version
pom {
name = project.ext.artifactId
description = 'AlsatIPGCore is an open-source Android library to connect Alsat pardakht peyment API'
url = 'https://github.com/AlsatPardakht/AlsatIPGAndroid'
inceptionYear = '2022'
scm {
url = 'scm:git@github.com:AlsatPardakht/AlsatIPGAndroid.git'
connection = 'scm:git@github.com:AlsatPardakht/AlsatIPGAndroid.git'
developerConnection = 'scm:git@github.com:AlsatPardakht/AlsatIPGAndroid.git'
}
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
organization {
name = 'Alsat pardakht'
url = 'https://alsatpardakht.com'
}
developers {
developer {
id = 'erfanmhat'
name = 'erfan mahdavi athar'
email = 'erfan.mh.at@gmail.com'
}
}
}
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
project.configurations.api.allDependencies.each { dependency ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
}
}
afterEvaluate {
artifact "$buildDir/outputs/aar/$project.name-release.aar"
artifact sourcesJar
artifact javadocJar
}
}
}
repositories {
maven {
name = "OSSRH"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = project.rootProject.properties["ossrhUsername"]
password = project.rootProject.properties["ossrhPassword"]
}
}
}
}
signing {
sign publishing.publications.aar
}
}