Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/player-ui/player into maint…
Browse files Browse the repository at this point in the history
…/use-ts-5.5
  • Loading branch information
KetanReddy committed Jul 23, 2024
2 parents cbf4f82 + 082b556 commit bcf7c15
Show file tree
Hide file tree
Showing 111 changed files with 495 additions and 341 deletions.
16 changes: 5 additions & 11 deletions .autorc
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@
"owner": "player-ui",
"repo": "player",
"plugins": [
[
"upload-assets",
{
"assets": [
"./bazel-bin/PlayerUI_Pod.zip"
]
}
],
[
"version-file",
{
"versionFile": "./VERSION",
"publishScript": "./scripts/release.sh"
"publishScript": "./scripts/release.sh",
"publishScriptReleaseTypeArgs": {
"next": ["release"]
}
}
],
[
Expand All @@ -27,7 +22,6 @@
"labels": "release"
}
],
"./scripts/after-shipit-pod-push.js",
"./scripts/delete-old-prerelease.js"
]
}
}
3 changes: 2 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ plugins/asset-provider/react/node_modules
plugins/asset-transform/core/node_modules
plugins/async-node/core/node_modules
plugins/common-types/core/node_modules
plugins/async-node/components/node_modules
plugins/types-provider/core/node_modules
plugins/auto-scroll/react/node_modules
plugins/beacon/react/node_modules
Expand All @@ -62,7 +63,7 @@ plugins/stage-revert-data/core/node_modules
tools/asset-testing-library/core/node_modules
docs/storybook/node_modules
plugins/reference-assets/mocks/node_modules
tools/addon-storybook/node_modules
tools/storybook/node_modules
tools/components/node_modules
tools/mocks/node_modules
docs/site/node_modules
30 changes: 21 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ orbs:
executors:
base:
docker:
- image: docker.io/playerui/bazel-docker:10
- image: docker.io/playerui/bazel-docker
working_directory: ~/player
resource_class: xlarge
environment:
Expand Down Expand Up @@ -50,8 +50,14 @@ commands:
- gem-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- gem-v1-{{ arch }}-main-{{ checksum "Gemfile.lock" }}

- run: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- add_ssh_keys:
fingerprints:
- "SHA256:hUAWVYdfSW5ml6ufbfyEHUcuPwUJ88xVhsZc21b2lA8"

- run: mkdir -p ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- run: echo "//registry.npmjs.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: git config --global user.name "Intuit Service"
- run: git config --global user.email "opensource-svc@intuit.com"
- run: |
echo -e $GPG_KEY | gpg --import --batch
echo -e "pinentry-mode loopback\npassphrase $DEPLOY_MAVEN_GPG_PASSPHRASE" > ~/.gnupg/gpg.conf
Expand Down Expand Up @@ -95,7 +101,7 @@ jobs:
- attach_workspace:
at: ~/player
# need to filter because //android/demo rules dont resolve
- run: bazel build --config=ci -- $(bazel query '//plugins/... except filter("ios|swiftui|jvm|android", //plugins/...)') $(bazel query '//core/... except filter("ios|swiftui|jvm|android", //core/...)') $(bazel query '//react/... except filter("ios|swiftui|jvm|android", //react/...)')
- run: bazel build --config=ci -- $(bazel query 'filter("native_bundle$", //...)')

- save_cache:
paths:
Expand All @@ -119,8 +125,8 @@ jobs:
name: Homebrew Dependencies
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install bazelisk lcov
brew install --cask temurin@8
sudo installer -pkg /opt/homebrew/Caskroom/temurin@8/8,412,08/OpenJDK8U-jdk_x64_mac_hotspot_8u412b08.pkg -target /
wget -P /tmp/temurin https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u422-b05/OpenJDK8U-jdk_x64_mac_hotspot_8u422b05.pkg
sudo installer -pkg /tmp/temurin/OpenJDK8U-jdk_x64_mac_hotspot_8u422b05.pkg -target /
- restore_cache:
keys:
Expand All @@ -142,6 +148,11 @@ jobs:
environment:
JAVA_HOME: /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home

- save_cache:
key: android-tools-{{ arch }}-{{ checksum "scripts/install-android-tools.sh" }}
paths:
- ~/android-tools

- macos/preboot-simulator:
version: "17.4"
platform: "iOS"
Expand Down Expand Up @@ -382,6 +393,7 @@ workflows:
- /pull\/.*/
requires:
- bazelrc
- build-trunk

- build_ios:
name: build-ios-fork
Expand All @@ -390,7 +402,7 @@ workflows:
only:
- /pull\/.*/
requires:
- setup
- build-fork

