-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathbuild.gradle
More file actions
203 lines (170 loc) · 7.34 KB
/
build.gradle
File metadata and controls
203 lines (170 loc) · 7.34 KB
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
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
def msalVersion = "5.7.1"
if (project.hasProperty("distMsalVersion")) {
msalVersion = distMsalVersion
}
android {
packagingOptions {
pickFirst 'META-INF/common4j.kotlin_module'
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
final String BROKER_HOST = "BrokerHost"
final String BROKER_MICROSOFT_AUTHENTICATOR = "BrokerMicrosoftAuthenticator"
final String BROKER_COMPANY_PORTAL = "BrokerCompanyPortal"
final String BROKER_LTW = "BrokerLTW"
final String AUTO_BROKER = "AutoBroker"
final String SELECTED_BROKER = "SELECTED_BROKER"
signingConfigs {
debug {
storeFile file("./debug.keystore")
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
storeFile file("./debug.keystore")
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
multiDexEnabled true
namespace = "com.microsoft.identity.client.msal.automationapp"
applicationId "com.msft.identity.client.sample"
minSdkVersion rootProject.ext.automationAppMinSDKVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// The following argument makes the Android Test Orchestrator run its
// "pm clear" command after each test invocation. This command ensures
// that the app's state is completely cleared between tests.
testInstrumentationRunnerArguments clearPackageData: 'true'
// constants
buildConfigField("String", BROKER_MICROSOFT_AUTHENTICATOR, "\"$BROKER_MICROSOFT_AUTHENTICATOR\"")
buildConfigField("String", BROKER_COMPANY_PORTAL, "\"$BROKER_COMPANY_PORTAL\"")
buildConfigField("String", BROKER_LTW, "\"$BROKER_LTW\"")
buildConfigField("String", BROKER_HOST, "\"$BROKER_HOST\"")
buildConfigField("String", AUTO_BROKER, "\"$AUTO_BROKER\"")
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
animationsDisabled = true
}
buildTypes {
release {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
// testCoverageEnabled flag is set to true to get coverage reports for Android Tests
testCoverageEnabled false
multiDexKeepProguard file('proguard-multidex-rules.pro')
}
}
testBuildType = "debug"
lintOptions {
abortOnError false
}
flavorDimensions "main", "broker"
productFlavors {
local {
dimension "main"
applicationIdSuffix ".local"
versionNameSuffix "-local"
resValue("string", "application_name", "msal-local")
}
dist {
dimension "main"
// Keep .local because the redirect url we registered on the portal contains .local, not .dist
applicationIdSuffix ".local"
versionNameSuffix "-dist"
resValue("string", "application_name", "msal-dist")
}
BrokerMicrosoftAuthenticator {
dimension "broker"
buildConfigField("String", SELECTED_BROKER, "\"$BROKER_MICROSOFT_AUTHENTICATOR\"")
}
BrokerCompanyPortal {
dimension "broker"
buildConfigField("String", SELECTED_BROKER, "\"$BROKER_COMPANY_PORTAL\"")
}
BrokerLTW {
dimension "broker"
buildConfigField("String", SELECTED_BROKER, "\"$BROKER_LTW\"")
}
BrokerHost {
dimension "broker"
buildConfigField("String", SELECTED_BROKER, "\"$BROKER_HOST\"")
}
AutoBroker {
dimension "broker"
buildConfigField("String", SELECTED_BROKER, "\"$AUTO_BROKER\"")
}
}
variantFilter { variant ->
def flavorName = variant.flavors*.name
def buildType = variant.buildType.name
// To check for a certain build type, use variant.buildType.name == "<buildType>"
if (buildType.contains("release")) {
// Gradle ignores any variants that satisfy the conditions above.
setIgnore(true)
}
if (flavorName.contains("dist") && flavorName.contains("BrokerHost")) {
// Gradle ignores any variants that satisfy the conditions above.
setIgnore(true)
}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', 'src/main/kotlin']
}
androidTest {
manifest.srcFile 'src/androidTest/AndroidManifest.xml'
res.srcDirs = ['src/main/res', 'src/main/kotlin']
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$rootProject.ext.coreLibraryDesugaringVersion"
// Compile Dependency
localImplementation project(':msal')
distImplementation "com.microsoft.identity.client:msal:${msalVersion}"
implementation "androidx.constraintlayout:constraintlayout:$rootProject.ext.constraintLayoutVersion"
implementation "com.google.code.gson:gson:$rootProject.ext.gsonVersion"
implementation "androidx.appcompat:appcompat:$rootProject.ext.appCompatVersion"
implementation 'junit:junit:4.13'
implementation "androidx.legacy:legacy-support-v4:$rootProject.ext.legacySupportV4Version"
implementation "com.google.android.material:material:$rootProject.ext.materialVersion"
androidTestImplementation "androidx.test:core:$rootProject.ext.androidxTestCoreVersion"
androidTestImplementation "androidx.test.ext:junit:$rootProject.ext.androidxJunitVersion"
// Set this dependency to use JUnit 4 rules
androidTestImplementation "androidx.test:rules:$rootProject.rulesVersion"
androidTestImplementation "androidx.test.uiautomator:uiautomator:$rootProject.ext.uiAutomatorVersion"
compileOnly "org.projectlombok:lombok:$rootProject.ext.lombokVersion"
annotationProcessor "org.projectlombok:lombok:$rootProject.ext.lombokVersion"
implementation(project(":LabApiUtilities"))
implementation(project(":uiautomationutilities")) {
exclude module: 'common'
exclude module: 'common4j'
exclude module: 'appcompat'
}
androidTestImplementation "androidx.test:runner:$rootProject.ext.androidxTestRunnerVersion"
androidTestUtil "androidx.test:orchestrator:$rootProject.ext.androidxTestOrchestratorVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
}