-
Notifications
You must be signed in to change notification settings - Fork 629
/
build.gradle
161 lines (135 loc) · 5.93 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
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'
}
assemble.dependsOn('lint')
check.dependsOn('checkstyle')
configurations {
ktlint
}
if (System.getenv("JITPACK")) {
group = 'com.github.stripe.stripe-android'
}
dependencies {
implementation project(':payments-core')
implementation project(':stripe-core')
implementation project(':payments-ui-core')
implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion"
implementation "androidx.constraintlayout:constraintlayout:$androidxConstraintlayoutVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidxLifecycleVersion"
implementation "androidx.security:security-crypto:$androidxSecurityVersion"
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"
// Integration with observables
implementation "androidx.compose.runtime:runtime-livedata:$androidxComposeVersion"
implementation "com.google.accompanist:accompanist-flowlayout:$flowlayoutVersion"
implementation "androidx.compose.ui:ui-tooling-preview:$androidxComposeVersion"
testImplementation project(':payments-core')
testImplementation project(':payments-ui-core')
testImplementation "junit:junit:$junitVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
testImplementation "com.google.truth:truth:$truthVersion"
testImplementation "org.mockito:mockito-core:$mockitoCoreVersion"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
testImplementation "org.mockito:mockito-inline:$mockitoCoreVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
testImplementation "androidx.test:core:$androidTestVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutinesVersion"
androidTestImplementation "com.google.truth:truth:$truthVersion"
androidTestImplementation "androidx.test.ext:junit:$androidTestJunitVersion"
// Test rules and transitive dependencies:
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$androidxComposeVersion"
androidTestImplementation "androidx.arch.core:core-testing:$androidxArchCoreVersion"
// 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"
ktlint "com.pinterest:ktlint:$ktlintVersion"
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 21
targetSdkVersion rootProject.ext.compileSdkVersion
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
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 {
freeCompilerArgs = [
"-Xuse-experimental=androidx.compose.ui.ExperimentalComposeUiApi",
"-Xuse-experimental=kotlinx.coroutines.FlowPreview",
"-Xopt-in=kotlin.RequiresOptIn"
]
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
testOptions {
unitTests {
// Note: without this, all Robolectric tests using assets will fail.
includeAndroidResources = true
all {
maxHeapSize = "1024m"
}
}
}
composeOptions {
kotlinCompilerExtensionVersion "$androidxComposeVersion"
}
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 = "link"
artifactName = "link"
artifactDescrption = "The Link module of Stripe Payment Android SDK"
}
apply from: "${rootDir}/deploy/deploy.gradle"