-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
233 lines (196 loc) · 7.1 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'kotlin-android'
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.2'
classpath 'com.google.gms:google-services:4.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
}
}
ext {
Repo = 'Maven'
publishedGroupId = 'com.clevertap.android'
libraryName = 'clevertap-segment-integration'
artifact = 'clevertap-segment-android'
libraryDescription = 'CleverTap Integration for Segment Android Analytics'
siteUrl = 'https://github.com/CleverTap/clevertap-segment-android'
gitUrl = 'https://github.com/CleverTap/clevertap-segment-android.git'
libraryVersion = '1.7.0'
licenseName = 'The MIT License (MIT)'
licenseUrl = 'http://opensource.org/licenses/MIT'
allLicenses = ["MIT"]
}
ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.secretKeyRingFile"] = ''
ext["ossrhUsername"] = ''
ext["ossrhPassword"] = ''
ext["sonatypeStagingProfileId"] = ''
ext["developerId"] = ''
ext["developerName"] = ''
ext["developerEmail"] = ''
version = libraryVersion
group = publishedGroupId
android {
compileSdkVersion 34
defaultConfig {
minSdkVersion 19
targetSdkVersion 34
versionCode 10700
versionName "1.7.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
all {
jvmArgs '-noverify'
}
}
}
buildTypes {
debug{
buildConfigField("long", "VERSION_CODE", "${defaultConfig.versionCode}")
buildConfigField("String","VERSION_NAME","\"${defaultConfig.versionName}\"")
}
release {
buildConfigField("long", "VERSION_CODE", "${defaultConfig.versionCode}")
buildConfigField("String","VERSION_NAME","\"${defaultConfig.versionName}\"")
}
}
libraryVariants.all { variant ->
variant.outputs.all {
if (variant.getName().toLowerCase().contains('release')) {
outputFileName = "${artifact}-${libraryVersion}.aar"
} else if (variant.getName().toLowerCase().contains('debug')) {
outputFileName = "${artifact}-${variant.name}-${libraryVersion}.aar"
}
}
}
namespace 'com.segment.analytics.android.integrations.clevertap'
}
task sourcesJar(type: Jar) {
archiveBaseName.set("$artifact")
from android.sourceSets.main.java.srcDirs
archiveClassifier.set('sources')
}
artifacts {
//archives javadocJar
archives sourcesJar
}
Properties properties = new Properties()
if (project.rootProject.file('local.properties').exists()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
properties.each { name, value ->
ext[name] = value
}
}else{
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
}
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 publishedGroupId
artifactId artifact
version version
artifact sourcesJar
pom {
name = artifact
description = libraryDescription
url = siteUrl
packaging = "aar"
licenses {
license {
name = licenseName
url = licenseUrl
}
}
developers {
developer {
id = developerId
name = developerName
email = developerEmail
}
// Add all other devs here...
}
// Version control info - if you're using GitHub, follow the format as seen here
scm {
connection = 'scm:git:github.com/CleverTap/clevertap-android-sdk.git'
developerConnection = 'scm:git:ssh:github.com/CleverTap/clevertap-android-sdk.git'
url = 'https://github.com/CleverTap/clevertap-android-sdk/tree/master'
}
}
}
}
// The repository to publish to, Sonatype/MavenCentral
repositories {
maven {
// This is an arbitrary name, you may also use "mavencentral" or
// any other name that's descriptive for you
name = Repo
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}
}
signing {
sign publishing.publications
}
dependencies {
repositories {
mavenCentral()
maven {
url "https://maven.google.com"
}
google()
}
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly 'com.segment.analytics.android:analytics:4.11.3'
compileOnly 'androidx.annotation:annotation:1.2.0'
implementation 'com.clevertap.android:clevertap-android-sdk:7.0.2'
testImplementation 'androidx.test:core:1.4.0'
testImplementation 'androidx.core:core:1.4.0'
testImplementation "androidx.fragment:fragment-ktx:1.3.6"
testImplementation("com.google.android.gms:play-services-tasks:15.0.0")
testImplementation 'junit:junit:4.13.2'
testImplementation('org.robolectric:robolectric:4.7.3') {
}
testImplementation 'com.segment.analytics.android:analytics-tests:4.5.0'
testImplementation 'org.assertj:assertj-core:2.6.0'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'org.mockito:mockito-inline:4.6.1'
testImplementation "org.json:json:20140107"
androidTestImplementation 'androidx.annotation:annotation:1.2.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
}