Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

Build Specific Task Support #4

Open
darkplayground opened this issue Dec 11, 2021 · 4 comments
Open

Build Specific Task Support #4

darkplayground opened this issue Dec 11, 2021 · 4 comments

Comments

@darkplayground
Copy link

I need to run an image optimization script on the renpy game source but It needs to only run when building for android. I looked at the docs for custom tasks but I didn't see any obvious way to run build-specific tasks. Ideally I would be able to run the android build last (assuming multiple builds were chosen in the config) and create a custom task that would run right before the android build step that runs the image optimization script on the source. That way the Mac/pc builds have the full size assets and the android build has the smaller assets. Since I'm running this in CI, it doesn't matter if any changes are made to the images during the process as they are thrown away at the end of the pipeline build.

I thought about potentially running a task to copy the source files to another directory and do the image covert there to leave the original ones available for the Mac/pc build but there doesn't appear to be any way to direct a specific build type to a specific folder anyway so that wouldn't work. It seems like the custom build tasks are an all-or-nothing type system.

Is there any way to achieve what I want with this tool?

@kobaltcore
Copy link
Owner

Not at the moment, unfortunately. RenKit is supposed to be a rebuild of the existing Python tools and as part of that development I have plans to support more flexible custom tasks, either via shell script or via custom Python scripts that can be called at varying stages in the build process. Those are currently not implemented but are on my docket as far as new features go.

Once implemented they will likely receive state information, such as what build is currently being attempted, so that would end up supporting this use case.

@kobaltcore
Copy link
Owner

In case you want to accomplish this right now, you could probably cheeze it by simply running renconstruct twice with two config files. The first would do all the regular builds. Then you process your images. Then you run it again with a second config which only does the Android builds. That way you can do whatever you want in between runs and since Android goes last, you don't have to worry about state corruption.

@darkplayground
Copy link
Author

This is the problem I'm having right now with your proposed solution of running renconstruct twice. It nukes the output directory between runs so I'd have to duplicate my upload logic between the runs which is not very dry:

https://github.com/kobaltcore/renkit/blob/a587ceb7ed66f614b6dd3a131b5a305a7e7a4492/src/renconstruct.nim#L150

Maybe having this as a config options would be helpful?

@kobaltcore
Copy link
Owner

Yeah, that would make sense. I'll add a switch that disables the directory re-creation so it can be reused. I think I might actually make that the default since intuitively you would likely expect it to just create the directory if it doesn't exist but just use it as-is when it has already been created beforehand.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants