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

[WIP] Make a separate, independent java library out of the core package #12

Draft
wants to merge 22 commits into
base: coreOnly
Choose a base branch
from

Conversation

pec0ra
Copy link

@pec0ra pec0ra commented Jan 31, 2020

This PR fixes issue #10

The following has been done:

  • Create a library from scratch and add librespeed's core package to it
  • Removed android dependencies to make library more compatible
  • Flattened packages to only expose relevant classes and methods to public

The following still needs to be done:

  • Improve User Agent
  • Add README Improve README
  • Add javadoc Improve javadoc
  • Publish to github package registry for easier use

@pec0ra
Copy link
Author

pec0ra commented Jan 31, 2020

@adolfintel
I have added the code to publish the library to Maven Central (See 9d11687).

This code will however need some steps from your side in order to make a publication. You will need to make a request to sonatype (the company hosting Maven Central) to allow you to publish the library.
Information about this procedure be found on this site: https://proandroiddev.com/publishing-a-maven-artifact-3-3-step-by-step-instructions-to-mavencentral-publishing-bd661081645d
Note that the steps 5 and 6 of this page are already done in 9d11687

Let me know if you need any help with that or if you prefer another method of publishing your library.

@pec0ra
Copy link
Author

pec0ra commented Jan 2, 2024

Hi @adolfintel,
Are you still interested in this?

In the meanwhile, I have changed the build to upload the artifacts to GitHub's package registry. This is done automatically for any release (on the onlyCore branch) with GitHub Actions (See for example this workflow: https://github.com/pec0ra/speedtest-android/actions/runs/7387305485/job/20095719687).

Here is an example: https://github.com/pec0ra/speedtest-android/packages/2028007
The package can be used in gradle with

implementation 'com.fdossena:librespeed:1.2.5'

@adolfintel
Copy link
Member

@pec0ra Yes, I'm still interested and it looks good.

I don't have time to work on anything right now, let me know when it's finished and I'll give it a try.

@pec0ra
Copy link
Author

pec0ra commented Jan 5, 2024

No problem, I will see if I can make some more improvements. At least the ones in the todo list of the PR description.

There is however another point I wanted to bring back again. It is the one of the location of the code. This PR would put the code in a separate coreOnly branch, which I don't find optimal. I think it would be better to have two separate repositories: One for the android app and one for the library.

A separate repository would have the following benefits:

  • It is easier to find the code of the library
  • Releases can be made independently (this can be done in one repo with releases on separate branches but it would be very confusing).
  • The library would be allowed to grow independently of the android app. I think this is important if people want to use it for other applications (cli, desktop, etc).

Let me know what you think.

@adolfintel
Copy link
Member

I agree, it would be more useful as a java client library that's also compatible with android.
Let me know when your PR is ready and I'll set up a repo where you can push it.

@pec0ra
Copy link
Author

pec0ra commented Jan 14, 2024

Hi @adolfintel

I improved the README and had another look at the javadoc and things look ready.

I kept the code very similar to what already exists (and works) in the master branch of this repo. I tried to only refactor the structure to make it independent from the Android code. Improvements to the library/code can always be made in the future.

The User Agent is the only thing that is different from the master branch. I'd like to make it configurable (with a good default) instead of hardcoded but I couldn't find a good way to do it without some code refactoring. I recommend that we keep it as a future improvement.

If you setup a new repo, I will reopen this Pull Request against it.

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.

2 participants