|
1 |
| -/* |
2 |
| - * Copyright 2024 Google LLC |
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 |
| -@file:Suppress("UnstableApiUsage") |
18 |
| - |
19 |
| -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
20 |
| - |
21 |
| -plugins { |
22 |
| - id("firebase-library") |
23 |
| - id("kotlin-android") |
24 |
| - alias(libs.plugins.kotlinx.serialization) |
25 |
| -} |
26 |
| - |
27 |
| -firebaseLibrary { |
28 |
| - testLab.enabled = false |
29 |
| - publishJavadoc = true |
30 |
| - releaseNotes { |
31 |
| - name.set("{{vertex_ai_in_firebase}}") |
32 |
| - versionName.set("vertex-ai") |
33 |
| - } |
34 |
| -} |
35 |
| - |
36 |
| -android { |
37 |
| - val targetSdkVersion: Int by rootProject |
38 |
| - |
39 |
| - namespace = "com.google.firebase.vertexai" |
40 |
| - compileSdk = 34 |
41 |
| - defaultConfig { |
42 |
| - minSdk = rootProject.extra["minSdkVersion"] as Int |
43 |
| - consumerProguardFiles("consumer-rules.pro") |
44 |
| - multiDexEnabled = true |
45 |
| - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
46 |
| - } |
47 |
| - buildTypes { |
48 |
| - release { |
49 |
| - isMinifyEnabled = false |
50 |
| - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") |
51 |
| - } |
52 |
| - } |
53 |
| - compileOptions { |
54 |
| - sourceCompatibility = JavaVersion.VERSION_1_8 |
55 |
| - targetCompatibility = JavaVersion.VERSION_1_8 |
56 |
| - } |
57 |
| - kotlinOptions { jvmTarget = "1.8" } |
58 |
| - testOptions { |
59 |
| - targetSdk = targetSdkVersion |
60 |
| - unitTests { |
61 |
| - isIncludeAndroidResources = true |
62 |
| - isReturnDefaultValues = true |
63 |
| - } |
64 |
| - } |
65 |
| - lint { |
66 |
| - targetSdk = targetSdkVersion |
67 |
| - baseline = file("lint-baseline.xml") |
68 |
| - } |
69 |
| - sourceSets { getByName("test").java.srcDirs("src/testUtil") } |
70 |
| -} |
71 |
| - |
72 |
| -// Enable Kotlin "Explicit API Mode". This causes the Kotlin compiler to fail if any |
73 |
| -// classes, methods, or properties have implicit `public` visibility. This check helps |
74 |
| -// avoid accidentally leaking elements into the public API, requiring that any public |
75 |
| -// element be explicitly declared as `public`. |
76 |
| -// https://github.com/Kotlin/KEEP/blob/master/proposals/explicit-api-mode.md |
77 |
| -// https://chao2zhang.medium.com/explicit-api-mode-for-kotlin-on-android-b8264fdd76d1 |
78 |
| -tasks.withType<KotlinCompile>().all { |
79 |
| - if (!name.contains("test", ignoreCase = true)) { |
80 |
| - if (!kotlinOptions.freeCompilerArgs.contains("-Xexplicit-api=strict")) { |
81 |
| - kotlinOptions.freeCompilerArgs += "-Xexplicit-api=strict" |
82 |
| - } |
83 |
| - } |
84 |
| -} |
85 |
| - |
86 |
| -dependencies { |
87 |
| - implementation(libs.ktor.client.okhttp) |
88 |
| - implementation(libs.ktor.client.core) |
89 |
| - implementation(libs.ktor.client.websockets) |
90 |
| - implementation(libs.ktor.client.content.negotiation) |
91 |
| - implementation(libs.ktor.serialization.kotlinx.json) |
92 |
| - implementation(libs.ktor.client.logging) |
93 |
| - |
94 |
| - api("com.google.firebase:firebase-common:22.0.0") |
95 |
| - implementation("com.google.firebase:firebase-components:19.0.0") |
96 |
| - implementation("com.google.firebase:firebase-annotations:17.0.0") |
97 |
| - implementation("com.google.firebase:firebase-appcheck-interop:17.1.0") |
98 |
| - implementation(libs.androidx.annotation) |
99 |
| - implementation(libs.kotlinx.serialization.json) |
100 |
| - implementation(libs.androidx.core.ktx) |
101 |
| - implementation(libs.slf4j.nop) |
102 |
| - implementation(libs.kotlinx.coroutines.android) |
103 |
| - implementation(libs.kotlinx.coroutines.reactive) |
104 |
| - implementation(libs.reactive.streams) |
105 |
| - implementation("com.google.guava:listenablefuture:1.0") |
106 |
| - implementation("androidx.concurrent:concurrent-futures:1.2.0") |
107 |
| - implementation("androidx.concurrent:concurrent-futures-ktx:1.2.0") |
108 |
| - implementation("com.google.firebase:firebase-auth-interop:18.0.0") |
109 |
| - |
110 |
| - testImplementation(libs.kotest.assertions.core) |
111 |
| - testImplementation(libs.kotest.assertions) |
112 |
| - testImplementation(libs.kotest.assertions.json) |
113 |
| - testImplementation(libs.ktor.client.okhttp) |
114 |
| - testImplementation(libs.ktor.client.mock) |
115 |
| - testImplementation(libs.org.json) |
116 |
| - testImplementation(libs.androidx.test.junit) |
117 |
| - testImplementation(libs.androidx.test.runner) |
118 |
| - testImplementation(libs.junit) |
119 |
| - testImplementation(libs.kotlin.coroutines.test) |
120 |
| - testImplementation(libs.robolectric) |
121 |
| - testImplementation(libs.truth) |
122 |
| - testImplementation(libs.mockito.core) |
123 |
| - |
124 |
| - androidTestImplementation(libs.androidx.espresso.core) |
125 |
| - androidTestImplementation(libs.androidx.test.junit) |
126 |
| - androidTestImplementation(libs.androidx.test.runner) |
127 |
| - androidTestImplementation(libs.truth) |
128 |
| -} |
0 commit comments