Is there anything I could do to programmatically update project’s script library?
It’d be used in a module build script to automatically re-generate any java-to-python bindings for
the module and it would reduce significant amount of manual work.
Serialize it, and update the ProjectResource to include it.
I threw together some pseudocode to do this.
[code] for (Project project : context.getProjectManager().getProjectsFull(ProjectVersion.Staging)) {
for (ProjectResource resource : project.getResourcesOfType("", “sr.script.library”)) {
// Grab the scriptLibraries
List scriptLibraries = new ArrayList();
for (Object o : context.createDeserializer().deserialize(resource.getData()).getRootObjects()) {
if (o instanceof ScriptLibrary) {
scriptLibraries.add((ScriptLibrary) o);
}
}
// TODO: Modification code
// Re-serialize them, and add them back to the project
}
}[/code]
I don’t know if the ProjectResource actually has more than one ScriptLibrary living in it.
It appears the GatewayContext doesnt have a context.createSerializer() though.
IA guys, is there any way to serialize from the gateway?