1/*
2 * Copyright (C) 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 *      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
17import androidx.build.SoftwareType
18import androidx.build.PlatformIdentifier
19
20plugins {
21  id("AndroidXPlugin")
22  id("com.android.library")
23}
24
25androidXMultiplatform {
26  jvm()
27  androidTarget()
28
29  defaultPlatform(PlatformIdentifier.JVM)
30
31  sourceSets {
32    commonMain {
33      dependencies {
34        api(libs.kotlinStdlib)
35
36        implementation("androidx.annotation:annotation:1.8.0")
37      }
38    }
39
40    jvmAndroidMain {
41      dependsOn(commonMain)
42      dependencies {
43        implementation(project(":ink:ink-nativeloader"))
44        implementation(project(":ink:ink-geometry"))
45        implementation(project(":ink:ink-brush"))
46      }
47    }
48
49    jvmAndroidTest {
50      dependsOn(commonTest)
51      dependencies {
52        implementation(libs.junit)
53        implementation(libs.kotlinTest)
54        implementation(libs.truth)
55        implementation(project(":ink:ink-geometry"))
56        implementation(project(":ink:ink-brush"))
57      }
58    }
59
60    jvmMain {
61      dependsOn(jvmAndroidMain)
62    }
63
64    jvmTest {
65      // TODO: b/362697089 - add `dependsOn(jvmAndroidTest)` to run the tests
66      //   in a JVM environment in addition to on Android emulators, once the
67      //   mysterious SIGSEGV is resolved.
68    }
69
70    androidMain {
71      dependsOn(jvmAndroidMain)
72    }
73
74    androidInstrumentedTest {
75      dependsOn(jvmAndroidTest)
76      dependencies {
77        implementation(libs.testExtJunit)
78        implementation(libs.testRules)
79        implementation(libs.testRunner)
80        implementation(libs.espressoCore)
81        implementation(libs.junit)
82        implementation(libs.truth)
83      }
84    }
85  }
86}
87
88android {
89  namespace = "androidx.ink.strokes"
90}
91
92androidx {
93    name = "Ink Strokes"
94    type = SoftwareType.PUBLISHED_LIBRARY
95    inceptionYear = "2024"
96    description = "Create beautiful strokes"
97}
98