Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ common --remote_timeout=3600
common --build_metadata=REPO_URL=https://github.com/player-ui/language.git
common --remote_cache_compression --remote_cache_async

# Java config
common --java_language_version=21
common --tool_java_language_version=21
common --tool_java_runtime_version=21

# Python config
common --incompatible_default_to_explicit_init_py

Expand Down
12 changes: 7 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ orbs:
executors:
base:
docker:
- image: docker.io/playerui/bazel-docker-slim:18
- image: docker.io/playerui/bazel-docker:18
working_directory: ~/lang
resource_class: large
environment:
Expand Down Expand Up @@ -85,8 +85,11 @@ jobs:
steps:
- attach_workspace:
at: ~/lang
# Python files don't have a build step so we only need to actually build the JS files
- run: bazel build -- $(bazel query "kind(npm_package, //...)" --output label 2>/dev/null | tr '\n' ' ')
# Build npm packages and Kotlin targets (JVM + Android AAR)
- run: |
bazel build -- \
$(bazel query "kind(npm_package, //...)" --output label 2>/dev/null | tr '\n' ' ') \
//dsl/kotlin:kotlin-dsl //dsl/kotlin:kotlin-dsl-android //generators/kotlin:kotlin-dsl-generator

- persist_to_workspace:
root: .
Expand All @@ -99,9 +102,8 @@ jobs:
steps:
- attach_workspace:
at: ~/lang

- run: |
bazel coverage --config=ci -- $(bazel query "kind(js_test, //...) + kind(py_test, //...)" --output label 2>/dev/null | tr '\n' ' ')
bazel coverage --config=ci -- $(bazel query 'kind(".*_test", //...)' --output label 2>/dev/null | tr '\n' ' ')

- run:
when: always
Expand Down
8 changes: 8 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//:tsconfig-to-swcconfig/package_json.bzl", tsconfig_to_swcconfig = "bin")
load("@rules_kotlin//kotlin:core.bzl", "kt_kotlinc_options")

package(default_visibility = ["//visibility:public"])

Expand All @@ -21,6 +22,7 @@ exports_files([
"README.md",
"requirements.txt",
".pylintrc",
"detekt.yml",
])

js_library(
Expand Down Expand Up @@ -97,3 +99,9 @@ tsconfig_to_swcconfig.t2s(
stdout = ".swcrc",
visibility = ["//:__subpackages__"],
)

kt_kotlinc_options(
name = "kt_opts",
jvm_target = "21",
visibility = ["//visibility:public"],
)
51 changes: 51 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,59 @@ pip.parse(

use_repo(pip, "pypi")

####### Kotlin #########
bazel_dep(name = "rules_kotlin", version = "2.2.1")
bazel_dep(name = "rules_android", version = "0.6.5")
bazel_dep(name = "protobuf", version = "29.3")

single_version_override(
module_name = "protobuf",
version = "29.3",
)

remote_android_extensions = use_extension("@bazel_tools//tools/android:android_extensions.bzl", "remote_android_tools_extensions")
use_repo(remote_android_extensions, "android_gmaven_r8")

bazel_dep(name = "rules_detekt", version = "0.8.1.13")
bazel_dep(name = "rules_jvm_external", version = "6.9")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
known_contributing_modules = ["bazel_worker_java", "player-lang"],
artifacts = [
"org.jetbrains.kotlin:kotlin-stdlib:2.3.0",
"org.jetbrains.kotlin:kotlin-test:2.3.0",
"org.jetbrains.kotlin:kotlin-test-junit5:2.3.0",
"org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0",
"io.kotest:kotest-runner-junit5:6.0.7",
"io.kotest:kotest-assertions-core:6.0.7",
"io.kotest:kotest-assertions-json:6.0.7",
"org.junit.jupiter:junit-jupiter-api:5.7.2",
"org.junit.jupiter:junit-jupiter-engine:5.7.2",
"org.junit.jupiter:junit-jupiter-params:5.7.2",
"org.junit.platform:junit-platform-commons:1.7.2",
"org.junit.platform:junit-platform-console:1.7.2",
"org.junit.platform:junit-platform-engine:1.7.2",
"org.junit.platform:junit-platform-launcher:1.7.2",
"org.junit.platform:junit-platform-suite-api:1.7.2",
"org.apiguardian:apiguardian-api:1.0.0",
"org.opentest4j:opentest4j:1.1.1",
"com.intuit.playerui.xlr:xlr-types:0.2.0--canary.4.100-SNAPSHOT",
"com.squareup:kotlinpoet-jvm:2.1.0",
],
repositories = [
"https://repo1.maven.org/maven2",
"https://central.sonatype.com/repository/maven-snapshots",
],
)
use_repo(maven, "maven")
########################

build_constants = use_repo_rule("@rules_player//distribution:defs.bzl", "build_constants")
build_constants(
name = "build_constants",
constants = {
"GROUP": "com.intuit.playerui.lang",
},
version_file = "//:VERSION",
)
Loading