1
+ /*
2
+ * Copyright 2024 The Android Open Source Project
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
+ * https://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
+ import java.io.FileInputStream
17
+ import java.util.Properties
18
+
19
+ plugins {
20
+ alias(libs.plugins.android.application)
21
+ alias(libs.plugins.kotlin.android)
22
+ }
23
+
24
+ // Load keystore properties for our signing key
25
+ // (see developer.android.com/studio/publish/app-signing)
26
+ val keystorePropertiesFile: File = rootProject.file(" keystore.properties" )
27
+ val keystoreProperties = Properties ()
28
+ keystoreProperties.load(FileInputStream (keystorePropertiesFile))
29
+
30
+ android {
31
+ namespace = " com.google.webkit.webviewsample"
32
+ compileSdk = 35
33
+
34
+ defaultConfig {
35
+ applicationId = " com.google.webkit.webviewsample"
36
+ minSdk = 29
37
+ targetSdk = 35
38
+ versionCode = 1
39
+ versionName = " 1.0"
40
+
41
+ testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
42
+ vectorDrawables {
43
+ useSupportLibrary = true
44
+ }
45
+ buildConfigField(" String" , " API_BASE_URL" , " \" https://alder-sunny-bicycle.glitch.me/auth\" " )
46
+ resValue(" string" , " host" , " https://alder-sunny-bicycle.glitch.me" )
47
+ }
48
+
49
+ signingConfigs {
50
+ create(" config" ) {
51
+ keyAlias = keystoreProperties[" keyAlias" ].toString()
52
+ keyPassword = keystoreProperties[" keyPassword" ].toString()
53
+ storeFile = file(keystoreProperties[" storeFile" ].toString())
54
+ storePassword = keystoreProperties[" storePassword" ].toString()
55
+ }
56
+ }
57
+
58
+ buildTypes {
59
+ release {
60
+ isMinifyEnabled = false
61
+ proguardFiles(
62
+ getDefaultProguardFile(" proguard-android-optimize.txt" ),
63
+ " proguard-rules.pro"
64
+ )
65
+ signingConfig = signingConfigs.getByName(" config" )
66
+ }
67
+
68
+ debug {
69
+ signingConfig = signingConfigs.getByName(" config" )
70
+ }
71
+ }
72
+ compileOptions {
73
+ sourceCompatibility = JavaVersion .VERSION_1_8
74
+ targetCompatibility = JavaVersion .VERSION_1_8
75
+ }
76
+ kotlinOptions {
77
+ jvmTarget = " 1.8"
78
+ }
79
+ buildFeatures {
80
+ compose = true
81
+ buildConfig = true
82
+ }
83
+ composeOptions {
84
+ kotlinCompilerExtensionVersion = " 1.5.1"
85
+ }
86
+ packaging {
87
+ resources {
88
+ excludes + = " /META-INF/{AL2.0,LGPL2.1}"
89
+ }
90
+ }
91
+ }
92
+
93
+ dependencies {
94
+ implementation(libs.core.ktx)
95
+ implementation(libs.lifecycle.runtime.ktx)
96
+ implementation(libs.activity.compose)
97
+ implementation(platform(libs.compose.bom))
98
+ implementation(libs.compose.ui)
99
+ implementation(libs.compose.graphics)
100
+ implementation(libs.compose.tooling.preview)
101
+ implementation(libs.compose.material)
102
+ implementation(libs.webkit)
103
+ testImplementation(libs.junit)
104
+ androidTestImplementation(libs.junit)
105
+ androidTestImplementation(libs.espresso.core)
106
+ androidTestImplementation(platform(libs.compose.bom))
107
+ debugImplementation(libs.compose.ui.tooling)
108
+ debugImplementation(libs.compose.ui.test.manifest)
109
+ }
0 commit comments