
2008 JavaOne
SM
Conference | java.sun.com/javaone |
35
Creating a Library (SWC) from Java Technology
Library lib=new Library(); // Create the Library.
lib.setOutput(new File(assetRoot, "MyComponents.swc"));
lib.addComponent(new File(assetRoot, "MyButton.mxml"));
lib.addComponent(new File(assetRoot, "MyLabel.mxml"));
lib.setLogger(new ComplexLogger());
// Add the new SWC file to the library-path.
Configuration config = app.getDefaultConfiguration();
config.addLibraryPath(new File[]
{new File(assetRoot, "MyComponents.swc")});
app.setConfiguration(config);
// Add Application and Library objects to the Project.
project.addBuilder(app);
project.addBuilder(lib);
project.dependsOn(app, lib);
project.build(true); // finally do the custom build from Java
}
Commenti su questo manuale