Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Gradle copy to mods task #27

Merged
merged 3 commits into from
Apr 28, 2021

Conversation

mnukka
Copy link
Contributor

@mnukka mnukka commented Apr 27, 2021

No description provided.

@jaghaimo
Copy link
Owner

Please use the default file: gradle.properties (gitignored). That way you can access the properties directly, and can remove file reading etc. Do also add a gradle.properties.dist with an example of correctly set path.

Additionally, please make the task run after build has finished, but instead of throwing skip the copy if the directory is not set (could do with a warning message).

@mnukka
Copy link
Contributor Author

mnukka commented Apr 27, 2021

Please use the default file: gradle.properties (gitignored). That way you can access the properties directly, and can remove file reading etc.

Are you sure about this? The reason I did not use "gradle.properties" is because this is the default file used by gradle for various shared settings that developers may want to define. It is generally not used for local settings but shared settings.

I can do it. The need for any shared settings might not be necessary in this project.

@mnukka
Copy link
Contributor Author

mnukka commented Apr 27, 2021

Additionally, please make the task run after build has finished, but instead of throwing skip the copy if the directory is not set (could do with a warning message).

Can you elaborate the point of building if you have nothing to copy? You can run gradle build if you are just interested in the jar file.

@jaghaimo
Copy link
Owner

Additionally, please make the task run after build has finished, but instead of throwing skip the copy if the directory is not set (could do with a warning message).

Can you elaborate the point of building if you have nothing to copy? You can run gradle build if you are just interested in the jar file.

I thought of redefining build as build + (conditional) copy. Perhaps that's a wrong approach. Keeping throw is fine, just point the user to dist file.

@jaghaimo
Copy link
Owner

Please use the default file: gradle.properties (gitignored). That way you can access the properties directly, and can remove file reading etc.

Are you sure about this? The reason I did not use "gradle.properties" is because this is the default file used by gradle for various shared settings that developers may want to define. It is generally not used for local settings but shared settings.

I can do it. The need for any shared settings might not be necessary in this project.

Yes please. If for some reason we do end up needing shared properties then we'll revert this and go with custom (local) variation.

Copy link
Owner

@jaghaimo jaghaimo left a comment

Choose a reason for hiding this comment

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

Happy with this but would be great if you could make it more generic:
gradle.properties:

game.dir = C:\\Something\\Starsector
game.executable = starsector.exe (or starsector.sh for Linux)

With another task to start the game (depends on copyMod) and copyMod changed so the mod name is not hardcoded (taken from mod_info.json instead).

gradle.properties.dist Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
@jaghaimo jaghaimo merged commit fc84abe into jaghaimo:master Apr 28, 2021
@jaghaimo jaghaimo linked an issue Apr 28, 2021 that may be closed by this pull request
jaghaimo pushed a commit that referenced this pull request Dec 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add task to start the game
2 participants