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

Maven/Gradle support #37

Closed
hadess opened this issue Dec 6, 2018 · 7 comments · May be fixed by #253
Closed

Maven/Gradle support #37

hadess opened this issue Dec 6, 2018 · 7 comments · May be fixed by #253
Labels

Comments

@hadess
Copy link
Contributor

hadess commented Dec 6, 2018

This could be used to package Bisq and jadx.

@yajo
Copy link

yajo commented Mar 19, 2021

Would help kmcaster too. See flathub/flathub#2165 (comment).

@mbooth101
Copy link

I maintain the java extensions and have been thinking about it.

Current status: Apache Ant, Apache Maven, and Gradle are available for use in the openjdk extensions, but building stuff from source is quite complex due to the offline nature of flathub builds.

I have been working on some tooling to help, and will keep this ticket updated.

@hadess
Copy link
Contributor Author

hadess commented May 9, 2022

I don't know anything about building Java apps, or Gradle, but I think that something like this could work.

Run this from the app's git repo:

flatpak run --command=bash --share=network --filesystem=`pwd` -d org.freedesktop.Sdk//21.08 ./script.sh

With script.sh being:

source /usr/lib/sdk/openjdk11/enable.sh
rm -rf gradle-cache
mkdir -p dependencies/flatRepo/

# Install some ghidra specific files, should probably be installed by hand/outside this script
wget https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip
unzip -j dex-tools-2.0.zip "*.jar" -d dependencies/flatRepo/
wget -P dependencies/flatRepo/ https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar

# Launch gradle build with `--info` to log all the http(s) URLs
gradle -g gradle-cache/ --info --console plain buildGhidra | grep http > gradle-log.txt

# And parse gradle-log.txt to output a nice json file...

The parsing could also be done outside the sandbox, probably in Python.

@hadess
Copy link
Contributor Author

hadess commented May 9, 2022

This script looks easy enough to modify for our needs: https://github.com/flatpak/flatpak-builder-tools/blob/master/dotnet/flatpak-dotnet-generator.py

hadess added a commit that referenced this issue May 10, 2022
hadess added a commit that referenced this issue May 11, 2022
hadess added a commit that referenced this issue May 12, 2022
hadess added a commit that referenced this issue May 12, 2022
@muelli
Copy link
Member

muelli commented Jul 12, 2022

this seems to be tackled here: #276

@wvengen
Copy link

wvengen commented Jan 26, 2024

For Maven, flatpak/flatpak-builder#58 (comment) is probably useful to know about (and used by some existing apps on Flathub).

@hfiguiere hfiguiere added the java label Apr 5, 2024
hadess added a commit that referenced this issue May 20, 2024
hadess added a commit that referenced this issue May 20, 2024
@hadess
Copy link
Contributor Author

hadess commented May 21, 2024

Latest push(es) fixed warnings related to the regex syntax:

/home/hadess/Projects/Flathub/org.ghidra_sre.Ghidra/_deps_build/./flatpak-gradle-generator.py:83: SyntaxWarning: invalid escape sequence '\/'
  r = re.compile('https:\/\/[\w/\-?=%.]+\.[\w/\-?=%.]+')

hadess added a commit that referenced this issue May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants