Skip to content

Conversation

@BenjaminAmos
Copy link
Contributor

Description

This pull request fixes the gradlew dist and gradlew distZip commands. It also adds support for including all the modules from the current workspace in the distribution,

The modules will be compiled into jars and copied into the modules directory when the distribution is created. Both the code and the assets should be contained within a single jar for each module, named after the module and its version.

Directory-based modules, such as those used for development, should still work when copied into the output modules directory. Zip archives do not work currently.

Testing

Testing distribution creation

  • Run the command gradlew dist.
  • A folder, named app, should be created within the desktop/build/distributions/ directory. Enter this directory.
  • Execute the relevant launcher (sol.exe on Windows, solOSX.sh on MacOS and sol[64].sh on Linux). The game should start and should be able to be played normally, without any additional crashes.

Testing distribution zip creation

  • Run the command gradlew distZip
  • A zip archive should be created, called DestinationSol.zip, within the desktop/build/distributions directory.
  • Extract DestinationSol.zip into a directory and enter it,
  • Execute the relevant launcher (sol.exe on Windows, solOSX.sh on MacOS and sol[64].sh on Linux). The game should start and should be able to be played normally, without any additional crashes.

Testing modules

Testing code-only modules

  • Run the command groovyw module get codeModuleTest -remote BenjaminAmos to get my codeModuleTest module.
  • Follow the steps contained within the "Testing distribution creation" section.
  • Check that in the top-left corner of the screen there is some text labelled "Game Duration: ", followed by the quantity of seconds that the current game session has run for.

Testing asset-only modules

  • Follow the steps contained within the "Testing distribution creation" section.
  • Check that the game does not crash when starting a new game. If the core module is not present or loaded then the game will crash.

Testing modules containing both assets and code

  • Run the command groovyw module get warp to get the warp module.
  • Follow the steps contained within the "Testing distribution creation" section.
  • Start a new game with the "Warp Scout" ship.
  • Check that the game does not crash.
  • Check that there is a button on the right side of the screen labelled "Research".

Notes

Credits

@GooeyHub
Copy link
Member

Uh oh, something went wrong with the build. Need to check on that

Copy link
Member

@NicholasBatesNZ NicholasBatesNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this does what it says on the tin. Nice work.
I'm not entirely sure what you mean by the executable permissions are broken on Linux; I was able to run sol64.sh just fine and the permission was already enabled (Ubuntu 18.04).
Another thing to note is that all the debug logs are shown when run from the distribution, I feel like this should not happen?

Very well done though, I was able to include my module in the distribution and I encountered no issues. :)

@@ -0,0 +1,96 @@
/*
* Copyright 2018 MovingBlocks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 2019 :P

@GooeyHub
Copy link
Member

GooeyHub commented Jun 1, 2019

Uh oh, something went wrong with the build. Need to check on that

@BenjaminAmos
Copy link
Contributor Author

When I copied the zip archive produced on Windows into Linux the permissions were missing. They seem to be correct if compiling on Linux directly.

I have added some commits to reduce the logging level in distribution builds (or more precisely to increase it in IDE and gradle builds). You may need to run the commands gradlew cleanIdea and gradlew idea in order to use those changes.

I also applied the fix suggested by Avalancs in #181 (comment), which appears to have fixed the duplicate files in sol.jar.

Copy link
Member

@Cervator Cervator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see you again @BenjaminAmos ! Stellar work as usual :-)

Can confirm that this works on Windows 10 and on MacOS, although it turns out the game has probably been crashing there for a while due to a different issue. Trying to apply a fix on top here since now suddenly the game can be run normally again.

Happy to add you to the GSOC mentor pool and/or the TSOC project for DestSol or anything else if you're interested! TSOC might come with stipends if that's of interest, while GSOC mentoring comes with free swag and portfolio fodder :-)

int length = -1;
try {
BufferedInputStream stream = dataFile.openStream();
//HACK: This method may not produce reliable results in other JVMs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could perhaps use a bit more background detail :-)

@Cervator Cervator merged commit fd44528 into MovingBlocks:develop Jun 2, 2019
@Cervator
Copy link
Member

Cervator commented Jun 2, 2019

Added commit for Macs is 6ab488d - included also making the Mac script executable. Although we might want a .command instead - also breaks embedded JRE for Mac which needs a refix along with #414

@Cervator
Copy link
Member

Cervator commented Jun 2, 2019

Oh, and thanks for the great testing instructions by the way. I happened to have both your content module and test module in my workspace still and tested with both :-)

(the mega-weapon on one ship in "warp" is semi-broken by some faction changes though, i think the projectiles insta-collide with each other now)

@BenjaminAmos BenjaminAmos deleted the fix-distribution branch February 12, 2022 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating distribution of the developer version; crash because resource not found

5 participants