-
Notifications
You must be signed in to change notification settings - Fork 41
/
build.gradle
176 lines (150 loc) · 5.77 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
plugins {
alias libs.plugins.android.application
alias libs.plugins.dagger.hilt
alias libs.plugins.gradlePlayPublisher
alias libs.plugins.kotlinAndroid
alias libs.plugins.kotlinKapt
alias libs.plugins.kotlinParcelize
}
def paypalProperties = loadPropertiesFromFile("paypal.properties")
android {
namespace 'com.paypal.android'
java {
toolchain {
languageVersion = modules.kotlinToolchainLanguageVersion
}
}
defaultConfig {
applicationId "com.paypal.android"
compileSdk modules.androidCompileSdk
minSdkVersion modules.androidMinSdkVersion
targetSdkVersion modules.androidTargetVersion
versionCode modules.demoAppVersionCode
versionName modules.sdkVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "CLIENT_ID", paypalProperties["CLIENT_ID"] ?: "\"\"")
}
buildFeatures {
// Ref: https://developer.android.com/jetpack/compose/setup
compose true
viewBinding = true
}
composeOptions {
// Ref: https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility
kotlinCompilerExtensionVersion "1.5.14"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
lintOptions {
lintConfig file('../lint.xml')
abortOnError true
warningsAsErrors true
}
sourceSets {
androidTest {
java.srcDirs += "src/androidTestShared/java"
}
}
// https://developer.android.com/build/build-variants#groovy
signingConfigs {
release {
storeFile file(System.getenv('DEMO_KEYSTORE_FILE') ?: 'debug.keystore')
storePassword System.getenv('DEMO_KEYSTORE_PASSWORD') ?: 'android'
keyAlias System.getenv('DEMO_KEY_ALIAS') ?: 'androiddebugkey'
keyPassword System.getenv('DEMO_KEY_PASSWORD') ?: 'android'
}
}
buildTypes {
release {
debuggable false
signingConfig signingConfigs.release
}
debug {
debuggable true
}
}
}
play {
// Ref: https://github.com/Triple-T/gradle-play-publisher/issues/979#issuecomment-884763388
releaseStatus.set(com.github.triplet.gradle.androidpublisher.ReleaseStatus.DRAFT)
serviceAccountCredentials.set(file(System.getenv("DEMO_GCP_SERVICE_ACCOUNT_CREDENTIALS_FILE") ?: '/path/to/credential_file.json'))
}
// Ref: https://developer.android.com/training/dependency-injection/hilt-android#setup
kapt {
// allow references to generated code
correctErrorTypes true
}
dependencies {
implementation project(':CardPayments')
implementation project(':FraudProtection')
implementation project(':PayPalNativePayments')
implementation project(':PayPalWebPayments')
implementation project(':PaymentButtons')
implementation project(':Venmo')
implementation libs.kotlin.stdLib
implementation libs.androidx.coreKtx
implementation libs.androidx.appcompat
implementation libs.android.material
implementation libs.androidx.constraintLayout
implementation libs.lifecycle.runtimeKtx
implementation libs.androidx.fragmentKtx
// TODO: remove dependency when we don't relay on nxo models anymore
implementation(libs.paypal.nativeCheckout) {
exclude module: 'data-collector'
}
// Compose Bill of Materials (BOM) dependency manages compose dependency versions without
// us having to explicitly state versions of individual compose dependencies; the BOM project
// selects dependency versions for each compose dependency that are known by the JetPack team
// to be compatible with one another. The set of dependencies output by the bom have been tested
// and are known to be compatible by the Jetpack Team
// More info: https://developer.android.com/jetpack/compose/bom
// Another ref: https://developer.android.com/jetpack/compose/setup#setup-compose
implementation platform(libs.compose.bom)
androidTestImplementation platform(libs.compose.bom)
implementation libs.compose.material3
implementation libs.compose.uiToolingPreview
debugImplementation libs.compose.uiTooling
implementation libs.lifecycle.viewModelCompose
implementation libs.lifecycle.runtimeCompose
implementation libs.androidx.preferenceKtx
implementation libs.square.retrofit2
implementation libs.square.converterGson
implementation libs.square.loggingInterceptor
implementation libs.dagger.hiltAndroid
kapt libs.dagger.hiltCompiler
implementation libs.navigation.compose
implementation libs.hilt.navigationCompose
testImplementation libs.junit
androidTestImplementation libs.androidx.test.junit
androidTestImplementation libs.androidx.test.espresso
androidTestImplementation libs.androidx.test.runner
androidTestImplementation libs.androidx.test.rules
androidTestImplementation libs.androidx.test.uiAutomator
// compose ui-test
androidTestImplementation libs.compose.uiTestJunit4
debugImplementation libs.compose.uiTestManifest
}
/**
* Loads properties at the specified file path. If the file does not exist,
* this method returns an empty properties object.
* @param filePath
*/
def loadPropertiesFromFile(filePath) {
def result = new Properties()
try {
result.load(new FileInputStream(rootProject.file(filePath)))
} catch (e) { /* ignored */
}
return result
}