Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/sdk/DirectoryBasedDartSdk.java

Issue 73603002: Warn user if DART_SDK does not match editor SDK (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 private static final String BIN_DIRECTORY_NAME = "bin"; //$NON-NLS-1$ 76 private static final String BIN_DIRECTORY_NAME = "bin"; //$NON-NLS-1$
77 77
78 /** 78 /**
79 * The name of the directory within the SDK directory that contains Chromium. 79 * The name of the directory within the SDK directory that contains Chromium.
80 */ 80 */
81 private static final String CHROMIUM_DIRECTORY_NAME = "chromium"; //$NON-NLS-1 $ 81 private static final String CHROMIUM_DIRECTORY_NAME = "chromium"; //$NON-NLS-1 $
82 82
83 /** 83 /**
84 * The name of the environment variable whose value is the path to the default Dart SDK directory. 84 * The name of the environment variable whose value is the path to the default Dart SDK directory.
85 */ 85 */
86 private static final String DART_SDK_ENVIRONMENT_VARIABLE_NAME = "DART_SDK"; / /$NON-NLS-1$ 86 public static final String DART_SDK_ENVIRONMENT_VARIABLE_NAME = "DART_SDK"; // $NON-NLS-1$
87 87
88 /** 88 /**
89 * The name of the file containing the Dartium executable on Linux. 89 * The name of the file containing the Dartium executable on Linux.
90 */ 90 */
91 private static final String DARTIUM_EXECUTABLE_NAME_LINUX = "chrome"; //$NON-N LS-1$ 91 private static final String DARTIUM_EXECUTABLE_NAME_LINUX = "chrome"; //$NON-N LS-1$
92 92
93 /** 93 /**
94 * The name of the file containing the Dartium executable on Macintosh. 94 * The name of the file containing the Dartium executable on Macintosh.
95 */ 95 */
96 private static final String DARTIUM_EXECUTABLE_NAME_MAC = "Chromium.app/Conten ts/MacOS/Chromium"; //$NON-NLS-1$ 96 private static final String DARTIUM_EXECUTABLE_NAME_MAC = "Chromium.app/Conten ts/MacOS/Chromium"; //$NON-NLS-1$
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 */ 166 */
167 public static DirectoryBasedDartSdk getDefaultSdk() { 167 public static DirectoryBasedDartSdk getDefaultSdk() {
168 File sdkDirectory = getDefaultSdkDirectory(); 168 File sdkDirectory = getDefaultSdkDirectory();
169 if (sdkDirectory == null) { 169 if (sdkDirectory == null) {
170 return null; 170 return null;
171 } 171 }
172 return new DirectoryBasedDartSdk(sdkDirectory); 172 return new DirectoryBasedDartSdk(sdkDirectory);
173 } 173 }
174 174
175 /** 175 /**
176 * Return the default Dart SDK, or {@code null} if the directory containing th e default SDK cannot
177 * be determined (or does not exist).
178 * <p>
179 * Added in order to test AnalysisContextImpl2.
180 *
181 * @return the default Dart SDK
182 */
183 public static DirectoryBasedDartSdk getDefaultSdk2() {
184 File sdkDirectory = getDefaultSdkDirectory();
185 if (sdkDirectory == null) {
186 return null;
187 }
188 return new DirectoryBasedDartSdk(sdkDirectory, true);
189 }
190
191 /**
192 * Return the default directory for the Dart SDK, or {@code null} if the direc tory cannot be 176 * Return the default directory for the Dart SDK, or {@code null} if the direc tory cannot be
193 * determined (or does not exist). The default directory is provided by a {@li nk System} property 177 * determined (or does not exist). The default directory is provided by a {@li nk System} property
194 * named {@code com.google.dart.sdk}, or, if the property is not defined, an e nvironment variable 178 * named {@code com.google.dart.sdk}, or, if the property is not defined, an e nvironment variable
195 * named {@code DART_SDK}. 179 * named {@code DART_SDK}.
196 * 180 *
197 * @return the default directory for the Dart SDK 181 * @return the default directory for the Dart SDK
198 */ 182 */
199 public static File getDefaultSdkDirectory() { 183 public static File getDefaultSdkDirectory() {
200 String sdkProperty = System.getProperty(DEFAULT_DIRECTORY_PROPERTY_NAME); 184 String sdkProperty = System.getProperty(DEFAULT_DIRECTORY_PROPERTY_NAME);
201 if (sdkProperty == null) { 185 if (sdkProperty == null) {
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 482
499 /** 483 /**
500 * Initialize the state of the SDK. 484 * Initialize the state of the SDK.
501 */ 485 */
502 private void initializeSdk() { 486 private void initializeSdk() {
503 if (!OSUtilities.isWindows()) { 487 if (!OSUtilities.isWindows()) {
504 ensureVmIsExecutable(); 488 ensureVmIsExecutable();
505 } 489 }
506 } 490 }
507 } 491 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698