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
17/**
18 * This file was created using the `create_project.py` script located in the
19 * `<AndroidX root>/development/project-creator` directory.
20 *
21 * Please use that script when creating a new project, rather than copying an existing project and
22 * modifying its settings.
23 */
24
25import androidx.build.SoftwareType
26import androidx.build.PlatformIdentifier
27
28plugins {
29    id("AndroidXPlugin")
30}
31
32androidXMultiplatform {
33  jvm()
34  androidLibrary {
35    namespace = "androidx.ink.brush"
36    withAndroidTestOnDeviceBuilder {
37      it.compilationName = "instrumentedTest"
38      it.defaultSourceSetName = "androidInstrumentedTest"
39      it.sourceSetTreeName = "test"
40    }
41  }
42
43  defaultPlatform(PlatformIdentifier.JVM)
44
45  sourceSets {
46    commonMain {}
47
48    commonTest {}
49
50    jvmAndroidMain {
51      dependsOn(commonMain)
52      dependencies {
53        api(libs.androidx.annotation)
54        implementation(libs.kotlinStdlib)
55        implementation("androidx.collection:collection:1.4.3")
56        implementation(project(":ink:ink-geometry"))
57        implementation(project(":ink:ink-nativeloader"))
58      }
59    }
60
61    jvmAndroidTest {
62      dependsOn(commonTest)
63      dependencies {
64        implementation(libs.junit)
65        implementation(libs.kotlinTest)
66        implementation(libs.truth)
67      }
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    jvmMain {
87      dependsOn(jvmAndroidMain)
88    }
89
90    jvmTest {
91      // TODO: b/362697089 - add `dependsOn(jvmAndroidTest)` to run the tests
92      //   in a JVM environment in addition to on Android emulators, once the
93      //   mysterious SIGSEGV is resolved.
94    }
95  }
96}
97
98androidx {
99    name = "Ink Brush"
100    type = SoftwareType.PUBLISHED_LIBRARY
101    inceptionYear = "2024"
102    description = "Define brushes for freehand input."
103}
104