Skip to content

Commit c769fa3

Browse files
committed
build(android): add stub file for build constants
1 parent 240c52f commit c769fa3

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
/**
11+
* THIS IS A STUB FILE. It makes the gradle build work, while the actual file
12+
* is generated by bazel based on the contents of platform/shared/.sdk_version
13+
*/
14+
object BuildConstants {
15+
/** Compiled version of the SDK (actual value generated during build) */
16+
const val SDK_VERSION = "x.x.x"
17+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
@Test
15+
fun testStubConstantNotUsed() {
16+
assertThat(BuildConstants.SDK_VERSION).isNotEqualTo("x.x.x")
17+
}
18+
}

0 commit comments

Comments
 (0)