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

Add gradle + Standard project structure #20

Merged
merged 13 commits into from
Feb 10, 2022

Conversation

TheBestPessimist
Copy link
Contributor

@TheBestPessimist TheBestPessimist commented Feb 7, 2022

This PR adds gradle support for dependencies, and also updates the code to a structured layout.

Left to to (if desired by @Mamiglia ):

  • add a main package, ie. com.mamiglia
  • relocate .build folder (to where?)
  • relocate Installer folder (to where?)

Fixes: #19

@TheBestPessimist TheBestPessimist changed the title Add gradle + Standard project structure Draft: Add gradle + Standard project structure Feb 7, 2022
@TheBestPessimist TheBestPessimist marked this pull request as draft February 7, 2022 16:30
@TheBestPessimist TheBestPessimist changed the title Draft: Add gradle + Standard project structure Add gradle + Standard project structure Feb 7, 2022
@TheBestPessimist

This comment was marked as outdated.

@Mamiglia
Copy link
Owner

Mamiglia commented Feb 7, 2022

I saw a todo, asking for which is the current version. It is 1.2.1

For JNA: It's JNA-platform

@TheBestPessimist
Copy link
Contributor Author

The changes should almost be finished, however i have the following error when running:
image

@Mamiglia
Copy link
Owner

Mamiglia commented Feb 7, 2022

It doesn't find the icon which was in "/resources/tray_icon.png". you probably moved it. Set the correct path at line 18 of Tray.java

@TheBestPessimist
Copy link
Contributor Author

TheBestPessimist commented Feb 7, 2022

Works, it changes my wallpaper!

Another issue: when i right click tray and click settings, it gives another error:
image

@Mamiglia
Copy link
Owner

Mamiglia commented Feb 7, 2022

I can't understand the error at the moment, I will look further into this tomorrow

@TheBestPessimist
Copy link
Contributor Author

In that case, please check the PR. Check the left TODOs in the description, and think if you desire to change those.
I didn't check how they work, so you might need to instruct me, or test yourself.

When checking the PR, each commit can be read chronologically, so that you see what I changed and why.

If you think my PR is good enough, feel free to merge.
If you think changes are still needed, please ask for those changes.

If something doesn't make sense, please ask.

@TheBestPessimist TheBestPessimist marked this pull request as ready for review February 7, 2022 18:02
@Mamiglia
Copy link
Owner

Mamiglia commented Feb 8, 2022

Ok, the issue was caused by gradle not building the Intellij Swing desgner that I used to design the UI. I changed a setting in Intellij to make it work: https://stackoverflow.com/a/55725767/9419492 read the comments if your Intellij is > 2019.1

@Mamiglia
Copy link
Owner

Mamiglia commented Feb 8, 2022

Ok now the only thing left is the .build folder: where does it belong? It's a folder containing all the necessary files that I use together with Install4j, which is an external program that creates the installer

@TheBestPessimist
Copy link
Contributor Author

I have never used Install4j, however since it's not part of the source code, nor is it a resource needed during application run, it can stay in project root folder as it is now.

@TheBestPessimist
Copy link
Contributor Author

TheBestPessimist commented Feb 9, 2022

gradle not building the Intellij Swing desgner

I suggest you go and 👍 this issue and the 2 related ones, so that Jetbrains sees if people are affected by it: https://youtrack.jetbrains.com/issue/IDEA-223518

It seems to be mentioned in the docs as well, the green box at the top: https://www.jetbrains.com/help/idea/gui-designer.html.

This is unfortunate (maybe?) because with gradle you could have created the jar for the project simply by running gradlew jar. Maybe in your case this is not a problem as you are using install4j to generate the installer.

@Mamiglia
Copy link
Owner

Mamiglia commented Feb 9, 2022

Ok, added the 👍 to the issue. I did find this plugin that should've handled the thing automatically https://github.com/File5/intellij-idea-guidesigner-plugin, but probably due to my inexperience I couldn't make it work

@TheBestPessimist
Copy link
Contributor Author

TheBestPessimist commented Feb 9, 2022

You can add the plugin and push and i will check it out. That's the best way to learn how to use gradle.

though, it still doesn't work without enabling the right option in settings
@Mamiglia
Copy link
Owner

Tried to add the plugin as described by the github page, but still it doesn't work if I don't enable the right setting in the settings. I even tried some variations, but no way to make it work, it always give some error about a missing class (I think it's a class needed for the UI builder).
If we can't find a way to make it work I'll just revert the last commit

@TheBestPessimist
Copy link
Contributor Author

Yep, i cant figure it out either, sorry. ¯\_(ツ)_/¯

Just revert then merge.

@Mamiglia Mamiglia merged commit 7fa2b8f into Mamiglia:main Feb 10, 2022
@Mamiglia
Copy link
Owner

Thanks for all the help!

@TheBestPessimist TheBestPessimist deleted the add_gradle branch February 10, 2022 15:39
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.

Update project layout?
2 participants