BrettMayson / HEMTT

Build System for Arma 3
https://brettmayson.github.io/HEMTT
GNU General Public License v2.0
109 stars 40 forks source link

Add multi-project build-support #45

Closed Krzmbrzl closed 1 year ago

Krzmbrzl commented 5 years ago

I think it would be neat if HEMTT had multi-project build-support. I know that strictly speaking HEMTT (as is) is intended to project management rather than pure building but I believe it would be a useful feature.

Here's what I have in mind: Suppose you have a set of projects. You'd then go ahead and make each of those a HEMTT-project (so with all the configs and stuff) so that each individual project can be built by HEMTT. You then create a new BuildProject (name isn't fixed of course) that allows you to combine all the single projects into one project group. If one now goes ahead and builds the BuildProject all individual projects get built and the built PBOs are then copied to a location specified in the BuildProject.

What would be a usecase for that? If I am using 3 mods on my server that I have to build myself I can then build all of them in one step and have the mod-folders ready-to-use as well (if I configure copying the built PBOs + keys + stuff properly of course) and only have to upload them to the server.

Further improvements on this:

For the latter I'll open another issue for armake2 as this will probably be easiest if such remote-builds are supported by armake directly.

BrettMayson commented 5 years ago

In my opinion these features, while they could be useful, are too niche given the amount of usage HEMTT currently has. The things you mentioned in the issue could be a small python, bash, or powershell script.

I could potentially see the use of having an include be a URL but I don't think HEMTT should be downloading entire projects.

Krzmbrzl commented 5 years ago

The things you mentioned in the issue could be a small python, bash, or powershell script.

Well - no offense - but this could be said about the entire project (at least about the parts I am familiar with). And as this project (in my opinion) is all about not having to have additional scripts in place i'd say it is quite well suited.

Besides: As the base-idea could be implemented via a bash-script it also means it's not that complicated to implement it ;) I might even do it myself if I finally find some way to work with Rust properly. I'll have to see about that though.

BrettMayson commented 5 years ago

this could be said about the entire project

This is correct, the point of HEMTT though is to work with as many project structures as possible, as easily as possible. Something tailor made scripts can't really do. HEMTT is replacing Python, bash, and Powershell scripts because while it is possible in those languages it isn't the easiest thing for people to maintain and each project has their own unique version. HEMTT is still in the early days so there is not a lot of utilities yet, but that will come in time.

too niche given the amount of usage HEMTT currently has

This was my main point, the things you are suggesting are not very hard to implement with a script that is: small, readable, easy to maintain, easily transferable to another project. You will even be able to do it with HEMTT (a future version, after #15 is done). You could take a folder with only a hemtt.json folder and use

"prebuild": [
  "git clone [url] /tmp/my-mod",
  "cp -r /tmp/my-mod/* ."
],
"postbuild": [
  "[do your publishing here]",
  "find . -type d -exec rm -rf {} +",
  "find . ! -name 'hemtt.json' -type f -exec rm -f {} +"
]

Then hemtt build would clone a github repo, move the contents to the current directory, build, and delete everything except the hemtt.json file

Krzmbrzl commented 5 years ago

Yeah my hope was that with HEMTT I could do that in a platform-independent way (except of having the respective platform-dependenet HEMTT-binary) by letting HEMTT do some "config-magic" ^^

I also do see that this is certainly not a priority for you atm but I believe it would be a nice addition at some point.