-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
#1259 Allow a local kiwix-lib aar to be used #1348
#1259 Allow a local kiwix-lib aar to be used #1348
Conversation
ba4279b
to
0e895b1
Compare
implementation 'org.kiwix.kiwixlib:kiwixlib:5.2.0' | ||
|
||
// Get kiwixlib online if it is not populated locally | ||
if (!file("./libs").exists()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would get rid of the !
and flip the branches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, the top branch will be hit 99% of the time though, so I would personally prefer it to be that way round.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kiwix/kiwix-build#346 (comment) sounds like we are not doing this anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I am using this for is to test kiwix-lib changes directly. The workflow is:
- symlink libs directory to the output of kiwix-build
- Build aar using kiwix-build
- Build and run the app.
- Repeat steps 2-4 until you fix whatever bug you are trying to fix.
Turnaround time with this is about a minute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With unit tests turnaround is in seconds if not milliseconds. We should have this discussion here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure unit tests would help and might reduce the need for this but we don't have them now. This is a small change that can be implemented now and allows other bugs such as #735 to be solved now. Simply open the effected file and debug using a combination of breakpoints and print statements between c++ recompiles.
if (!file("./libs").exists()) { | ||
implementation 'org.kiwix.kiwixlib:kiwixlib:5.2.0' | ||
} else { | ||
implementation 'com.getkeepsafe.relinker:relinker:1.3.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this be necessary? I think transitive = true
should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try getting relinker inside the aar but was struggling. (and we would only want to do this for debug builds). I think this is probably an acceptable solution instead.
I am going to merge this into the fix branch and then try get the tests passing on that. |
Why when you could just do it locally? Also what tests? |
Travis is failing showing 0 tests. The tests don't do this for me locally. |
We had that conversation on slack, you haven't added the aar to the project in git |
if you were to add this functionality not off a failing branch then tests would pass but the branch you based off of is failing and will continue to fail because we need an update from kiwixlib |
Yes I know, which is why I merged this so that once a new kiwix-lib is released (It has been fixed but not released yet) we can simply use that branch to merge in quickly. |
Once it has been released the pre-existing branch would have worked without this update (after incrementing the version number). |
So I have been working on getting the stackoverflow ZIM files working the last 2 days and this change has been essential to doing that. We don't have a JNI testing system yet so I don't see any reason why we can't add this to develop until such a system exists. |
It is fine to have this change local but I don't see the necessity for the change to happen to dev. Ideally we have a better system in place for the next ticket If we must see it I'd prefer to see
as it doesn't just integrate it into our project as a normal way of working |
We have had the current style system for over a year now and it works well. Uncommenting could also work but I really don't see the reason we can't have a check to see if the user has created a file and then use that file to override our import if they have. It makes debugging simpler and I really can't see a downside. |
it is active code in the build system, I have never seen a conditional dependency before so for me it was quite weird to see and interrupted my reading flow (the original kiwixlib one). |
Work on #1259