You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to provide a way to customize Pakku's behaviour when exporting.
Pakku is designed to support scripting under the hood through its API.
The main aspects that will be scriptable are Export Profiles and Export Rules. See #18.
Implementation
For the scripting, we will use Kotlin Scripting with a custom scripting host packaged into Pakku and a script definition which would import the Pakku API by default.
The extension of Pakku scripts will be: .pakku.kts.
These scripts will be either read from the Pakku directory (.pakku/) or a custom-defined directory using the config file.
Example usage of scripting:
exportProfile(name ="modlist") {
ExportRule {
val modListModel =ModListModel()
when (it)
{
isExportingProject-> it.exportToModList(modListModel)
isFinished-> it.createJsonFile(modListModel, "overrides", "modlist.json")
else-> it.ignore()
}
}
}
fun ExportingProject.exportToModList(modListModel:ModListModel) =
ruleResult(message ="exporting $project to modlist", Packaging.Action {
modListModel.mods.add(project)
null// Return no error
})
data classModListModel(valmods:MutableList<Project> = mutableListOf())
Other
The question is whether and how other aspects of Pakku should be scriptable.
Suggestions and possible implementation ideas are very welcomed.
The text was updated successfully, but these errors were encountered:
Scripting
The idea is to provide a way to customize Pakku's behaviour when exporting.
Pakku is designed to support scripting under the hood through its API.
The main aspects that will be scriptable are Export Profiles and Export Rules. See #18.
Implementation
For the scripting, we will use Kotlin Scripting with a custom scripting host packaged into Pakku and a script definition which would import the Pakku API by default.
The extension of Pakku scripts will be:
.pakku.kts
.These scripts will be either read from the Pakku directory (
.pakku/
) or a custom-defined directory using the config file.Example usage of scripting:
Other
The question is whether and how other aspects of Pakku should be scriptable.
Suggestions and possible implementation ideas are very welcomed.
The text was updated successfully, but these errors were encountered: