Skip to content

Commit 588339c

Browse files
committed
build(android): add stub file for build constants
1 parent 08a74bd commit 588339c

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

platform/jvm/capture/BUILD.bazel

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ kt_jvm_library(
1616

1717
bitdrift_kt_android_library(
1818
name = "capture_logger_lib",
19-
srcs = glob([
20-
"src/main/**/*.kt",
21-
]),
19+
srcs = glob(
20+
include = ["src/main/**/*.kt"],
21+
# Exclude BuildConstants stub file
22+
exclude = ["src/main/**/BuildConstants.kt"],
23+
),
2224
custom_package = "io.bitdrift.capture",
2325
visibility = ["//visibility:public"],
2426
# Exported dependencies will appear as dependencies in the generated .pom xml.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// capture-sdk - bitdrift's client SDK
2+
// Copyright Bitdrift, Inc. All rights reserved.
3+
//
4+
// Use of this source code is governed by a source available license that can be found in the
5+
// LICENSE file or at:
6+
// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt
7+
8+
package io.bitdrift.capture
9+
10+
// THIS IS A STUB FILE. It makes the gradle build work, while the actual file
11+
// is generated by bazel based on the contents of platform/shared/.sdk_version
12+
object BuildConstants {
13+
const val SDK_VERSION = "x.x.x"
14+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// capture-sdk - bitdrift's client SDK
2+
// Copyright Bitdrift, Inc. All rights reserved.
3+
//
4+
// Use of this source code is governed by a source available license that can be found in the
5+
// LICENSE file or at:
6+
// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt
7+
8+
package io.bitdrift.capture
9+
10+
import org.assertj.core.api.Assertions.assertThat
11+
import org.junit.Test
12+
13+
class BuildConstantsTest {
14+
15+
@Test
16+
fun testStubConstantNotUsed() {
17+
assertThat(BuildConstants.SDK_VERSION).isNotEqualTo("x.x.x")
18+
}
19+
}

0 commit comments

Comments
 (0)