Commit Graph

81 Commits

Author SHA1 Message Date
Christophe Beyls dc4ca06551
Replace Dagger-Android with Hilt and remove Kapt (#4423)
Hilt is an annotation processor built on top of Dagger which allows to
remove all the Android dependency injection boilerplate code (currently
around 900 lines) by writing it for us.

Hilt can use KSP instead of Kapt so Kapt can be completely removed from
the project. Kapt is slow, deprecated and has a few compatibility
issues. Removing Kapt will improve build times since no Java stubs have
to be generated for Kotlin classes anymore (Note that KSP also processes
annotations in Java classes so it can completely replace Kapt).

- Remove all modules related to manual dependency injection
configuration.
- Rename `AppModule` to `StorageModule` since it now only contains
configuration to retrieve the DataBase and SharedPreferences.
- Annotate all entry points (Activities, Fragments, BroadcastReceivers
and Services) with `@AndroidEntryPoint`.
- Annotate all injected ViewModels with `@HiltViewModel` and replace the
custom ViewModel Factory with the default one (which integrates with the
one generated by Hilt).
- Add a public field to allow overriding the default
ViewModelProvider.Factory in `BaseActivity` in tests.
- Annotate tested Activities with `@OptionalInject` since Activity tests
currently rely on the Activities not being injected automatically.
- Annotate injected `Context` arguments with `@ApplicationContext`. Hilt
provides the `Context` binding automatically but requires to specify if
the Application or Activity Context is wanted.
- Add WorkManager Hilt integration so all Workers are injected by Hilt
automatically using `HiltWorkerFactory`.
- Lazily initialize WorkManager in `TuskyApplication`.
- Remove Kapt and Kapt workarounds.
- ~~Remove toolchain configuration for Java 21. Toolchains force the
Java bytecode to match the JDK version used to build the project, and
apparently Hilt doesn't run inside the toolchain so cannot process the
source code if the JDK version of the toolchain is higher than the JDK
used to run Gradle. [And configuring a toolchain for an older Java
version causes other
issues](https://jakewharton.com/gradle-toolchains-are-rarely-a-good-idea/).
**Removing toolchains configuration doesn't prevent the project from
being built using JDK 21** or more recent versions but allows to build
the project using older JDKs as well.~~
Added a fix to allow Hilt to properly use the JDK toolchain.
- ~~Set the Java and Kotlin bytecode target to Java 17. The standard
bytecode target for Android projects is usually Java 8 or 11 (any higher
version doesn't provide any benefit but may cause compatibility issues).
However, since the app currently uses a library built against Java 17
bytecode (`networkresult-calladapter`), it needs to target at least Java
17 bytecode as well.~~
- Update the Dagger 2 URL in the licenses screen. Hilt is part of Dagger
2 so the label wasn't changed.
2024-05-10 15:55:07 +02:00
Zongle Wang e3c68e0992
Use Java 21 (#4235) 2024-02-23 12:28:13 +01:00
Konrad Pozniak 17e99bbc2e
Revert "Migrate to Hilt KSP compiler (#4136)" (#4246)
This reverts commit 6494247301.

Seems like dagger/ksp is still a bit buggy, I'm getting one of these
errors every other build, so lets revert this for now.

https://github.com/google/dagger/issues/4181
https://github.com/google/ksp/issues/1196
2024-02-10 10:42:31 +01:00
Zongle Wang 6494247301
Migrate to Hilt KSP compiler (#4136)
https://github.com/google/dagger/releases/tag/dagger-2.49

Closes #4012.
2024-01-03 21:16:05 +01:00
Goooler d694f8f495 Migrate deprecated buildDir 2023-08-25 10:20:18 +08:00
Nik Clayton 839d8bcc04
Migrate to AGP 8.0.2 / Android Studio Flamingo / Java 17 (#3541)
- Update AGP in version catalog to 8.0.2
- Set Java version to 17
- Enable non-final resource IDs
2023-07-30 15:50:04 +02:00
Nik Clayton 25376170c2
Migrate "room" from "kapt" to "ksp" (#3777)
- Add ksp plugin
- Switch room to use ksp instead of kapt
- `ArrayList` -> `List` in a few places to fix errors about unbound generics
2023-06-29 18:37:46 +02:00
Goooler c6f7ecdb5b
Gradle 8.0.1 (#3338)
https://docs.gradle.org/8.0/release-notes.html
2023-02-25 20:59:39 +01:00
Goooler 3592318dc1
Modernize a bit (#3171)
* Remove redundant ignore file

* Add .gitattributes

* Generate new wrapper

* Apply plugins in `plugins`

* Adopt new dsl

* Enable stable config cache

* Ignore all build folders

* Enable build scan

* Disable buildFeatures flags by default

* Migrate to nonTransitive R class

* Tweak flags

* Bump AGP to 7.4.0

* Bump deps

* Run `ktlintFormat`

* Add an icon for IDEA to display

* Revert "Bump deps"

This reverts commit bc0d5b69d5.

* Revert "Enable build scan"

This reverts commit 1568e5e84f.

* Remove com.android.library

* Enable Gradle cache

* Enable room incremental build

* Cleanups

* Cleanups

* Add .editorconfig

* Defer clean task

* Migrate `flavorDimensions`

* Merge instance-build.gradle into app's build.gradle

* Declare compileOptions & kotlinOptions

* Bump jvmTarget to 17

* Fix conflicts

* Xmx4g

* Rename output apks

* Revert "Bump jvmTarget to 17"

This reverts commit e4d1543bda.
2023-02-04 19:58:53 +01:00
Colin Lee 3fb1173d3f
Introduce Gradle version catalogs for versioning (#2745)
* Introduce Gradle version catalogs for versioning

* Correct some versions for version catalogs
2022-11-04 20:10:26 +01:00
Konrad Pozniak 4f0f9a7a12
update Kotlin to 1.7.10 and fix some (new?) warnings (#2647)
* update Kotlin to 1.7.10 and fix some (new?) warnings

* remove unused import
2022-08-07 19:36:09 +02:00
Konrad Pozniak 12e42e9b2b
update ktlint gradle plugin to 10.3.0 (#2649) 2022-08-07 19:15:21 +02:00
Konrad Pozniak d5b3b2088f
update Android Gradle Plugin to 7.2.2 (#2639) 2022-08-07 19:13:34 +02:00
Konrad Pozniak 51f3794e78
update Kotlin to 1.6.21 (#2526) 2022-05-17 20:15:37 +02:00
Konrad Pozniak 53cca00e8c
update Android Gradle plugin to 7.2.0 (#2525) 2022-05-17 19:56:21 +02:00
Konrad Pozniak 216f094e98
upgrade ktlint gradle plugin to 10.2.1 (#2435) 2022-04-16 09:45:45 +02:00
Konrad Pozniak f2fc87a79e
upgrade Kotlin and Coroutines (#2434) 2022-04-16 09:44:37 +02:00
Konrad Pozniak 90ceb9514e
update Gradle and Android Gradle Plugin (#2380) 2022-03-13 16:08:15 +01:00
Konrad Pozniak 1586817c3d
Update gradle, kotlin and other dependencies (#2291)
* update gradle, kotlin and other dependencies

* fix new warnings

* remove unused import

* update Proguard rules

* add explicit dependency on Gson to get the newest version

* remove debug flag from proguard rules again

* fix typo
2022-01-20 21:10:32 +01:00
Konrad Pozniak 16ffcca748
add ktlint plugin to project and apply default code style (#2209)
* add ktlint plugin to project and apply default code style

* some manual adjustments, fix wildcard imports

* update CONTRIBUTING.md

* fix formatting
2021-06-28 21:13:24 +02:00
Konrad Pozniak e84dec29b2
update dependencies (#2198) 2021-06-14 11:00:25 +02:00
Konrad Pozniak 387e62ea4b
get rid of jcenter (#2163)
* get rid of jcenter

* fix BottomSheetActivityTest

* update Android Image Cropper license
2021-05-21 17:51:47 +02:00
Konrad Pozniak 751109ac39
upgrade kotlin to 1.5.0 (#2162)
* upgrade kotlin to 1.5.0

* don't explicitly set kotlin jvmtarget
2021-05-21 17:51:35 +02:00
Konrad Pozniak 3af8874b87
upgrade android gradle plugin to 4.2.1 (#2160)
* upgrade android gradle plugin to 4.2.1

* upgrade android gradle plugin to 4.2.1
2021-05-19 07:40:45 +02:00
Konrad Pozniak f293670c14
migrating to ViewBinding part 6: the final cleanup (#2117) 2021-03-21 12:42:28 +01:00
Konrad Pozniak 0708b6a7bb
update dependencies (#2017) 2020-12-13 16:31:32 +01:00
Konrad Pozniak 34fb546200
upgrade dependencies (#1990)
* upgrade dependencies

* fix tests
2020-11-22 19:02:54 +01:00
Konrad Pozniak 6d27d822ca
update Kotlin to 1.4.10 and fix some warnigs (#1963) 2020-10-25 18:36:00 +01:00
Konrad Pozniak e572e653ee
upgrade gradle and android gradle plugin (#1957) 2020-10-19 14:47:40 +02:00
Konrad Pozniak 84de062c03
update dependencies (#1886)
* update dependencies

* update AGP
2020-08-17 21:30:56 +02:00
Konrad Pozniak df5490b5b9
upgrade gradle, AGP and dependencies (#1818)
* upgrade gradle, AGP and dependencies

* fix new layout related warnings
2020-06-04 20:16:48 +02:00
Konrad Pozniak 9bb86dfe8f upgrade deps 2020-04-28 17:02:40 +02:00
Konrad Pozniak c80fa68dbe
upgrade dependencies, fix some warnings (#1747)
* upgrade dependencies, fix some warnings

* fix tests
2020-04-06 11:46:38 +02:00
Konrad Pozniak 43162789c1
upgrade Kotlin to 1.3.70 (#1730) 2020-03-18 17:12:56 +01:00
Konrad Pozniak 0c159e587d
upgrade Gradle and Android plugin (#1709)
* upgrade Gradle and Android plugin

* upgrade Android Gradle plugin to 3.6.1
2020-03-02 19:58:15 +01:00
Frieder Bluemle 2f07d90fd0
Remove jetifier buildscript plugin 2020-01-31 19:05:08 -08:00
Konrad Pozniak e67d608bb8
upgrade dependencies (#1596) 2019-12-20 21:31:41 +01:00
Konrad Pozniak d3ebcc14ec
update deps, cleanup build file (#1546) 2019-11-06 20:48:58 +01:00
Konrad Pozniak 2dad358c96
upgrade appcompat, fix nightmode (#1455)
* upgrade appcompat, fix language switching & nightmode

* cleanup ThemeUtils

* upgrade dependencies

* change active boost icon (#1513)

* upgrade jetifier and android gradle plugin

* fix FilterTest
2019-10-03 19:58:21 +02:00
Konrad Pozniak d4f80f308d
upgrade Android gradle plugin, Kotlin and jetifier (#1468) 2019-09-03 18:35:42 +02:00
Konrad Pozniak d932912616
upgrade dependencies (#1389) 2019-07-16 19:36:04 +02:00
Konrad Pozniak 3f957a09c5
upgrade deps (#1263) 2019-05-18 08:06:30 +02:00
Conny Duck a471e358c3 upgrade deps 2019-04-28 09:52:12 +02:00
Konrad Pozniak 8b85df08bd
upgrade build tools and enable r8 full mode (#1198)
* upgrade build tools and enable r8 full mode

* fix media description in fragment_view_video
2019-04-20 17:44:54 +02:00
Bernd 0db1a23c4f Update Deps + Cleanup (#1158)
* Fix Typo

* Update build.gradle

* Update Deps

* Update Tests

* Fixes Tests

Without this some tests fail on my PC...

+ also:
"Put this in your gradle.properties:

android.enableUnitTestBinaryResources=true"
from http://robolectric.org/migrating/#project-configuration

* Make everything private

* Fix Warning

* Update TimelineFragment.java

* Update build.gradle

* Update gradle-wrapper.properties

* Update gradle-wrapper.properties

* Update gradle-wrapper.properties

* Fix Compile Errors

e.g.

Type inference failed. Expected type mismatch: inferred type is Preference? but Preference was expected

Type inference failed. Please try to specify type arguments explicitly.

* fix crash

* Grandle Wrapper 5.3

* Revert "Fix Compile Errors"

This reverts commit 4a774a4fe3.

* requirePreference

* oops

* Cleanup

* Update gradle-wrapper.properties
2019-03-30 15:18:16 +01:00
Frieder Bluemle ebaa3b4fac Update Android Gradle plugin to 3.3.2 (#1109) 2019-03-07 18:50:56 +01:00
Conny Duck 683b06a35d upgrade deps, fix some lint warnings 2019-02-11 16:59:01 +01:00
Conny Duck cdfc8a713d update gradle and build tools 2019-01-15 20:50:50 +01:00
Conny Duck f26c1718c9 update deps 2018-12-18 22:05:33 +01:00
Konrad Pozniak a445c12094
Upgrade to AndroidX, move to MaterialComponents theme (#953)
* upgrade to AndroidX, upgrade libraries

* move to MaterialComponents theme

* make sure the compose button looks good everywhere

* fix tollbar title/button alignment on tablet

* move to new material color theming, consolidate colors and themes

* fix build, fix imports

* set error on TextInputLayout instead of EditText

* fix imports, TootButton when

* improve snackbar style

* fix task description color
2018-12-17 15:25:35 +01:00