|
13 | 13 |
|
14 | 14 | public class ToolSystem {
|
15 | 15 |
|
16 |
| - private String host; |
17 |
| - private String archiveFileName; |
18 |
| - private String url; |
19 |
| - private String checksum; |
20 |
| - private String size; |
| 16 | + private String host; |
| 17 | + private String archiveFileName; |
| 18 | + private String url; |
| 19 | + private String checksum; |
| 20 | + private String size; |
21 | 21 |
|
22 |
| - private transient Tool tool; |
| 22 | + private transient Tool tool; |
23 | 23 |
|
24 |
| - public void setOwner(Tool tool) { |
25 |
| - this.tool = tool; |
26 |
| - } |
| 24 | + public void setOwner(Tool tool) { |
| 25 | + this.tool = tool; |
| 26 | + } |
27 | 27 |
|
28 |
| - public String getHost() { |
29 |
| - return this.host; |
30 |
| - } |
| 28 | + public String getHost() { |
| 29 | + return this.host; |
| 30 | + } |
31 | 31 |
|
32 |
| - public String getArchiveFileName() { |
33 |
| - return this.archiveFileName; |
34 |
| - } |
| 32 | + public String getArchiveFileName() { |
| 33 | + return this.archiveFileName; |
| 34 | + } |
35 | 35 |
|
36 |
| - public String getUrl() { |
37 |
| - return this.url; |
38 |
| - } |
| 36 | + public String getUrl() { |
| 37 | + return this.url; |
| 38 | + } |
39 | 39 |
|
40 |
| - public String getChecksum() { |
41 |
| - return this.checksum; |
42 |
| - } |
| 40 | + public String getChecksum() { |
| 41 | + return this.checksum; |
| 42 | + } |
43 | 43 |
|
44 |
| - public String getSize() { |
45 |
| - return this.size; |
46 |
| - } |
| 44 | + public String getSize() { |
| 45 | + return this.size; |
| 46 | + } |
47 | 47 |
|
48 |
| - public boolean isApplicable() { |
49 |
| - switch (Platform.getOS()) { |
50 |
| - case Platform.OS_WIN32: |
51 |
| - return "i686-mingw32".equals(this.host); //$NON-NLS-1$ |
52 |
| - case Platform.OS_MACOSX: |
53 |
| - switch (this.host) { |
54 |
| - case "i386-apple-darwin11": //$NON-NLS-1$ |
55 |
| - case "x86_64-apple-darwin": //$NON-NLS-1$ |
56 |
| - case "x86_64-apple-darwin12": //$NON-NLS-1$ |
57 |
| - case "x86_64-apple-darwin14": //$NON-NLS-1$ |
58 |
| - return true; |
59 |
| - default: |
60 |
| - return false; |
61 |
| - } |
62 |
| - case Platform.OS_LINUX: |
63 |
| - switch (Platform.getOSArch()) { |
64 |
| - case Platform.ARCH_X86_64: |
65 |
| - return "x86_64-linux-gnu".equals(this.host) || "x86_64-pc-linux-gnu".equals(this.host); //$NON-NLS-1$ //$NON-NLS-2$ |
66 |
| - case Platform.ARCH_X86: |
67 |
| - return "i686-linux-gnu".equals(this.host) || "i686-pc-linux-gnu".equals(this.host); //$NON-NLS-1$ //$NON-NLS-2$ |
68 |
| - default: |
69 |
| - return false; |
70 |
| - } |
71 |
| - default: |
72 |
| - return false; |
| 48 | + public boolean isApplicable() { |
| 49 | + switch (Platform.getOS()) { |
| 50 | + case Platform.OS_WIN32: |
| 51 | + return "i686-mingw32".equals(this.host); //$NON-NLS-1$ |
| 52 | + case Platform.OS_MACOSX: |
| 53 | + switch (this.host) { |
| 54 | + case "i386-apple-darwin11": //$NON-NLS-1$ |
| 55 | + case "x86_64-apple-darwin": //$NON-NLS-1$ |
| 56 | + case "x86_64-apple-darwin12": //$NON-NLS-1$ |
| 57 | + case "x86_64-apple-darwin14": //$NON-NLS-1$ |
| 58 | + return true; |
| 59 | + default: |
| 60 | + return false; |
| 61 | + } |
| 62 | + case Platform.OS_LINUX: |
| 63 | + switch (Platform.getOSArch()) { |
| 64 | + case Platform.ARCH_X86_64: |
| 65 | + return "x86_64-linux-gnu".equals(this.host) || "x86_64-pc-linux-gnu".equals(this.host); //$NON-NLS-1$ //$NON-NLS-2$ |
| 66 | + case Platform.ARCH_X86: |
| 67 | + return "i686-linux-gnu".equals(this.host) || "i686-pc-linux-gnu".equals(this.host); //$NON-NLS-1$ //$NON-NLS-2$ |
| 68 | + default: |
| 69 | + return false; |
| 70 | + } |
| 71 | + default: |
| 72 | + return false; |
| 73 | + } |
73 | 74 | }
|
74 |
| - } |
75 | 75 |
|
76 |
| - public IStatus install(IProgressMonitor monitor) { |
77 |
| - return InternalPackageManager.downloadAndInstall(this.url, this.archiveFileName, this.tool.getInstallPath(), false, monitor); |
78 |
| - } |
| 76 | + public IStatus install(IProgressMonitor monitor) { |
| 77 | + return InternalPackageManager.downloadAndInstall(this.url, this.archiveFileName, this.tool.getInstallPath(), |
| 78 | + false, monitor); |
| 79 | + } |
79 | 80 |
|
80 | 81 | }
|
0 commit comments