-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
128 lines (108 loc) · 3.9 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
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group='com.codepath.libraries'
ext {
POM_ARTIFACT_ID = "asynchttpclient"
POM_NAME = "CodePath Async Http Client"
POM_DESCRIPTION = "Async Http Client wrapper using OkHttp"
BASE_VERSION = 2
VERSION_NAME = "2.2.0"
GROUP = 'com.codepath.libraries'
POM_URL = "https://github.com/codepath/android-oauth-handler/"
POM_SCM_URL = 'https://github.com/codepath/AsyncHttpClient'
POM_LICENCE_NAME = "The Apache Software License, Version 2.0"
POM_LICENCE_URL = "http://www.apache.org/licenses/LICENSE-2.0.txt"
POM_DEVELOPER_ID = "codepath"
POM_DEVELOPER_NAME = "CodePath, Inc."
}
version = VERSION_NAME
android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode BASE_VERSION
versionName VERSION_NAME
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
api "com.squareup.okhttp3:okhttp:4.9.0"
api 'com.facebook.stetho:stetho-okhttp3:1.5.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
// 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 androidSourcesJar
// You can then customize attributes of the publication as shown below.
groupId = GROUP
artifactId = POM_ARTIFACT_ID
version = VERSION_NAME
pom {
name = POM_NAME
url = POM_URL
description = POM_DESCRIPTION
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
}
}
developers {
developer {
id = POM_DEVELOPER_ID
name = POM_DEVELOPER_NAME
}
}
scm {
url = POM_SCM_URL
}
}
}
}
repositories {
maven {
name = "Sonatype"
credentials {
username = System.getenv('NEXUS_USERNAME')
password = System.getenv('NEXUS_PASSWORD')
}
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
setUrl(url)
}
}
}
}
signing {
// gpg on MacOS is the same as gpg2
// ln -s /usr/local/bin/gpg /usr/local/bin/gpg2
// Make sure to populate the variables in gradle.properties
// signing.gnupg.keyName=XXX
// signing.gnupg.passpharse
useGpgCmd()
sign(publishing.publications)
}