Changeset 126
- Timestamp:
- 08/09/08 22:36:30 (5 months ago)
- Files:
-
- axdt/trunk/org.axdt.as3/src/org/axdt/as3/compiler/AS3CompilerTarget.java (modified) (3 diffs)
- axdt/trunk/org.axdt.as3/src/org/axdt/as3/preferences/AS3Preferences.java (modified) (3 diffs)
- axdt/trunk/org.axdt.common/src/org/axdt/compiler/AxdtCompilerTarget.java (modified) (4 diffs)
- axdt/trunk/org.axdt.flex3sdk.compiler/src/org/axdt/flex3sdk/Flex3Compiler.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
axdt/trunk/org.axdt.as3/src/org/axdt/as3/compiler/AS3CompilerTarget.java
r92 r126 1 1 package org.axdt.as3.compiler; 2 3 import java.util.ArrayList; 2 4 3 5 import org.axdt.as3.preferences.AS3Preferences; … … 5 7 import org.eclipse.core.resources.IContainer; 6 8 import org.eclipse.core.resources.IResource; 9 import org.eclipse.core.runtime.CoreException; 7 10 import org.eclipse.core.runtime.IPath; 8 11 … … 22 25 public IPath[] getSourceLocations() { 23 26 IContainer[] sourcePaths = AS3Preferences.getSourcePaths(resource); 24 IPath[] paths = new IPath[sourcePaths.length]; 25 for (int i = 0; i < sourcePaths.length; i++) { 26 paths[i] = sourcePaths[i].getLocation(); 27 return getResourceLocations(sourcePaths); 28 } 29 30 @Override 31 public IPath[] getLibraryLocations() { 32 IContainer[] libraryPaths = AS3Preferences.getLibraryPaths(resource); 33 ArrayList<IResource> list = new ArrayList<IResource>(); 34 for (IContainer lib:libraryPaths) { 35 if (lib != null && lib.exists()) { 36 try { 37 for (IResource member:lib.members()) { 38 if ("swc".equals(member.getFileExtension())) { 39 list.add(member); 40 } 41 } 42 } catch (CoreException e) { 43 e.printStackTrace(); 44 } 45 } 27 46 } 28 return paths; 47 IResource[] array = list.toArray(new IResource[list.size()]); 48 return getResourceLocations(array); 29 49 } 30 50 } axdt/trunk/org.axdt.as3/src/org/axdt/as3/preferences/AS3Preferences.java
r113 r126 12 12 13 13 public final static String SOURCE_PATHS = "SOURCE_PATHS"; 14 public final static String LIBRARY_PATHS = "LIBRARY_PATHS"; 14 15 public final static String DEPLOY_PATH = "DEPLOY_PATH"; 15 16 public final static String TAB_TO_SPACE = "TAB_TO_SPACE"; 16 17 public final static String TAB_WIDTH = "TAB_WIDTH"; 17 public static finalString CLOSE_STRINGS = "CLOSE_STRINGS";18 public static finalString CLOSE_BRACKETS = "CLOSE_BRACKETS";19 public static finalString CLOSE_BRACES = "CLOSE_BRACES";18 public final static String CLOSE_STRINGS = "CLOSE_STRINGS"; 19 public final static String CLOSE_BRACKETS = "CLOSE_BRACKETS"; 20 public final static String CLOSE_BRACES = "CLOSE_BRACES"; 20 21 public final static String DELETE_PAIR = "DELETE_PAIR"; 21 22 public final static String USE_FOLDING = "USE_FOLDING"; … … 46 47 add(SOURCE_PATHS, "Source &paths", "src"); 47 48 add(DEPLOY_PATH, "&Deploy path", "deploy"); 49 add(LIBRARY_PATHS, "Library &paths", "lib"); 48 50 add(TAB_TO_SPACE, "Convert &tabs", false); 49 51 add(TAB_WIDTH, "to number of spa&ces", 4); 50 52 addGroup("Automatically close", ""); 51 53 add(CLOSE_STRINGS, "\"&Strings\"", true); 52 add(CLOSE_BRACKETS, "(Parentheses) and [ &Brackets]", true);54 add(CLOSE_BRACKETS, "(Parentheses) and [Brac&kets]", true); 53 55 add(CLOSE_BRACES, "{&Braces} on newline", true); 54 56 endGroup(); … … 84 86 return store.getString(AS3Preferences.DEPLOY_PATH); 85 87 } 88 89 public static IContainer[] getLibraryPaths(IResource res) { 90 IPreferenceStore store = getInstance().getProjectStore(res); 91 String sourcePaths = store.getString(AS3Preferences.LIBRARY_PATHS); 92 String[] split = sourcePaths.split("[,; ]"); 93 IContainer[] paths = new IContainer[split.length]; 94 for (int i = 0; i < split.length; i++) { 95 paths[i] = res.getProject().getFolder(split[i]); 96 } 97 return paths; 98 } 86 99 } axdt/trunk/org.axdt.common/src/org/axdt/compiler/AxdtCompilerTarget.java
r92 r126 39 39 * clients should implement this method 40 40 * 41 * @return 41 * @return a path to the deploy folder 42 42 */ 43 43 public IPath getDeployLocation() { … … 48 48 * clients should implement this 49 49 * 50 * @return a file array containing all source folder for50 * @return a path array containing all source folders 51 51 */ 52 52 public IPath[] getSourceLocations() { … … 54 54 } 55 55 56 /** 57 * clients should implement this 58 * 59 * @return a path array containing all library folders and files 60 */ 61 public IPath[] getLibraryLocations() { 62 return new IPath[] {getProject().getLocation()}; 63 } 64 56 65 public File[] getSourceFolders() { 57 66 IPath[] paths = getSourceLocations(); 67 File[] files = new File[paths.length]; 68 for (int i = 0; i < paths.length; i++) { 69 files[i] = new File(paths[i].toOSString()); 70 } 71 return files; 72 } 73 74 public File[] getLibraries() { 75 IPath[] paths = getLibraryLocations(); 58 76 File[] files = new File[paths.length]; 59 77 for (int i = 0; i < paths.length; i++) { … … 94 112 return resource; 95 113 } 114 115 protected IPath[] getResourceLocations(IResource[] array) { 116 IPath[] paths = new IPath[array.length]; 117 for (int i = 0; i < array.length; i++) { 118 paths[i] = array[i].getLocation(); 119 } 120 return paths; 121 } 96 122 } axdt/trunk/org.axdt.flex3sdk.compiler/src/org/axdt/flex3sdk/Flex3Compiler.java
r92 r126 47 47 config.setConfiguration(getConfigFile(target)); 48 48 config.addSourcePath(target.getSourceFolders()); 49 config.addLibraryPath(target.getLibraries()); 49 50 config.allowSourcePathOverlap(true); 50 51 app.setConfiguration(config);
