1+ /*
2+ * Copyright 2022 Arseniy Graur
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ val polyhootWebSocketUrl: String by project
18+
19+ plugins {
20+ kotlin(" android" )
21+ kotlin(" plugin.serialization" )
22+ id(" com.android.application" )
23+ id(" io.gitlab.arturbosch.detekt" )
24+ id(" com.google.gms.google-services" )
25+ id(" com.google.firebase.crashlytics" )
26+ id(" com.google.firebase.firebase-perf" )
27+ id(" com.google.firebase.appdistribution" )
28+ }
29+
30+ android {
31+ namespace = " net.ciphen.polyhoot"
32+ compileSdk = 32
33+
34+ defaultConfig {
35+ applicationId = " net.ciphen.polyhoot"
36+ minSdk = 28
37+ targetSdk = 32
38+ versionCode = 3
39+ versionName = " three"
40+
41+ testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
42+ }
43+
44+ if (System .getenv(" RELEASE_STORE_FILE" ) != null ) {
45+ signingConfigs.create(" release" ) {
46+ storeFile = file(System .getenv(" RELEASE_STORE_FILE" ))
47+ storePassword = System .getenv(" RELEASE_STORE_PASSWORD" )
48+ keyAlias = System .getenv(" RELEASE_KEY_ALIAS" )
49+ keyPassword = System .getenv(" RELEASE_KEY_PASSWORD" )
50+ }
51+ buildTypes {
52+ getByName(" release" ) {
53+ signingConfig = signingConfigs.getByName(" release" )
54+ firebaseAppDistribution {
55+ groups = " third-party-testers"
56+ }
57+ }
58+ }
59+ }
60+
61+ buildTypes {
62+ all {
63+ buildConfigField(" String" , " POLYHOOT_WEBSOCKET_URL" , " \" $polyhootWebSocketUrl \" " )
64+ proguardFiles(
65+ getDefaultProguardFile(" proguard-android-optimize.txt" ),
66+ " proguard-rules.pro"
67+ )
68+ }
69+ getByName(" release" ) {
70+ isShrinkResources = true
71+ isMinifyEnabled = true
72+ }
73+ }
74+
75+ compileOptions {
76+ sourceCompatibility(JavaVersion .VERSION_11 )
77+ targetCompatibility(JavaVersion .VERSION_11 )
78+ }
79+
80+ buildFeatures {
81+ viewBinding = true
82+ }
83+ }
84+
85+ tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().configureEach {
86+ kotlinOptions {
87+ jvmTarget = " 11"
88+ }
89+ }
90+
91+ tasks.detekt {
92+ reports {
93+ html.required.set(true )
94+ html.outputLocation.set(file(" build/reports/detekt.html" ))
95+ }
96+ }
97+
98+ dependencies {
99+ implementation(" androidx.core:core-ktx:1.7.0" )
100+ implementation(" androidx.appcompat:appcompat:1.4.1" )
101+ implementation(" com.google.android.material:material:1.7.0-alpha02" )
102+ implementation(" androidx.constraintlayout:constraintlayout:2.1.4" )
103+ implementation(" androidx.navigation:navigation-fragment-ktx:2.4.2" )
104+ implementation(" androidx.navigation:navigation-ui-ktx:2.4.2" )
105+ implementation(" com.google.firebase:firebase-crashlytics-ktx:18.2.11" )
106+ implementation(" com.google.firebase:firebase-analytics-ktx:21.0.0" )
107+ implementation(" com.google.firebase:firebase-perf-ktx:20.1.0" )
108+ implementation(" com.squareup.okhttp3:okhttp:5.0.0-alpha.7" )
109+ implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3" )
110+ testImplementation(" junit:junit:4.13.2" )
111+ androidTestImplementation(" androidx.test.ext:junit:1.1.3" )
112+ androidTestImplementation(" androidx.test.espresso:espresso-core:3.4.0" )
113+ }
0 commit comments