This repository has been archived by the owner on Jul 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
138 lines (117 loc) · 3.89 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "java"
id "maven-publish"
id 'signing'
id 'io.codearte.nexus-staging' version '0.21.0'
}
repositories {
mavenCentral()
}
group = 'com.mangopay'
version = '1.2.2'
task sourceJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives sourceJar, javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
artifact javadocJar
pom {
groupId = 'com.mangopay'
name = 'cardregistration-android-kit'
description = 'Mangopay Card Registration Kit for Android'
url = 'https://github.com/Mangopay/cardregistration-android-kit'
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
distribution = 'repo'
}
}
scm {
url = '[email protected]:mangopay/cardregistration-android-kit.git'
connection = 'scm:git:[email protected]:mangopay/cardregistration-android-kit.git'
developerConnection = 'scm:git:[email protected]:mangopay/cardregistration-android-kit.git'
}
developers {
developer {
id = 'cata.craciun'
name = 'Catalin Craciun'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
credentials {
username = System.getenv("MAVEN_USERNAME") ?: ""
password = System.getenv("MAVEN_PASSWORD") ?: ""
}
}
}
}
if (project.hasProperty('signing.keyId')) {
apply plugin: 'signing'
signing {
sign publishing.publications.mavenJava
}
}
tasks.withType(Javadoc) {
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
allprojects {
repositories {
google()
mavenCentral()
}
afterEvaluate { project ->
def propsFile = rootProject.file('keystore.properties')
def configName = 'release'
if (propsFile.exists() && android.signingConfigs.hasProperty(configName)) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
android.signingConfigs[configName].storeFile = file(props['storeFile'])
android.signingConfigs[configName].storePassword = props['storePassword']
android.signingConfigs[configName].keyAlias = props['keyAlias']
android.signingConfigs[configName].keyPassword = props['keyPassword']
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
signing {
if (project.hasProperty('signing.keyId') && project.hasProperty('signing.password') && project.hasProperty('signing.secretKeyRingFile')) {
sign configurations.archives
/* Uncomment this if you use shadow in your build process */
// sign configurations.shadow
}
}