-
Notifications
You must be signed in to change notification settings - Fork 103
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 Gradle generator #276
Add Gradle generator #276
Conversation
4a010db
to
9c28b2f
Compare
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.
Sounds good. I'll try to improve this.
9c28b2f
to
2ae84f0
Compare
The script doesn't work out of the box. I had to make some changes: |
Could you please post a new version of this without changing all the quotes by double-quotes? It adds a lot of changes that aren't necessary to implement what you need. I also don't understand why you removed the regexp. Maybe the easiest would be if you attached the full gradle log for us to test, then we can try it out. |
Here it is: |
2ae84f0
to
5f53305
Compare
I kept the code to create arch-specific urls, but I also:
I'm pretty happy with this now, so if anyone else wants to experiment. |
5f53305
to
c39822d
Compare
Good. Any idea when this will be merged? |
No, but porting the jadx or Bisq Flatpaks to use it would certainly show whether it's fit for purpose. In the meanwhile, it's not disappearing, and we can use it for Ghidra. |
Ok |
I couldn't get the script to work, but I don't understand the approach. For @Terasology I can
Can this be parsed instead? |
I tried on Ghidra. But it doesn't list all the dependencies. |
What failed exactly? Can you provide the gradle log? |
I am missing Python dependencies on @openSUSE. |
Which ones? |
Seems like updating pip with pip itself solved the installation problems. Yet the script does not run:
|
This means your Python version is way too old. IIRC |
From https://docs.python.org/3/library/asyncio-task.html#asyncio.run
Python 3.7 was released in 2018, close to 4 years ago. Time to update. |
Just for some external input: I've also worked on this and have a semi-working script here: https://github.com/TobTobXX/flatpak-builder-tools/blob/master/gradle/flatpak-gradle-generator.sh. Parsing build logs or Instead, my script runs a I've not submitted a PR yet, since I'm still testing my script on various projects, but if you want to use it, go ahead. |
I think this might be a problem with using gradlew instead of gradle, or a problem with the build scripts because the build tools should already log all the downloaded assets. But not knowing what software you're trying to package, or the exact steps, it's difficult to say. Note that the build script we use for Ghidra uses a sandboxed dependency download section, to avoid any sort of cache from being used inadvertently.
I doubt that a bash script would be accepted. In any case, that would be something to discuss on your own PR, not this one. |
Can you maybe post an example usage? I managed to download all dependencies for JSkat, but it seems they are not discovered by Gradle:
|
There's already an explanation in the README added in the patch. But I tested the generator with https://github.com/b0n541/jskat-multimodule (next time, please make sure to attach the full output of what you did, here I had to even search what jskat was).
Running the script on the log threw an error, but I edited the script to remove the URL that caused the error, and re-ran it, and it generated a json file. It didn't seem like the file was needed, as it built without it. |
Running the generator is not a problem, but I don't know how to apply this in the Flatpak manifest. |
It's a json file, you include it. See the Ghidra manifest for example: |
The shell script moves files by default into |
Does it need to be merged in order to use it? |
I'm not sure where you get that, there's no mentions of
Absolutely not, a second user might make it easier to get this patch merged, hopefully. |
I tried to run in my application and I'm using detekt for static code analysis. However, when I run it cannot get the The script fails because of that but detekt is not even used in production code. Do you have any hint about what to do in this case? |
You might implement an option in the script to use a custom url for specific packages. Or even ignore the url. Or you can currently remove the url manually. |
I ignored the Url and it worked, thank you! |
7e36abc
to
df0f1c2
Compare
I'd be fine merging this. It works for you then it can be fixed later for other use cases that fail. Otherwise it never will. |
Please have somebody in |
Closes: #37
df0f1c2
to
09248bf
Compare
Done. |
Now that it has been merged upstream: flatpak/flatpak-builder-tools#276
I don't know what I'm doing, but I can parse the logs of a Gradle build and generate a
json
file to build Ghidra.