-
Notifications
You must be signed in to change notification settings - Fork 629
/
build.gradle
201 lines (171 loc) · 8.36 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
plugins {
id "com.android.library"
id "kotlin-android"
id 'kotlin-kapt'
id 'org.jetbrains.dokka'
id "org.jetbrains.kotlin.plugin.parcelize"
id 'org.jetbrains.kotlin.plugin.serialization'
id 'shot'
}
assemble.dependsOn('lint')
check.dependsOn('checkstyle')
configurations {
ktlint
}
if (System.getenv("JITPACK")) {
group = 'com.github.stripe.stripe-android'
}
dependencies {
implementation project(":link")
implementation project(":payments-core")
implementation project(':payments-ui-core')
compileOnly project(':financial-connections')
implementation "androidx.annotation:annotation:$androidxAnnotationVersion"
implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion"
implementation "androidx.browser:browser:$androidxBrowserVersion"
implementation "androidx.recyclerview:recyclerview:$androidxRecyclerviewVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$androidxLifecycleVersion"
implementation "androidx.fragment:fragment-ktx:$androidxFragmentVersion"
implementation "androidx.constraintlayout:constraintlayout:$androidxConstraintlayoutVersion"
implementation "androidx.activity:activity-ktx:$androidxActivityVersion"
implementation "com.google.android.gms:play-services-wallet:$playServicesWalletVersion"
implementation "com.google.android.material:material:$materialVersion"
implementation "com.google.dagger:dagger:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
implementation "androidx.compose.ui:ui:$androidxComposeVersion"
// Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
implementation "androidx.compose.foundation:foundation:$androidxComposeVersion"
// Material Design
implementation "androidx.compose.material:material:$androidxComposeVersion"
// Material design icons
implementation "androidx.compose.material:material-icons-core:$androidxComposeVersion"
// Integration with activities
implementation "androidx.activity:activity-compose:$androidxActivityVersion"
implementation "androidx.navigation:navigation-compose:$androidxNavigationVersion"
implementation"com.google.accompanist:accompanist-navigation-animation:$accompanistVersion"
// Integration with constraint layouts
implementation "androidx.constraintlayout:constraintlayout-compose:$androidxConstraintlayoutComposeVersion"
// Integration with observables
implementation "androidx.compose.runtime:runtime-livedata:$androidxComposeVersion"
implementation "com.google.accompanist:accompanist-flowlayout:$accompanistVersion"
// Tooling support (Previews, etc.)
debugImplementation "androidx.compose.ui:ui-tooling:$androidxComposeVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion"
testImplementation project(':link')
testImplementation project(':financial-connections')
testImplementation "junit:junit:$junitVersion"
testImplementation "org.mockito:mockito-core:$mockitoCoreVersion"
testImplementation "org.mockito:mockito-inline:$mockitoCoreVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
testImplementation "androidx.test:core:$androidTestVersion"
testImplementation "org.json:json:$jsonVersion"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlinVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutinesVersion"
testImplementation "com.google.truth:truth:$truthVersion"
testImplementation "androidx.test.ext:junit-ktx:$androidTestJunitVersion"
testImplementation "androidx.arch.core:core-testing:$androidxArchCoreVersion"
testImplementation "androidx.fragment:fragment-testing:$androidxFragmentVersion"
androidTestImplementation "com.google.android.libraries.places:places:$placesVersion"
androidTestImplementation "androidx.test.ext:junit:$androidTestJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation ("androidx.test.espresso:espresso-contrib:$espressoVersion") {
exclude group: 'org.checkerframework', module: 'checker'
}
implementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
androidTestImplementation "androidx.test:rules:$androidTestVersion"
androidTestImplementation "androidx.test:runner:$androidTestVersion"
// Test rules and transitive dependencies:
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$androidxComposeVersion"
androidTestUtil "androidx.test:orchestrator:$androidTestVersion"
androidTestImplementation "androidx.test.ext:truth:$androidTestVersion"
androidTestImplementation "com.google.truth:truth:$truthVersion"
// Tooling support (Previews, etc.)
debugImplementation "androidx.compose.ui:ui-tooling:$androidxComposeVersion"
// Needed for createComposeRule, but not createAndroidComposeRule:
debugImplementation "androidx.compose.ui:ui-test-manifest:$androidxComposeVersion"
// Test rules and transitive dependencies:
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$androidxComposeVersion")
ktlint "com.pinterest:ktlint:$ktlintVersion"
}
shot {
applicationId = "com.stripe.android.paymentsheet.test"
tolerance = 1 // 1% tolerance because screenshots look slightly different on arm64-v8a vs x86_64 vs m1 emulators
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 21
targetSdkVersion rootProject.ext.compileSdkVersion
testInstrumentationRunner "com.karumi.shot.ShotTestRunner"
testApplicationId "com.stripe.android.paymentsheet.test"
vectorDrawables.useSupportLibrary = true
// From https://developer.android.com/training/testing/junit-runner:
// > To remove all shared state from your device"s CPU and memory after each test,
// > use the clearPackageData flag.
testInstrumentationRunnerArguments clearPackageData: "true"
}
sourceSets {
main {
res.srcDirs = ['res']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
viewBinding true
}
testOptions {
unitTests {
// Note: without this, all Robolectric tests using assets will fail.
includeAndroidResources = true
all {
maxHeapSize = "1024m"
}
}
}
composeOptions {
kotlinCompilerExtensionVersion "$androidxComposeVersion"
}
lintOptions {
disable "UnrememberedMutableState"
}
dokkaHtml {
outputDirectory = new File("${project.rootDir}/docs/$project.name")
}
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
mainClass = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
// to generate report in checkstyle format prepend following args:
// "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
// see https://github.com/pinterest/ktlint#usage for more
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
mainClass = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
ext {
artifactId = "paymentsheet"
artifactName = "paymentsheet"
artifactDescrption = "The paymentsheet module of Stripe Payment Android SDK"
}
apply from: "${rootDir}/deploy/deploy.gradle"