YoYoGames / GDKExtension

GMS2 Extension for GDK
Other
20 stars 9 forks source link

Run batch file based on project config #53

Closed shichen85 closed 2 years ago

shichen85 commented 2 years ago

Hello,

How can I ignore running the bat file based on the config of the project? I am asking this because for Windows, we have 2 configs, one for Steam and one for Windows Store. We don't use GDK for the Steam config, so I want to avoid running the bat file in that build.

As an example of early exiting the batch file based on export type: https://github.com/YoYoGames/GDKExtension/commit/3c9e1c3764967857df2ebc2400943fb320ec44f6#r70819408

rwkay commented 2 years ago

From memory the config is passed into the batch file as an environment variable - if you uncomment the set at the top of the batch file it should display all the environment variables that are passed in... you can change the batch file then to check the value of the config and exit.

We are introducing extension specific build batch files that are not executed if the extension is disabled (this is a configurable setting so it will respect the config) - this will be the way to do it in the future, I think this will be in the April release, but the extension will need to be changed (well the batch file moved into the extension itself).

@DiasFranciscoA - we will need to sort that out once the Stable is released.

Russell

DiasFranciscoA commented 2 years ago

This feature should be already part of the 2022.3 stable.

Scripts can now be executed on a per-extension basis. If you are using this version, please place the bat files inside the GDK extension folder (instead of the root folder of your project) this means the bat files will only execute when the extension is “enabled”.

To disable an extension create the 2 configs and go into the desired config, double click the extension and deselect all the "copy to" check boxes (this way if the scripts are place inside the extension folder this will prevent them from running)

NOTE: the same applies to the steamworks extension you can now place the scripts inside the actual extension folder (feature introduced in version 2022.3)

shichen85 commented 2 years ago

This feature should be already part of the 2022.3 stable. Scripts can now be executed on a per-extension basis. If you are using this version, please place the bat files inside the GDK extension folder (instead of the root folder of your project) this means the bat files will only execute when the extension is “enabled”. To disable an extension create the 2 configs and go into the desired config, double click the extension and deselect all the "copy to" check boxes (this way if the scripts are place inside the extension folder this will prevent them from running) NOTE: the same applies to the steamworks extension you can now place the scripts inside the actual extension folder (feature introduced in version 2022.3)

Awesome. Can confirm that it works with 2022.3 stable.