- maybe_release:
filters:
Expand Down Expand Up @@ -476,7 +488,7 @@ workflows:

- build_ios:
requires:
- setup
- build

- android_test:
requires:
Expand Down Expand Up @@ -507,7 +519,7 @@ workflows:

- build_ios:
requires:
- setup
- build

- android_test:
requires:
Expand All @@ -523,4 +535,4 @@ workflows:
requires:
- android_test
- coverage
- build_ios
- build_ios
21 changes: 20 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_player//ios:defs.bzl", "assemble_pod")
load("@rules_player//ios:defs.bzl", "assemble_pod", "ios_publish")
load("@rules_player//internal:defs.bzl", "stamp")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@aspect_rules_js//js:defs.bzl", "js_library")
Expand Down Expand Up @@ -190,6 +190,25 @@ assemble_pod(
podspec = ":PlayerUI_Podspec",
)

ios_publish(
name = "ios_publish",
zip = ":PlayerUI_Pod",
# SPM Release Repo
repository = "git@github.com:player-ui/playerui-swift-package.git",
# CocoaPods
podspec = ":PlayerUI_Podspec",
executable = "bundle exec pod",
globalFlags = [
# because jenkins runs as root
"--allow-root",
],
pushFlags = [
# skip tests because it never runs them right
# and they're run as part of the build pipeline anyway
"--skip-tests",
],
)

