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

Make Appcompat dependency optional #18

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

Petrakeas
Copy link
Contributor

txsdk's build.gradle declared an "implementation" dependency to
'androidx.appcompat:appcompat:1.2.0'. The dependency is now changed to
"compile-only". This way, we are not adding Appcompat to an app that is not
already using Appcompat.

Special care was taken for accessing Appcompat methods and classes, as
doing so in an app that is not using Appcompat will result in a crash, since the
Appcompat classes will not be found at runtime. Utils#isAppcompatPresent()
is used before accessing an Appcompat class.

Removing Appcompat also affects multilingual support since Appcompat adds some
strings which are localized in lots of locales. Readme was updated with extended
instructions in case Appcompat is not used.

'androidx.annotation:annotation' dependency has been changed from "implementation" to
"compileOnly", as it is only needed at compile time (and when building the javadoc).
Since "compileOnly" dependencies are not inherited by the test sourcesets, it had to be
redeclared using "testCompileOnly".

txsdk's build.gradle declared an "implementation" dependency to
'androidx.appcompat:appcompat:1.2.0'. The dependency is now changed to
"compile-only". This way, we are not adding Appcompat to an app that is not
already using Appcompat.

Special care was taken for accessing  Appcompat methods and classes, as
doing so in an app that is not using Appcompat will result in a crash, since the
Appcompat classes will not be found at runtime. Utils#isAppcompatPresent()
is used before accessing an Appcompat class.

Removing Appcompat also affects multilingual support since Appcompat adds some
strings which are localized in lots of locales. Readme was updated with extended
instructions in case Appcompat is not used.

'androidx.annotation:annotation' dependency has been changed from "implementation" to
"compileOnly", as it is only needed at compile time (and when building the javadoc).
Since "compileOnly" dependencies are not inherited by the test sourcesets, it had to be
redeclared using "testCompileOnly".
Copy link

@dbendilas dbendilas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Petrakeas Petrakeas merged commit 069ce92 into devel Apr 19, 2021
@Petrakeas Petrakeas deleted the petrakeas/improve-dependencies branch April 19, 2021 23:37
@wyngarde wyngarde mentioned this pull request Apr 20, 2021
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.

None yet

2 participants