Defold Simple Target System

defold-simple-target-system

There is a simple editor script, motivation:

If you are using multiple versions of your app with different settings in game.project, this library can help you quickly switch between settings presets using context menu. These presets (aka targets) has similar structure to game.project, also they support inheritance for copypaste decrease.

17 Likes

This is pretty neat and quite useful! Thank you for sharing this!

3 Likes

This looks really interesting! I’m going to give this a try soon.

Currently I use git branches to handle 3 different app versions: Google Play, Google Play Instant, and Amazon App store. It’s a big pain point.

2 Likes

If you’re not already doing it, I can also really recommend using bob.jar manually as well, as it’s easy to pass in different settings files (e.g. one for each store).
E.g. suitable for you autobuilder/CI scripts to produce new builds when you push to your source repository.

2 Likes

Yeah, we are using ci scripts to build targets on push, pipeline is one bob.jar and script-switch targets, also there is one useful feature: if needed to exclude some files from build, we can parse current collection path from game.settings, and exclude other collection dirs using --exclude-build-folder. There was an idea to include this feature into library, but it’s convention way, like “use this project structure to make it work”, that seems poor as universal solution. Maybe we will come up with a better way (Is there a way to use --exclude-build-folder analog in game.project file?)

1 Like

I’m not sure but take a look at the .defignore file plus the example of how to use it.

1 Like

There are two problem with Defignore as solution for exclude code files:
1 - its not a part of game.project, so you cannot use this script to change targets and exclude folders
2 - defignore make file completly invisible for ide, so you cannot edit, search text in it, or just open this files.

@britzl and @Mathias_Westerdahl maybe it’s time to add--exclude-build-folder in game.project settings? (Can i exclude list of folders with it?). This would solve my long running issue with bundling https://github.com/defold/defold/issues/5427

2 Likes