Skip to content

Commit

Permalink
feat: sdk 712 work manager support (#414)
Browse files Browse the repository at this point in the history
chore: move work manager related code to new module.
feat: support multiple instances for work manager
feat: added work manager to sample
feat: add work manager functionality to sample app

chore: explicit mentioned that inner classes won't work for analytics factory
chore: rename sink to sync
  • Loading branch information
itsdebs authored May 9, 2024
1 parent b6802bb commit 5e67042
Show file tree
Hide file tree
Showing 37 changed files with 742 additions and 245 deletions.
4 changes: 1 addition & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ dependencies {
// implementation 'androidx.appcompat:appcompat:1.3.1'
// implementation 'com.google.android.material:material:1.4.0'
//dependency on work manager
//user needs to provide dependency, in case work manager is used
compileOnly deps.work

//core kotlin project
api project(path: projects.core)
api project(path: projects.models)
Expand All @@ -75,6 +72,7 @@ dependencies {
compileOnly project(path: projects.json_rudder_adapter)

//work manager
//user needs to provide dependency, in case work manager is used
compileOnly deps.work
compileOnly deps.workMultiprocess

Expand Down

This file was deleted.

This file was deleted.

4 changes: 1 addition & 3 deletions core/src/test/java/com/rudderstack/core/AnalyticsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ abstract class AnalyticsTest {

@Before
fun setup() {
println("Setup called")
mockedControlPlane = mock(ConfigDownloadService::class.java).also {
`when`(it.download(any())).then {

Expand All @@ -94,7 +93,6 @@ abstract class AnalyticsTest {
mockedDataUploadService.let {

whenever(it.upload(any(), any(), any())).then {
// storage.deleteMessages(data)
it.getArgument<(response: HttpResponse<out Any>) -> Unit>(2).invoke(
mockedResponse
)
Expand Down Expand Up @@ -213,7 +211,7 @@ abstract class AnalyticsTest {
hasProperty("userId", `is`("user_id")),
hasProperty(
"context", allOf(
aMapWithSize<String, Any>(3), hasEntry(
hasEntry(
equalTo("traits"), allOf(
notNullValue(),
aMapWithSize(3),
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ext {
versions = [
work : "2.7.0",
work : "2.9.0",
gson : "2.8.8",
jackson : "2.12.4",
jacksonKotlin : "2.13.3",
Expand Down
3 changes: 3 additions & 0 deletions libs/navigationplugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ dependencies {
tasks.withType(type = org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs::class) {
kotlinOptions.jvmTarget = "17"
}
apply(from = "${project.projectDir.parentFile.parent}/gradle/artifacts-aar.gradle")
apply(from = "${project.projectDir.parentFile.parent}/gradle/mvn-publish.gradle")
apply(from = "${project.projectDir.parentFile.parent}/gradle/codecov.gradle")
1 change: 1 addition & 0 deletions libs/navigationplugin/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
platform="java-kotlin"
26 changes: 5 additions & 21 deletions libs/navigationplugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
#
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

POM_ARTIFACT_ID=navigationplugin
GROUP=com.rudderstack.android.navigationplugin
POM_ARTIFACT_ID=navigation
GROUP=com.rudderstack.android
POM_PACKAGING=aar
VERSION_CODE=1
VERSION_NAME=0.1.0
POM_NAME=Rudderstack plugin for listening to navigation events
POM_DESCRIPTION= A plugin for listening to navigation events
VERSION_NAME=1.0.0
POM_NAME=Rudderstack navigation SDK for Android
POM_DESCRIPTION=Rudderstack navigation SDK for Android
13 changes: 13 additions & 0 deletions libs/navigationplugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions libs/navigationplugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "navigation",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
81 changes: 81 additions & 0 deletions libs/navigationplugin/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "navigation",
"$schema": "../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "./libs/navigationplugin/src",
"targets": {
"build": {
"executor": "@jnxplus/nx-gradle:build",
"dependsOn": [
{
"projects": [
"android",
"rudderreporter"
],
"target": "build"
}
],
"outputs": [
"{projectRoot}/libs/navigationplugin/build"
]
},
"lint": {
"dependsOn": [
"build"
],
"executor": "@jnxplus/nx-gradle:lint",
"options": {
"linter": "ktlint"
}
},
"test": {
"dependsOn": [
"build"
],
"executor": "@jnxplus/nx-gradle:test"
},
"ktformat": {
"executor": "@jnxplus/nx-gradle:ktformat"
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"baseBranch": "master",
"preset": "conventional",
"tagPrefix": "${projectName}@"
}
},
"sync-bumped-version-properties": {
"executor": "nx:run-commands",
"options": {
"command": "node gradle-updater.js 'libs/navigationplugin'"
}
},
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "[email protected]",
"notesFile": ".libs/navigationplugin/CHANGELOG_LATEST.md"
}
},
"release-sonatype": {
"dependsOn": [
"build"
],
"executor": "nx:run-commands",
"options": {
"command": "echo 'navigation-release' && ./gradlew :libs:navigationplugin:publishToSonatype -Prelease closeAndReleaseSonatypeStagingRepository"
}
},
"snapshot-release": {
"dependsOn": [
"build"
],
"executor": "nx:run-commands",
"options": {
"command": "echo 'navigation-snapshot' && ./gradlew :libs:navigationplugin:publishToSonatype"
}
}
},
"tags": []
}
1 change: 1 addition & 0 deletions libs/sync/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Loading

0 comments on commit 5e67042

Please sign in to comment.