-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add maven generator script #253
base: master
Are you sure you want to change the base?
Conversation
Looks reasonable, do you plan on helping actively maintain it? |
I would be happy to, yes. |
7e05274
to
f93c36f
Compare
f93c36f
to
89aaf03
Compare
@gasinvein Thank you for the review! I've implemented your suggested changes and this is looking better now. |
I just tried this script with a libGDX project aaaaand.... you're gonna hate libgdx after this. Take a quick look at this pom: https://repo1.maven.org/maven2/com/badlogicgames/gdx/gdx-backend-lwjgl3/1.10.0/gdx-backend-lwjgl3-1.10.0.pom Two things that throw a wrench into this script: (btw, I'm just trying to figure out how maven works myself, so anything I say here is just how it looks to me)
I'll try to fix it myself and report back, but you are probably more knowledgeable in the Java ecosystem. Thanks for your work! |
@TobTobXX Thanks for trying it out! I think I've implemented support for both of those things now if you'd like to try it out again and let me know how you get on 🙂 |
version = dep.find("POM:version", ns) | ||
|
||
if(version is None): | ||
continue |
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.
Can you check out what's the matter with com.esotericsoftware:kryo? This check (although IMO really sensible) skips its dependency on reflectasm
(gradle resolves the version to 1.11.3
).
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.
Ugh, I figured it out. kryo
's parent (kryo-parent
) somehow defines the version through a property in a <dependencyManagement>
tag.
You know what, screw that dependency, I'll add it manually to the command.
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.
Are there cases where silently continuing here is desired? If not, maybe log a warning and instruct the user to add it to the dependencies manually.
Oh, and thank you a lot for your work! You're awesome!
After some more hours of testing and fiddling with my setup, I have now a script that works wonderfully for me! I went with a different approach: I let gradle do the dependency resolution (ie. no stupid pom edge cases) into a fresh cache directory and then move the downloaded dependencies into a local maven repo. This also lets me derive the source urls from the directory structure
@davidmhewitt Can you test it for your project? Then we could rewrite it in python (I'm bad at py and don't know how to do some stuff I did in the bash script), or we could get the bash script merged directly. EDIT: Here's the updated script which supports multiple repos: flatpak-maven-generator.sh |
Maybe submit a PR on top of this for these changes. A maven generator would be great. |
I'm not sure I understand how this works. Note: I'm totally clueless how Java build tools work, I have avoided it for 25 years.
whereas
|
@hfiguiere Hi! Thank you for your interest. I've reworked the script a couple of times since posting it here. Here's the current source: flatpak-gradle-generator.sh. I would very much like to make it fit for this repo. I think it works, but testing it on different projects is extremely time-consuming and I've yet to test it to my satisfaction. Also, could you post your problem as an issue on my fork? That'd make more sense, since polishing the script is a WIP still. |
What I didn't pay attention to in my comment above is that yours is shell, while this PR is python. Also, you mention |
Yes, I am not the writer of this PR. The original PR author indeed wrote it in python and I just started to discuss improvements. At the time I started, I didn't really know the difference between maven and gradle. So this script is not a replacement of this PR, it's just what worked for me. You may have more success using the PR itself. If you have, you may help the author get it merged. |
Fixes #37
This is a script to generate a JSON file of sources that when included in a manifest, will download a set of maven dependencies into the
flatpak-builder
sandbox to enable the building of applications that would normally require downloading dependencies from Maven repositories.I have used this to successfully build a proof of concept of a Kotlin/Native application: https://github.com/davidmhewitt/KotlinSample
You can see the generated JSON file here:
https://github.com/davidmhewitt/KotlinSample/blob/main/maven-modules.json