-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
145 lines (127 loc) · 3.96 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
buildscript {
ext.kotlin_version = '1.5.0'
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.1"
}
}
repositories {
google()
mavenCentral()
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
apply plugin: "org.jlleitschuh.gradle.ktlint"
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName project.getProperty('libraryVersion')
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
debug {
buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}\"")
debuggable true
}
release {
buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}\"")
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
testOptions {
kotlinOptions {
freeCompilerArgs += [
'-Xopt-in=kotlin.RequiresOptIn',
]
}
}
}
ktlint {
version = "0.50.0"
verbose = true
}
task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
}
task testLogging(type: Test) {
testLogging {
events "passed", "skipped", "failed"
}
}
task copyLibs(type: Copy) {
from configurations.compile
into 'libs'
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0'
testImplementation "io.mockk:mockk:1.12.0"
testImplementation 'com.github.tomakehurst:wiremock:2.27.2'
testImplementation "org.slf4j:slf4j-simple:1.8.0-beta4"
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.0'
}
artifacts {
archives sourceJar
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId 'com.statsig'
artifactId 'android-sdk'
version project.getProperty('libraryVersion')
pom {
name = "Statsig Android SDK"
description = "A SDK for integrating Statsig with Android Apps"
url = "https://github.com/statsig-io/android-sdk"
organization {
name = "Statsig"
url = "https://www.statsig.com"
}
licenses {
license {
name = "Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}
developers {
developer {
id = "tore"
name = "Tore Hanssen"
email = "[email protected]"
}
}
}
}
}
repositories {
maven {
url "$buildDir/repo"
}
}
}
}