|
8 | 8 |
|
9 | 9 | public interface IBuildToolManager {
|
10 | 10 |
|
11 |
| - public enum ToolType { |
12 |
| - A_TO_O, CPP_TO_O, C_TO_O, O_TO_C_DYNAMIC_LIB, O_TO_CPP_DYNAMIC_LIB, O_TO_ARCHIVE, O_TO_C_EXE, O_TO_CPP_EXE; |
13 |
| - |
14 |
| - @SuppressWarnings("nls") |
15 |
| - public static ToolType getToolType(String toolTypeName) { |
16 |
| - try { |
17 |
| - if (valueOf(toolTypeName) != null) { |
18 |
| - return valueOf(toolTypeName); |
19 |
| - } |
20 |
| - } catch (@SuppressWarnings("unused") Exception e) { |
21 |
| - //nothing to log here |
22 |
| - } |
23 |
| - switch (toolTypeName) { |
24 |
| - case "a->a.o": |
25 |
| - return A_TO_O; |
26 |
| - case "cpp->cpp.o": |
27 |
| - return CPP_TO_O; |
28 |
| - case "c->c.o": |
29 |
| - return C_TO_O; |
30 |
| - case "c.o->so/dll": |
31 |
| - return O_TO_C_DYNAMIC_LIB; |
32 |
| - case "cpp.o->so/dll": |
33 |
| - return O_TO_CPP_DYNAMIC_LIB; |
34 |
| - case "o->ar": |
35 |
| - return O_TO_ARCHIVE; |
36 |
| - case "c.o->exe": |
37 |
| - return O_TO_C_EXE; |
38 |
| - case "cpp.o->exe": |
39 |
| - return O_TO_CPP_EXE; |
| 11 | + public enum ToolType { |
| 12 | + A_TO_O, CPP_TO_O, C_TO_O, O_TO_C_DYNAMIC_LIB, O_TO_CPP_DYNAMIC_LIB, O_TO_ARCHIVE, O_TO_C_EXE, O_TO_CPP_EXE; |
| 13 | + |
| 14 | + @SuppressWarnings("nls") |
| 15 | + public static ToolType getToolType(String toolTypeName) { |
| 16 | + try { |
| 17 | + if (valueOf(toolTypeName) != null) { |
| 18 | + return valueOf(toolTypeName); |
| 19 | + } |
| 20 | + } catch (@SuppressWarnings("unused") Exception e) { |
| 21 | + // nothing to log here |
| 22 | + } |
| 23 | + switch (toolTypeName) { |
| 24 | + case "a->a.o": |
| 25 | + return A_TO_O; |
| 26 | + case "cpp->cpp.o": |
| 27 | + return CPP_TO_O; |
| 28 | + case "c->c.o": |
| 29 | + return C_TO_O; |
| 30 | + case "c.o->so/dll": |
| 31 | + return O_TO_C_DYNAMIC_LIB; |
| 32 | + case "cpp.o->so/dll": |
| 33 | + return O_TO_CPP_DYNAMIC_LIB; |
| 34 | + case "o->ar": |
| 35 | + return O_TO_ARCHIVE; |
| 36 | + case "c.o->exe": |
| 37 | + return O_TO_C_EXE; |
| 38 | + case "cpp.o->exe": |
| 39 | + return O_TO_CPP_EXE; |
40 | 40 | default:
|
41 | 41 | break;
|
42 |
| - } |
43 |
| - return null; |
44 |
| - } |
| 42 | + } |
| 43 | + return null; |
| 44 | + } |
45 | 45 |
|
46 | 46 | public boolean isForLanguage(String languageId) {
|
47 |
| - if(LANGUAGEID_ASSEMBLY.equals(languageId)) { |
48 |
| - switch(this) { |
| 47 | + if (LANGUAGEID_ASSEMBLY.equals(languageId)) { |
| 48 | + switch (this) { |
49 | 49 | case A_TO_O:
|
50 | 50 | return true;
|
51 |
| - default: |
52 |
| - return false; |
| 51 | + default: |
| 52 | + return false; |
53 | 53 | }
|
54 | 54 | }
|
55 |
| - if(LANGUAGEID_C.equals(languageId)) { |
56 |
| - switch(this) { |
57 |
| - case C_TO_O:case O_TO_C_DYNAMIC_LIB:case O_TO_C_EXE: |
| 55 | + if (LANGUAGEID_C.equals(languageId)) { |
| 56 | + switch (this) { |
| 57 | + case C_TO_O: |
| 58 | + case O_TO_C_DYNAMIC_LIB: |
| 59 | + case O_TO_C_EXE: |
58 | 60 | return true;
|
59 |
| - default: |
60 |
| - return false; |
| 61 | + default: |
| 62 | + return false; |
61 | 63 | }
|
62 | 64 | }
|
63 |
| - if(LANGUAGEID_CPP.equals(languageId)) { |
64 |
| - switch(this) { |
65 |
| - case CPP_TO_O:case O_TO_CPP_DYNAMIC_LIB:case O_TO_CPP_EXE:case O_TO_ARCHIVE: |
| 65 | + if (LANGUAGEID_CPP.equals(languageId)) { |
| 66 | + switch (this) { |
| 67 | + case CPP_TO_O: |
| 68 | + case O_TO_CPP_DYNAMIC_LIB: |
| 69 | + case O_TO_CPP_EXE: |
| 70 | + case O_TO_ARCHIVE: |
66 | 71 | return true;
|
67 |
| - default: |
68 |
| - return false; |
| 72 | + default: |
| 73 | + return false; |
69 | 74 | }
|
70 | 75 | }
|
71 | 76 | return false;
|
72 | 77 | }
|
73 |
| - } |
74 |
| - |
75 |
| - public enum ToolFlavour { |
76 |
| - GNU, CYGWIN, MINGW, MVC, MAC_OS, GCC, LLVM; |
77 |
| - |
78 |
| - } |
79 |
| - |
80 |
| - /** |
81 |
| - * There should only be one BuildToolManger. |
82 |
| - * Use this static method to get the BuildToolManager |
83 |
| - * |
84 |
| - * @return |
85 |
| - */ |
86 |
| - public static IBuildToolManager getDefault() { |
87 |
| - return io.sloeber.buildTool.internal.BuildToolManager.getDefault(); |
88 |
| - } |
89 |
| - |
90 |
| - public String getDefaultCommand(ToolFlavour toolFlavour, ToolType toolType); |
91 |
| - |
92 |
| - /** |
93 |
| - * Get the tool provider associated with the provided tool provider ID |
94 |
| - * @param toolProviderID |
95 |
| - * @return The tool Provider associated with the tool provider ID or null if no such provider is found |
96 |
| - */ |
97 |
| - public IBuildToolProvider getToolProvider(String toolProviderID); |
98 |
| - /** |
99 |
| - * Given the tool provider and the build tool ID return the build tools |
100 |
| - * @param toolProviderID |
101 |
| - * @param buildToolsID |
102 |
| - * @return the buildTools or null if not found |
103 |
| - */ |
104 |
| - public IBuildTools getBuildTools(String toolProviderID,String buildToolsID); |
105 |
| - |
106 |
| - /** |
107 |
| - * get all installed targetTools |
108 |
| - * Doesn't matter which tool provider |
109 |
| - * |
110 |
| - * |
111 |
| - * @return a tool |
112 |
| - */ |
113 |
| - public Set<IBuildTools> getAllInstalledTargetTools(); |
114 |
| - |
115 |
| - /** |
116 |
| - * get a build tools that is compatible with the given |
117 |
| - * projectType |
118 |
| - * Doesn't matter which tool provider |
119 |
| - * |
120 |
| - * |
121 |
| - * @return a build tools |
122 |
| - */ |
123 |
| - public IBuildTools getAnyInstalledBuildTools(IProjectType projectType); |
124 |
| - |
125 |
| - /** |
126 |
| - * Get all the build tool providers known to the |
127 |
| - * Build tool Manager |
128 |
| - * |
129 |
| - * @param onlyHoldsTools if true only return the providers that have actually |
130 |
| - * installed tools |
131 |
| - * if false return all known tool providers |
132 |
| - * |
133 |
| - * @return a set of IBuildToolProvider |
134 |
| - */ |
| 78 | + } |
| 79 | + |
| 80 | + public enum ToolFlavour { |
| 81 | + GNU, CYGWIN, MINGW, MVC, MAC_OS, GCC, LLVM; |
| 82 | + |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * There should only be one BuildToolManger. Use this static method to get the |
| 87 | + * BuildToolManager |
| 88 | + * |
| 89 | + * @return |
| 90 | + */ |
| 91 | + public static IBuildToolManager getDefault() { |
| 92 | + return io.sloeber.buildTool.internal.BuildToolManager.getDefault(); |
| 93 | + } |
| 94 | + |
| 95 | + public String getDefaultCommand(ToolFlavour toolFlavour, ToolType toolType); |
| 96 | + |
| 97 | + /** |
| 98 | + * Get the tool provider associated with the provided tool provider ID |
| 99 | + * |
| 100 | + * @param toolProviderID |
| 101 | + * @return The tool Provider associated with the tool provider ID or null if no |
| 102 | + * such provider is found |
| 103 | + */ |
| 104 | + public IBuildToolProvider getToolProvider(String toolProviderID); |
| 105 | + |
| 106 | + /** |
| 107 | + * Given the tool provider and the build tool ID return the build tools |
| 108 | + * |
| 109 | + * @param toolProviderID |
| 110 | + * @param buildToolsID |
| 111 | + * @return the buildTools or null if not found |
| 112 | + */ |
| 113 | + public IBuildTools getBuildTools(String toolProviderID, String buildToolsID); |
| 114 | + |
| 115 | + /** |
| 116 | + * get all installed targetTools Doesn't matter which tool provider |
| 117 | + * |
| 118 | + * |
| 119 | + * @return a tool |
| 120 | + */ |
| 121 | + public Set<IBuildTools> getAllInstalledTargetTools(); |
| 122 | + |
| 123 | + /** |
| 124 | + * get a build tools that is compatible with the given projectType Doesn't |
| 125 | + * matter which tool provider |
| 126 | + * |
| 127 | + * |
| 128 | + * @return a build tools |
| 129 | + */ |
| 130 | + public IBuildTools getAnyInstalledBuildTools(IProjectType projectType); |
| 131 | + |
| 132 | + /** |
| 133 | + * Get all the build tool providers known to the Build tool Manager |
| 134 | + * |
| 135 | + * @param onlyHoldsTools if true only return the providers that have actually |
| 136 | + * installed tools if false return all known tool |
| 137 | + * providers |
| 138 | + * |
| 139 | + * @return a set of IBuildToolProvider |
| 140 | + */ |
135 | 141 | public Set<IBuildToolProvider> GetToolProviders(boolean onlyHoldsTools);
|
136 | 142 |
|
137 | 143 | /**
|
138 |
| - * refresh the toolchains known. |
139 |
| - * The manager caches the toolchains. |
140 |
| - * When this method is called the cache needs to be refreshed. |
| 144 | + * refresh the toolchains known. The manager caches the toolchains. When this |
| 145 | + * method is called the cache needs to be refreshed. |
| 146 | + * Also recalculates the make availability. |
141 | 147 | *
|
142 | 148 | */
|
143 | 149 | public void refreshToolchains();
|
144 | 150 |
|
145 |
| - |
146 | 151 | public IBuildToolProvider GetToolProviderByName(String toolProviderName);
|
| 152 | + |
147 | 153 | }
|
0 commit comments