defold icon indicating copy to clipboard operation
defold copied to clipboard

Add "targets" or "build variants" to project system and editor

Open Vbif opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe (REQUIRED): As far as I understand deploy different app from one source code is possbile with --settings flag of bob. And if i need to test\develop this "different app" i need manually merge project settings file and than rollback it. Also bundle from editor not make sense for such application, because you cannot add more settings in bundle dialog.

Describe the solution you'd like (REQUIRED): I think it would be good to have some visual buttons in project settings. Where user can create several targets for one platform with differents dependecies, constants or appmanifests (Not full copy, just additional to some base or parent target). And ability to switch between them (targets) and run or bundle it.

Vbif avatar Dec 22 '20 22:12 Vbif

The topic of this issue is came up time to time in russian community, and looks like every programmer has your own way to solve it. I'm still thinks that introducing "targets" would be the best solution for this. Our ambassador, @AGulev, persuaded me to tell you my story and why i'm not happy with bob —settings.

To be real, i'm not using bob settings, instead I came up with python script that merge ini files and creates game.project. Last version i checked is 182, maybe something is changed in 183 and 184 beta.

The small preface for my situation:

I have a repo with game, and game consist of several features - game, levels, in-game level editor. I want deploy these features separately to differrent web platform. In other engines and build systems this often call "target" or "build variant" Back to my case, I'm want:

developer - most powerfull target. Contains all features and that runs inside the defold editor with ctrl+b. Have extended constants in game projects and some native sdk for in-game editor.

release_* - one or two web bundle with different ads sdk included in it. Have game and levels as features, reduced constants in game projects, omit some resources, etc

release_default - the same as other release but without all platform sdk. This is for ci tests.

gamedesing - when i'm just starts, i'm also want web bundle with just game and editor to create levels online. So you dont need share a project, just link to web build.

Why bob —settings is not a solution (Part 1)?

There several release targets and I found its handy to have common config with release configurations. And targets, that containt diff over common config (like change bootstrap collection, add extension). Then developer target contain a lot difference, but it only one.

So i have several game.project files (one common, and other diffs), but i cannot open my project (editor doesnt know about that —settings). And bob cannot help me. I need merge two pieces in one (by script or manually) and then open. I need carefully manage my changes and distribute it over project files. If there was some targets system in defold I'm still need to carefully manage my changes, but it would be less error-prone.

Why bob —settings is not a solution (Part 2)?

Okay, you may say it dont work in editor, but it work in bundle. But... it doesnt work in bundle. Different targets contains different extension and you code contains lua require to it. When you bundle for one target there would be error for another target, because all files are in projects and all of them checked by bob. There is no ignore settings in game project. 183 introduce defignore, but it solve some other problem. Because i want edit, search and open these files.

Vbif avatar Jun 15 '21 20:06 Vbif

@Vbif sorry for the slow reply and thank you for a very thoroughly written feature request. We're currently doing a review of all feature requests to plan for a roadmap update and we will review your request in due time.

britzl avatar Jul 12 '21 05:07 britzl

it seems like your extension editor_script (with python script inside) solves most of the isuess: https://github.com/nevolin-dmitry-leonid/defold-simple-target-system

As I understand we have only two improvements we should do to make more user friendly:

1st is important: Build assets only with dependencies from game.project to avoid build errors in scripts. Here is a new task: https://github.com/defold/defold/issues/6293

2nd in nice to have feature: https://github.com/defold/defold/issues/6233

Am I right here?

AGulev avatar Dec 29 '21 13:12 AGulev

Yes, you are right!

Vbif avatar Dec 29 '21 16:12 Vbif

1st is important: Build assets only with dependencies from game.project to avoid build errors in scripts. Here is a new task: #6293

should be done in the next 1.9.3 version

AGulev avatar Aug 22 '24 20:08 AGulev

I'm closing this task because:

  • the main locker has been solved
  • now it's possible to create custom UI for your own bundle dialog and run bundle using bob from editor scripts (with custom flags)

AGulev avatar Nov 07 '24 21:11 AGulev