# # Push podspec to specs repo
# # tag must exist in github first
# pod_push(
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If the changes are larger (API design, architecture, etc), [opening an issue](ht
* [Swift >= 5.5](https://www.swift.org/download/)
* [Xcode 15.3](https://developer.apple.com/download/all/)

* [Android NDK >= 19.2.5345600, <= 21](https://github.com/android/ndk/wiki/Unsupported-Downloads#r19c). Any version > 21 will not work, period. You'll need to add `ANDROID_NDK_HOME` to your environment manually.
* [Android NDK 23.2.8568313](https://github.com/android/ndk/wiki/Unsupported-Downloads#r23c). You'll need to add `ANDROID_NDK_HOME` to your environment manually.
* Python < 3 (recommended 2.7.18) - you can use [pyenv](https://realpython.com/intro-to-pyenv/) to manage different python versions with ease.

* [Signed Commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification). For convenience it is recommended to set git to sign all commits by default as mentioned [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key)
Expand Down
21 changes: 6 additions & 15 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ bazel_dep(name = "rules_player")

archive_override(
module_name = "rules_player",
strip_prefix = "rules_player-1.0.0",
urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v1.0.0.tar.gz"],
integrity = "sha256-08MFpLzTnmwrIZhvE1cBL21cSqmjXzD6SH2HhTf8hR4="
strip_prefix = "rules_player-1.0.1",
urls = ["https://github.com/player-ui/rules_player/archive/refs/tags/v1.0.1.tar.gz"],
integrity = "sha256-zIbxx1Bh/X4E8OwbPJz1nY9mOd2uAgmTZyf1Hs2mq+U="
)
#local_path_override(module_name = "rules_player", path = "../rules_player")

Expand Down Expand Up @@ -113,15 +113,6 @@ use_repo(android_ndk_repository_extension, "androidndk")

register_toolchains("@androidndk//:all")

# Databinding
bazel_dep(name = "grab_bazel_common")
git_override(
module_name = "grab_bazel_common",
# bazel-6 branch
commit = "75e9fd4d280329d3b13fc6f6bde1ab0f05fd2e86",
remote = "https://github.com/sugarmanz/grab-bazel-common.git",
)

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

Expand All @@ -139,6 +130,7 @@ maven.install(
artifacts = [
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0",
"org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0",
"org.jetbrains.kotlin:kotlin-reflect:1.7.10",
"com.intuit.hooks:hooks:0.15.0",

# Testing
Expand All @@ -147,9 +139,8 @@ maven.install(
"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0",

# Android
"androidx.databinding:databinding-adapters:7.2.2",
"androidx.databinding:databinding-common:7.2.2",
"androidx.databinding:databinding-runtime:7.2.2",
"androidx.databinding:viewbinding:7.2.2",
"androidx.annotation:annotation:1.1.0",

# Android Demo
"androidx.navigation:navigation-runtime:2.3.3",
Expand Down
6 changes: 3 additions & 3 deletions PlayerUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and display it as a SwiftUI view comprised of registered assets.
s.homepage = 'https://github.com/player-ui/player'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'hborawski' => 'harris_borawski@intuit.com' }
s.source = { :http => "https://github.com/player-ui/player/releases/download/#{s.version.to_s}/PlayerUI_Pod.zip" }
s.source = { :git => "https://github.com/player-ui/playerui-swift-package.git", :tag => s.version.to_s }

s.ios.deployment_target = '14.0'

Expand Down Expand Up @@ -96,7 +96,7 @@ and display it as a SwiftUI view comprised of registered assets.
subspec.source_files = "plugins/#{path}/ios/Sources/**/*"
if resources == TRUE
subspec.resource_bundles = {
name => ["plugins/#{path}/ios/Resources/**/*.js"]
"PlayerUI_#{name}" => ["plugins/#{path}/ios/Resources/**/*.js"]
}
end
end
Expand All @@ -112,7 +112,7 @@ and display it as a SwiftUI view comprised of registered assets.
subspec.source_files = "plugins/#{path}/swiftui/Sources/**/*"
if resources == TRUE
subspec.resource_bundles = {
name => ["plugins/#{path}/swiftui/Resources/**/*.js"]
"PlayerUI_#{name}" => ["plugins/#{path}/swiftui/Resources/**/*.js"]
}
end
end
Expand Down
11 changes: 0 additions & 11 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,11 @@ android_sdk_repository(
api_level = 33
)

load("@grab_bazel_common//rules:repositories.bzl", "bazel_common_dependencies")

bazel_common_dependencies()

bind(
name = "databinding_annotation_processor",
actual = "//:compiler_annotation_processor",
)

load("@grab_bazel_common//rules:setup.bzl", "bazel_common_setup")

bazel_common_setup(
patched_android_tools = True, # Optionally use patched android_tools jars
buildifier_version = "6.3.3",
)

http_file(
name = "android_test_orchestrator_apk",
sha256 = "b7a2e7d0184b03e12c7357f3914d539da40b52a11e90815edff1022c655f459b",
Expand Down
5 changes: 1 addition & 4 deletions android/demo/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@rules_android//android:rules.bzl", "android_binary", "android_library")
load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_import")
load("@rules_kotlin//kotlin:android.bzl", "kt_android_library")
load(":defs.bzl", "main_deps", "test_deps")
load(":deps.bzl", "main_deps", "test_deps")
load("@rules_player//kotlin:defs.bzl", "lint")

kt_android_library(
Expand All @@ -19,13 +19,10 @@ android_binary(
assets = glob(["src/main/assets/mocks/**"]),
assets_dir = "src/main/assets",
dex_shards = 3,
enable_data_binding = True,
manifest = ":src/main/AndroidManifest.xml",
multidex = "native",
deps = [
":demo_lib",
"@maven//:androidx_databinding_databinding_common",
"@maven//:androidx_databinding_databinding_runtime",
"@maven//:org_jetbrains_kotlin_kotlin_reflect",
],
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.intuit.playerui.core.player.state.dataModel
import org.junit.Assert.assertEquals
import org.junit.Test

class ActionUITest : AssetUITest("reference-assets") {
class ActionUITest : AssetUITest("action") {

@Test
fun basic() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.intuit.playerui.android.reference.demo.test.base.waitForViewInRoot
import com.intuit.playerui.core.player.state.InProgressState
import org.junit.Test

class CollectionUITest : AssetUITest("reference-assets") {
class CollectionUITest : AssetUITest("collection") {

@Test
fun basic() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.intuit.playerui.android.reference.demo.test.base.waitForViewInRoot
import com.intuit.playerui.core.player.state.InProgressState
import org.junit.Test

class InfoUITest : AssetUITest("reference-assets") {
class InfoUITest : AssetUITest("info") {

enum class Action {
Next, Dismiss, CONTINUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.hamcrest.Matchers.allOf
import org.junit.Assert.assertEquals
import org.junit.Test

class InputUITest : AssetUITest("reference-assets") {
class InputUITest : AssetUITest("input") {

fun verifyIsDisplayed(matcher: Matcher<View>) = waitForViewInRoot(matcher)
.check(matches(isDisplayed()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import com.intuit.playerui.android.reference.demo.test.base.waitForViewInRoot
import org.hamcrest.Matchers.allOf
import org.junit.Test

class TextUITest : AssetUITest("reference-assets") {
class TextUITest : AssetUITest("text") {

@Test
fun basic() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ abstract class AssetUITest(val group: String? = null) {

protected val currentState: PlayerFlowState? get() = playerViewModel.playerFlowState.value

protected val mocks get() = viewModel.mocks
protected val mocks get() = viewModel.mocks.filter {
group == null || group == it.group
}

@Before
fun before() {
Expand Down
Loading

0 comments on commit bcf7c15

Please sign in to comment.