centrifugal / centrifuge-java

General Java and Android client SDK for bidirectional communication with Centrifugo and Centrifuge-based server over WebSocket
MIT License
65 stars 33 forks source link

Update Javalite Dependency and change implementation to api #34

Open FarshidRoohi opened 2 years ago

FarshidRoohi commented 2 years ago

Update com.google.protobuf:protobuf-javalite: 3.11.4 to 3.19.2 Change implementation to api, because api is the correct way to add a dependency in lib and solved many problems and conflicts in other dependencies.

FZambia commented 2 years ago

Hello, thanks!

From Gradle docs:

The api configuration should be used to declare dependencies which are exported by the library API, whereas the implementation configuration should be used to declare dependencies which are internal to the component.

This makes me feel that it's not really obvious that libraries should always use api. Could you describe which exact issues you came across and how switching to api solves them?

FarshidRoohi commented 2 years ago

Hi! I have a problem implementing centrifuge-java and protobuf-kotlin together with them. because of a big conflict in protobuf-java and I try to many solutions for this problem and fix the duplicate class errors. I read this issue but couldn't help me and I fork centrifuge-java and change implementation to api and implement .jar file in my project and fix my issue and Gradle dependencies conflict.

I add .jar file in the project and implemented com.google.protobuf:protobuf-kotlin:3.19.4 worked and I'm not any problems so I change implementation to api and create a pull request.

If you are a library maintainer you should use api for every dependency which is needed for the public API of your library

Link

FZambia commented 2 years ago

Thanks. Do you have a chance to post a minimal example app on Github which reproduces a problem? I never worked with Kotlin and Java is not my day to day language - so detailed instruction on how to build it will also help. Just want to dig into this a bit to get more understanding about an issue.

VovaStelmashchuk commented 10 months ago

Do you happen to have any update on the PR? The PR is beneficial for the Android project. Because the Android projects use firebase-pref and datastore library, which depend on the photobuff or photobuff-lite libraries, the libraries have a conflict with centrifuge-java. Can you merge the PR or add special lines into the ReadMe file for android folks?