Changeset 49
- Timestamp:
- 06/24/08 15:39:16 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
axdt/trunk/org.axdt.flex3sdk/META-INF/MANIFEST.MF
r47 r49 9 9 org.axdt.as3, 10 10 org.eclipse.core.resources, 11 org.eclipse.imp.runtime 11 org.eclipse.imp.runtime, 12 org.eclipse.ui.console, 13 org.eclipse.ui 12 14 Eclipse-LazyStart: true 13 15 Bundle-ClassPath: flexsdk/lib/asc.jar, axdt/trunk/org.axdt.flex3sdk/src/org/axdt/flex3sdk/Flex3Compiler.java
r47 r49 8 8 import org.axdt.as3.compiler.AS3CompilerTarget; 9 9 import org.axdt.as3.compiler.IAS3Compiler; 10 import org.axdt.as3.imp.preferences.AS3PreferencesConstants; 10 11 import org.eclipse.core.runtime.IProgressMonitor; 11 12 import org.eclipse.core.runtime.Path; 12 13 import org.eclipse.core.runtime.SubProgressMonitor; 14 import org.eclipse.imp.preferences.PreferencesService; 13 15 14 16 import flex2.tools.oem.Application; 15 17 import flex2.tools.oem.Configuration; 16 import flex2.tools.oem.Logger;17 import flex2.tools.oem.Message;18 18 import flex2.tools.oem.ProgressMeter; 19 19 20 public class Flex3Compiler implements Logger,IAS3Compiler {20 public class Flex3Compiler implements IAS3Compiler { 21 21 22 22 public Flex3Compiler() { … … 30 30 app = createApplication(target); 31 31 app.getConfiguration().optimize(true); 32 app.setLogger(this);33 32 target.setContext(app); 34 33 } … … 37 36 parentFile.mkdir(); 38 37 } 38 long status = 0; 39 Flex3Console logger = Flex3Console.getDefault(); 40 app.setLogger(logger); 39 41 app.setProgressMeter(new ProgressMonitor(monitor,target.getDeployName())); 40 long status = app.build(true); 42 logger.append("compiling "+ target.getDeployFile().lastSegment()); 43 status = app.build(true); 41 44 app.setProgressMeter(null); 42 return status !=0;45 return status > 0; 43 46 } 44 47 45 46 48 private Application createApplication(AS3CompilerTarget target) throws FileNotFoundException { 47 49 Application app = new Application(target.getFile()); … … 49 51 app.setOutput(file); 50 52 Configuration config = app.getDefaultConfiguration(); 51 Path path = new Path("flexsdk/frameworks/flex-config.xml"); 52 URL configURL = Flex3SDKPlugin.getBundleURL(path); 53 File confFile = new File(configURL.getPath()); 54 config.setConfiguration(confFile); 53 config.setConfiguration(getConfigFile(target)); 55 54 File[] sourcePaths = target.getSourcePaths(); 56 55 config.addSourcePath(sourcePaths); … … 60 59 } 61 60 62 public void log(Message msg, int arg1, String arg2) { 63 // if (!msg.getLevel().equals(Message.INFO)) 64 AS3Plugin.getInstance().writeInfoMsg(msg.toString()); 61 private File getConfigFile(AS3CompilerTarget target) { 62 PreferencesService preferences = AS3Plugin.getPreferencesService(); 63 boolean usedefault = preferences.getBooleanPreference(target.getProject(), AS3PreferencesConstants.P_USEDEFAULTFLEXCONFIG); 64 String spath = null; 65 if (!usedefault) { 66 spath = preferences.getStringPreference(target.getProject(), AS3PreferencesConstants.P_FLEXCONFIG); 67 } else { 68 Path path = new Path("flexsdk/frameworks/flex-config.xml"); 69 URL configURL = Flex3SDKPlugin.getBundleURL(path); 70 spath = configURL.getPath(); 71 } 72 return new File(spath); 65 73 } 66 74 67 75 public static class ProgressMonitor extends SubProgressMonitor implements ProgressMeter { 68 76
