Commit Graph
50 Commits
Author SHA1 Message Date
psteiger f9bf934650 Use version catalog naming style for plugins 2024-10-14 06:17:17 -04:00
James Barr 69903fd0d8 Refactor internal methods to avoid duplicate JVM signature (#621)
* Rename internal method to avoid duplicate JVM signature
* Use core-annotated method approach instead of renaming
2023-10-31 11:42:21 -07:00
Patrick Steiger adc3b0df53 Get rid of suppressions for "invisible_reference" and "invisible_member"
For accessing internal declarations from other modules (e.g. access `rib-base` internals from `rib-test`), we are currently suppressing compiler errors with `@file:Suppress("invisible_reference", "invisible_member")`

A better approach is to:
1. Create an `internal` opt-in annotation.
2. Make the "accessible to friend modules" component `public`
3. Mark the (now public) component with the opt-in annotation.
4. Opt-in to the annotation from `build.gradle`.

Because the new annotation is `internal`, it cannot be normally accessed from external modules. But Gradle can see it if it's part of the source set.

This makes the internal visibility of those friend-modules APIs even stricter, since consumers now cannot just suppress `"invisible_reference"` and `"invisible_member"` to directly access the friend-module API. Plus, we get rid of the hacky suppressions in our codebase.
2023-09-21 21:20:42 -03:00
James Barr 00753bba2e Set view tree owners in parent class (#615) 2023-09-11 18:24:38 -07:00
James Barr 9f6a21520a Set view tree owners (#606)
* Set view tree owners in RibActivity#onCreate
* Cleanup duplicate setting of view tree owners
* Add more assertions
2023-08-07 15:05:24 -07:00
Patrick Steiger 36d2c13647 Migrate from deprecated @JvmDefault to compiler option -Xjvm-default=all
Docs state that:

> If you used the @JvmDefault annotation before, you can safely remove it and use one of the new modes. If you already used -Xjvm-default=enable, which generated only the default method implementations, you can now replace it with -Xjvm-default=all.
2023-07-17 17:30:48 -03:00
Francisco Aguilera 66eac33013 Expose stream for RIB component duration info 2023-06-16 13:02:41 -07:00
Patrick Steiger 27d8eba3fc Make use of convention plugins and version catalogs 2023-05-18 14:54:39 -03:00
Patrick Steiger 5b9b66e54d Make use of jvmToolchain for compiling the project.
This allows for a more repeatable, predictable build between different local configurations.
2023-05-16 18:01:40 -03:00
Patrick Steiger b0e415526b Add KDoc on ActivityLifecycleEvent explaining ordering semantics.
Also, a couple of minor fixes:
- A small warning on `RibActivity` against importing `android.R`.
- Replaces deprecated `String.toLowerCase()` and `String.capitalize()` with the equivalent `String.lowercase()` and `String.replaceFirstChar(Char::titlecase)`.
2023-05-16 18:00:09 -03:00
Patrick Steiger c7802a9a35 Introduce LazyBackingProperty and use it on RibActivity, Presenter, and Interactor`
Avoids creating multiple `Observable` while still being Mockito friendly.
2023-05-04 20:39:14 -03:00
Patrick Steiger 0338455764 Expose lifecycle: SharedFlow for mocking and finalize LifecycleScopeProvider methods that use lifecycle. 2023-05-04 20:39:14 -03:00
Patrick Steiger 2d77205544 Bump Kotlin, Gradle, and other dependencies versions.
Kotlin 1.7.10 -> 1.8.20
Gradle 7.3.3 -> 8.1.1
AndroidX Lifecycle ViewModel Compose 1.0.0-alpha05 -> 2.5.1
AndroidX Activity 1.3.0-alpha08 -> 1.7.0
AndroidX Activity KTX 1.3.0-beta02 -> 1.7.0
AndroidX Activity Compose 1.3.0-beta02 -> 1.7.0
Compose compiler 1.3.0 -> 1.4.6
Compose libraries 1.2.1 -> 1.4.0
Java version 1.8 -> 11
IntelliJ plugin 1.11.0 -> 1.13.1 (1.13.2 onwards fails test `ribGenerators_shouldGenerateClassesThatCompiler` for reasons beyond my understanding)
AGP 7.2.2 -> 7.4.2 (8.0 not supported in IJ 2023.1 bundled Android plugin)
gradle-maven-publish 0.18.0 -> 0.25.2

### Additional changes

- Move package string from manifests to `android.namespace` in Gradle build scripts.
- Remove `targetSdk` from Android libraries (only applications should provide it)
- Remove `buildToolsVersion`.
- `compileSdkVersion`, `minSdkVersion`, `targetSdkVersion` swapped to `compileSdk`, `minSdk`, `targetSdk`.
- Disablement of `buildConfig` is now done by `buildFeatures.buildConfig = false` instead of in the project `build.gradle`.
- Added `exported="true"` in demo Android projects activities.
- `-Xfriend-paths` `kotlinc` option seemingly only works now if we use `@file:Suppress("invisible_reference", "invisible_member")` in files that access internal components.
- `androidx.lifecycle.ViewTreeLifecycleOwner(View, LifecycleOwner)` has been replaced with `View.setViewTreeLifecycleOwner(LifecycleOwner)`.
- Removed unnecessary dependencies on Kotlin stdlib, as the Kotlin JVM plugin automatically adds it. For reasons beyond my understanding, removing it from `android/libraries/rib-test` fails gradle sync with the following error, so it's the only place it's still kept.
```
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not resolve all dependencies for configuration ':libraries:rib-coroutines:testCompileClasspath'.
Cannot change dependencies of dependency configuration ':libraries:rib-test:api' after it has been included in dependency resolution.
```
2023-04-28 20:32:40 -03:00
sergey.smykovskyi e696898c9f Update formatters versions:
`gjf` 1.7 -> 1.16.0
`ktfmt` 0.23 -> 0.43
`ktlint` 0.41.0 -> 0.48.2
`spotless` 5.11.0 -> 6.18.0

Manual changes :
 Renamed `logged_in` package -> `loggedIn`
 Renamed `logged_out` package -> `loggedOut`
 Renamed `off_game` package -> `offGame`
 Renamed `tic_tac_toe` package -> `ticTacToe`
2023-04-26 11:10:08 -07:00
davissuber a32142834d Enable explicit api mode for Kotlin libraries (#561)
This commit follows the example of #548 and satisfies #545 by enabling the explicit api mode for the following library modules:

- rib-debug-utils
- rib-router-navigator
- rib-test
- rib-compiler-app
- rib-android-compose
- rib-android-code
- rib-android
- rib-screen-stack-base
- rib-workflow-test
- rib-workflow
2023-04-25 17:42:43 -03:00
tys 93dd6e8d8b cleaning up some explicit signatures and fixing nullability lifecycle peeking 2023-03-27 11:06:30 -07:00
tys 73ae40ab32 Addressing Feedback to clean up allocations 2023-03-24 19:14:53 -07:00
tys 036fa95765 removing junk testing 2023-03-24 17:13:22 -07:00
tys f27391b39d Fix spotless checks 2023-03-24 17:06:13 -07:00
tys 1015f2f460 Moved all behavior relays and publish relays to Flow in non test code. Preserving all public APIs for now 2023-03-24 17:03:28 -07:00
Kiran Kumar b926b0ba9e Spotless check fix 2022-09-26 17:15:32 +05:30
Kiran Kumar e59184cad9 - Adding support for relaying window focus events from RibActivity (test included) 2022-09-26 16:50:43 +05:30
SergeySmykovskyi 1023a96b84 Migrate com.nhaarman.mockitokotlin2 to org.mockito.kotlin (#520)
* Migrate com.nhaarman.mockitokotlin2 to org.mockito.kotlin
2022-08-08 18:21:41 -07:00
arteghem 4bc63ded6b Don't use default interface method bytecode optimization for target 1.8 (#495)
* Don't use default interface method bytecode optimization for target 1.8

* Update fix to rely on jvm-default=enable/@JvmDefault in order to preserve java compatibility:
2022-03-29 19:19:35 -07:00
James Barr beb5ccd149 Migrate gradle-maven-push to gradle-maven-publish-plugin (#477) 2021-09-17 11:06:06 -07:00
James Barr 865adaf6f3 More followup fixes for Kotlin RIBs (#450) 2021-05-17 11:30:33 -07:00
James Barr bd8f05fc0f Followup fixes for Kotlin RIBs (#448) 2021-05-11 22:30:26 -07:00
James Barr 3f6b1309ea Minor fixups for rib-base Kotlin conversion 2021-04-16 16:27:19 -07:00
James Barr 026eae1e12 Convert rib-base to Kotlin 2021-04-16 12:39:06 -07:00
James Barr 32b1e225f7 Convert rib-android to Kotlin 2021-04-14 16:50:00 -07:00
James Barr 1921f16b94 Rename rib-android files to .kt in kotlin srcs 2021-04-14 09:22:28 -07:00
James Barr fa177c91c2 Cleanup kotlin srcs in build.gradle files 2021-04-02 15:34:02 -07:00
James Barr cb51d73da2 Integrate Spotless into build (#415)
* Integrate Spotless in build

* Update CONTRIBUTING.md

* Move improperly placed copyright comments

* Update copyright indent

* Don't format test fixtures

* Run spotlessApply over the whole repo

* Remove checkstyle configs

* Run spotlessCheck on CI
2021-03-24 18:45:35 -07:00
James Barr 95c97a0f1e Add CoreAppCompatActivity with delegate API (#407) 2021-03-04 11:25:55 -08:00
James Barr b86d7ffee3 Align rib-android with internal version (#405)
* Bump buildTools and compileSdk to 30

* Remove component type parameter from ViewRouter

* Xray updates

* Add support for onUserLeaveHint, onTrimMemory, and onPIPModeChanged callbacks

* Update build tools for Travis CI
2021-02-27 10:01:12 -08:00
James Barr 2d58c916f2 Delete rib-android-test (#404)
* Move tests in rib-android-test to test source set of rib-android

* Set test theme in test activity instead of Android manifest

* Delete rib-android-test
2021-02-25 13:45:51 -08:00
James Barr b290824844 Align rib-base with internal version (#402)
* Remove Component type parameter from Router

* Add RibEvents and related classes for tooling

* Minor differences to align with internal version of rib-base

* Extended WorkerBinder functionality to allow for binding a worker to a presenter's lifecycle

* Minor differences & new tests to align with internal version of rib-base
2021-02-23 12:47:26 -08:00
James Barr c6bbec8096 Decouple base RIB classes from Dagger (#399) 2021-02-18 21:56:18 -08:00
James Barr 676f742436 Migrate from uava to guava (#393)
* Delete rib-uava
* Use Guava classes instead of Uava
* Add Guava dependencies and be explicit about Android or JRE
2021-02-12 13:46:29 -08:00
fegol b586fbf024 Migration to AndroidX #324 (#334)
* Migration to AndroidX #324

* Divided versions for androidx libraries and renamed dependencies #324

* Upgrade target sdk version for travis #324

* Migration to androidx part 2 #324

* Fixed spaces #324
2019-06-19 22:48:18 +02:00
Shaishav Gandhi 9ac24da401 Update AutoDispose to 1.3.0 (#333)
* Update AutoDispose

* Enable desugaring in tutorials

* Move to static imports
2019-06-12 13:28:12 -07:00
SeungHun Choe 94d8293316 Fix gradle sync and compilation error on Android Studio 3.4 2019-05-24 10:08:25 +09:00
Brian Attwell 52504f90e1 Split rib-android tests into seperate module
Doing this allows us to run roboeletric tests without having to define a theme attribute (that needs to be overridden by consumers) inside the rib-android module.
2017-11-04 12:34:41 -07:00
Brian Attwell c27c6bcae6 add gradle-mvn-push to desired modules 2017-11-04 09:00:32 -07:00
Brian Attwell cb0c937ce8 Setup gradle.properties files for maven central 2017-11-01 17:44:20 -07:00
Brian Attwell e76fe04ebb router-navigator, intellij-plugin
* Add comment explaining why lifecycled presenters exist
* Fix package name for rib debug utils
* Rename rib-assert -> rib-test-utils
* Delete orphaned files
* Refactor router-navigator into its own module. Fix some gradle dependencies
* Update the rib intellij template readme
* Include prebuilt plugin.jar
* Include link to plugin.jar in readme
* Add link to plugin inside tutorial1 readme
* Add license
2017-10-17 10:53:17 -07:00
Brian Attwell 0eee18001e Remove needless buck file 2017-10-17 10:53:16 -07:00
Brian Attwell 7c7a91608b Set Java version to 1.7 in all modules
This allows us to build, install and run the tutorial1 app.
2017-10-17 10:53:16 -07:00
Brian Attwell f72b8dd23a Min sdk version for rib-android 2017-10-17 10:53:15 -07:00
Brian Attwell c848849d08 initial code for rib-android. Minus some propriatary metadata.
Plus Clean up android-base for release (squashed toghehter for file header reasons)
* Add initializer support by inlining the initializer annotation into rib-base
* Setup roboelectric tests. Setup roboelectric configuration
2017-10-17 10:53:00 -07:00