Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate annotations and improve kotlin dsl configuration. Migrate to kotlin #813

Merged
merged 17 commits into from
Nov 26, 2020

Conversation

F43nd1r
Copy link
Member

@F43nd1r F43nd1r commented Oct 16, 2020

Closes #810

This makes kotlin a first-class citizen for acra. Maybe move documentation to kotlin as well?

Example configuration:

        initAcra {
            reportFormat = StringFormat.JSON
            dialog {
                title = "Dialog Title"
                setResText(R.string.dialog_text)
            }
            httpSender { 
                uri = "https://acra.ch/not-a-real-endpoint/report"
                basicAuthLogin = "test"
                basicAuthPassword = "guest"
            }
        }

@F43nd1r F43nd1r added this to the ACRA 5.8.0 milestone Oct 16, 2020
@F43nd1r F43nd1r changed the title Deprecate annotations and improve kotlin dsl configuration Deprecate annotations and improve kotlin dsl configuration. Migrate to kotlin Nov 23, 2020
@F43nd1r
Copy link
Member Author

F43nd1r commented Nov 23, 2020

This PR has changed scope a bit, now includes migrating the full codebase to kotlin. The aim is to stay 100% compatible with java, but take advantage of kotlin language features where possible.

@mikehardy
Copy link
Contributor

I think as long as you don't use extension functions everywhere (like material-dialogs did https://github.com/afollestad/material-dialogs/issues/1848) it will be compatible yes - we're still java and we do a subclass so I'll test it you publish a pre-release somewhere I can make a gradle dep. We also do all our config via annotations so I might be a good test drive on any config change. Cheers @F43nd1r

@F43nd1r
Copy link
Member Author

F43nd1r commented Nov 24, 2020

I think as long as you don't use extension functions everywhere (like material-dialogs did afollestad/material-dialogs#1848) it will be compatible yes

Technically extension functions can be accessed in java using the class generated for the defining file. It's ugly, but it works. I'm not relying on that though. There are a few extension functions providing convenience in kotlin dsl. All of them just define shortcuts.

We also do all our config via annotations

Config using annotations will be deprecated or maybe even go away completely with this. For now, nothing should have changed for annotations.

we're still java and we do a subclass so I'll test it

I've attached an early build. Alpha release will follow when I've done some testing myself.
acra.zip

f43nd1r added 2 commits November 25, 2020 15:17
# Conflicts:
#	acra-mail/src/main/java/org/acra/sender/EmailIntentSender.java
@F43nd1r F43nd1r merged commit 084e62f into master Nov 26, 2020
@F43nd1r F43nd1r deleted the issue_810 branch June 12, 2022 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to configure ACRA Dialog in Android Gradle Plugin v5 compatible way?
2 participants