aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/libs/sdklib/src
diff options
context:
space:
mode:
Diffstat (limited to 'sdkmanager/libs/sdklib/src')
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/ISdkLog.java85
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/NullSdkLog.java46
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java44
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/StdSdkLog.java89
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java6
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java50
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/HardwareProperties.java6
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/MakeIdentity.java4
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java12
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java6
-rwxr-xr-xsdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskMonitor.java6
-rwxr-xr-xsdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java20
-rwxr-xr-xsdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java25
-rwxr-xr-xsdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ExtraPackage.java4
-rwxr-xr-xsdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSources.java6
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java8
16 files changed, 101 insertions, 316 deletions
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/ISdkLog.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/ISdkLog.java
deleted file mode 100644
index df7d8ac..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/ISdkLog.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.sdklib;
-
-import java.util.Formatter;
-
-/**
- * Interface used to display warnings/errors while parsing the SDK content.
- * <p/>
- * There are a few default implementations available:
- * <ul>
- * <li> {@link NullSdkLog} is an implementation that does <em>nothing</em> with the log.
- * Useful for limited cases where you need to call a class that requires a non-null logging
- * yet the calling code does not have any mean of reporting logs itself. It can be
- * acceptable for use a temporary implementation but most of the time that means the caller
- * code needs to be reworked to take a logger object from its own caller.
- * </li>
- * <li> {@link StdSdkLog} is an implementation that dumps the log to {@link System#out} or
- * {@link System#err}. This is useful for unit tests or code that does not have any GUI.
- * Apps based on Eclipse or SWT should not use it and should provide a better way to report
- * to the user.
- * </li>
- * <li> ADT has a <code>AdtPlugin</code> which implements a similar interface called
- * <code>ILogger</code>, useful in case we don't want to pull the whole SdkLib.
- * </ul>
- */
-public interface ISdkLog {
-
- /**
- * Prints a warning message on stdout.
- * <p/>
- * The message will be tagged with "Warning" on the output so the caller does not
- * need to put such a prefix in the format string.
- * <p/>
- * Implementations should only display warnings in verbose mode.
- *
- * @param warningFormat is an optional error format. If non-null, it will be printed
- * using a {@link Formatter} with the provided arguments.
- * @param args provides the arguments for warningFormat.
- */
- void warning(String warningFormat, Object... args);
-
- /**
- * Prints an error message on stderr.
- * <p/>
- * The message will be tagged with "Error" on the output so the caller does not
- * need to put such a prefix in the format string.
- * <p/>
- * Implementation should always display errors, independent of verbose mode.
- *
- * @param t is an optional {@link Throwable} or {@link Exception}. If non-null, it's
- * message will be printed out.
- * @param errorFormat is an optional error format. If non-null, it will be printed
- * using a {@link Formatter} with the provided arguments.
- * @param args provides the arguments for errorFormat.
- */
- void error(Throwable t, String errorFormat, Object... args);
-
- /**
- * Prints a message on stdout.
- * This does <em>not</em> automatically end the line with \n.
- * <p/>
- * Implementation can omit printing such messages when not in verbose mode.
- * No prefix is used, the message is printed as-is after formatting.
- *
- * @param msgFormat is an optional error format. If non-null, it will be printed
- * using a {@link Formatter} with the provided arguments.
- * @param args provides the arguments for msgFormat.
- */
- void printf(String msgFormat, Object... args);
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/NullSdkLog.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/NullSdkLog.java
deleted file mode 100644
index 09f49e2..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/NullSdkLog.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.sdklib;
-
-/**
- * Dummy implementation of an {@link ISdkLog}.
- * <p/>
- * Use {@link #getLogger()} to get a default instance of this {@link NullSdkLog}.
- */
-public class NullSdkLog implements ISdkLog {
-
- private static final ISdkLog sThis = new NullSdkLog();
-
- public static ISdkLog getLogger() {
- return sThis;
- }
-
- @Override
- public void error(Throwable t, String errorFormat, Object... args) {
- // ignore
- }
-
- @Override
- public void printf(String msgFormat, Object... args) {
- // ignore
- }
-
- @Override
- public void warning(String warningFormat, Object... args) {
- // ignore
- }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java
index 766e984..0651f5a 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java
@@ -34,6 +34,8 @@ import com.android.sdklib.internal.repository.packages.ExtraPackage;
import com.android.sdklib.internal.repository.packages.Package;
import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
import com.android.sdklib.repository.PkgProps;
+import com.android.utils.ILogger;
+import com.android.utils.NullLogger;
import com.android.utils.Pair;
import java.io.File;
@@ -107,7 +109,7 @@ public class SdkManager {
/**
* Create a new {@link SdkManager} instance.
- * External users should use {@link #createManager(String, ISdkLog)}.
+ * External users should use {@link #createManager(String, ILogger)}.
*
* @param osSdkPath the location of the SDK.
*/
@@ -119,10 +121,10 @@ public class SdkManager {
/**
* Creates an {@link SdkManager} for a given sdk location.
* @param osSdkPath the location of the SDK.
- * @param log the ISdkLog object receiving warning/error from the parsing. Cannot be null.
+ * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
* @return the created {@link SdkManager} or null if the location is not valid.
*/
- public static SdkManager createManager(String osSdkPath, ISdkLog log) {
+ public static SdkManager createManager(String osSdkPath, ILogger log) {
try {
SdkManager manager = new SdkManager(osSdkPath);
manager.reloadSdk(log);
@@ -138,9 +140,9 @@ public class SdkManager {
/**
* Reloads the content of the SDK.
*
- * @param log the ISdkLog object receiving warning/error from the parsing. Cannot be null.
+ * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
*/
- public void reloadSdk(ISdkLog log) {
+ public void reloadSdk(ILogger log) {
// get the current target list.
mTargetDirs.clear();
ArrayList<IAndroidTarget> targets = new ArrayList<IAndroidTarget>();
@@ -348,7 +350,7 @@ public class SdkManager {
Package[] packages = parser.parseSdk(mOsSdkPath,
this,
LocalSdkParser.PARSE_EXTRAS,
- new NullTaskMonitor(new NullSdkLog()));
+ new NullTaskMonitor(NullLogger.getLogger()));
Map<File, String> samples = new HashMap<File, String>();
@@ -381,7 +383,7 @@ public class SdkManager {
Package[] packages = parser.parseSdk(mOsSdkPath,
this,
LocalSdkParser.PARSE_EXTRAS,
- new NullTaskMonitor(new NullSdkLog()));
+ new NullTaskMonitor(NullLogger.getLogger()));
Map<String, Integer> extraVersions = new TreeMap<String, Integer>();
@@ -403,7 +405,7 @@ public class SdkManager {
public @Nullable String getPlatformToolsVersion() {
LocalSdkParser parser = new LocalSdkParser();
Package[] packages = parser.parseSdk(mOsSdkPath, this, LocalSdkParser.PARSE_PLATFORM_TOOLS,
- new NullTaskMonitor(new NullSdkLog()));
+ new NullTaskMonitor(NullLogger.getLogger()));
for (Package pkg : packages) {
if (pkg instanceof PlatformToolPackage && pkg.isLocal()) {
@@ -424,13 +426,13 @@ public class SdkManager {
* @param sdkOsPath Location of the SDK
* @param targets the list to fill with the platforms.
* @param dirInfos a map to keep information on directories to see if they change later.
- * @param log the ISdkLog object receiving warning/error from the parsing. Cannot be null.
+ * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
* @throws RuntimeException when the "platforms" folder is missing and cannot be created.
*/
private static void loadPlatforms(
String sdkOsPath,
ArrayList<IAndroidTarget> targets,
- Map<File, DirInfo> dirInfos, ISdkLog log) {
+ Map<File, DirInfo> dirInfos, ILogger log) {
File platformFolder = new File(sdkOsPath, SdkConstants.FD_PLATFORMS);
if (platformFolder.isDirectory()) {
@@ -472,12 +474,12 @@ public class SdkManager {
* Loads a specific Platform at a given location.
* @param sdkOsPath Location of the SDK
* @param platformFolder the root folder of the platform.
- * @param log the ISdkLog object receiving warning/error from the parsing. Cannot be null.
+ * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
*/
private static PlatformTarget loadPlatform(
String sdkOsPath,
File platformFolder,
- ISdkLog log) {
+ ILogger log) {
FileWrapper buildProp = new FileWrapper(platformFolder, SdkConstants.FN_BUILD_PROP);
FileWrapper sourcePropFile = new FileWrapper(platformFolder, SdkConstants.FN_SOURCE_PROP);
@@ -764,13 +766,13 @@ public class SdkManager {
* @param osSdkPath Location of the SDK
* @param targets the list to fill with the add-ons.
* @param dirInfos a map to keep information on directories to see if they change later.
- * @param log the ISdkLog object receiving warning/error from the parsing. Cannot be null.
+ * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
* @throws RuntimeException when the "add-ons" folder is missing and cannot be created.
*/
private static void loadAddOns(
String osSdkPath,
ArrayList<IAndroidTarget> targets,
- Map<File, DirInfo> dirInfos, ISdkLog log) {
+ Map<File, DirInfo> dirInfos, ILogger log) {
File addonFolder = new File(osSdkPath, SdkConstants.FD_ADDONS);
if (addonFolder.isDirectory()) {
@@ -815,11 +817,11 @@ public class SdkManager {
* Loads a specific Add-on at a given location.
* @param addonDir the location of the add-on directory.
* @param targetList The list of Android target that were already loaded from the SDK.
- * @param log the ISdkLog object receiving warning/error from the parsing. Cannot be null.
+ * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
*/
private static AddOnTarget loadAddon(File addonDir,
IAndroidTarget[] targetList,
- ISdkLog log) {
+ ILogger log) {
// Parse the addon properties to ensure we can load it.
Pair<Map<String, String>, String> infos = parseAddonProperties(addonDir, targetList, log);
@@ -961,7 +963,7 @@ public class SdkManager {
*
* @param addonDir the location of the addon directory.
* @param targetList The list of Android target that were already loaded from the SDK.
- * @param log the ISdkLog object receiving warning/error from the parsing. Cannot be null.
+ * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
* @return A pair with the property map and an error string. Both can be null but not at the
* same time. If a non-null error is present then the property map must be ignored. The error
* should be translatable as it might show up in the SdkManager UI.
@@ -969,7 +971,7 @@ public class SdkManager {
public static Pair<Map<String, String>, String> parseAddonProperties(
File addonDir,
IAndroidTarget[] targetList,
- ISdkLog log) {
+ ILogger log) {
Map<String, String> propertyMap = null;
String error = null;
@@ -1084,7 +1086,7 @@ public class SdkManager {
* @param platform The folder containing the platform.
* @param log Logger. Cannot be null.
*/
- private static boolean checkPlatformContent(File platform, ISdkLog log) {
+ private static boolean checkPlatformContent(File platform, ILogger log) {
for (String relativePath : sPlatformContentList) {
File f = new File(platform, relativePath);
if (!f.exists()) {
@@ -1139,7 +1141,7 @@ public class SdkManager {
*
* @param log Logger. Cannot be null.
*/
- private void initializeSamplePaths(ISdkLog log) {
+ private void initializeSamplePaths(ILogger log) {
File sampleFolder = new File(mOsSdkPath, SdkConstants.FD_SAMPLES);
if (sampleFolder.isDirectory()) {
File[] platforms = sampleFolder.listFiles();
@@ -1170,7 +1172,7 @@ public class SdkManager {
* @param log Logger for errors. Cannot be null.
* @return An {@link AndroidVersion} or null on error.
*/
- private AndroidVersion getSamplesVersion(File folder, ISdkLog log) {
+ private AndroidVersion getSamplesVersion(File folder, ILogger log) {
File sourceProp = new File(folder, SdkConstants.FN_SOURCE_PROP);
try {
Properties p = new Properties();
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/StdSdkLog.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/StdSdkLog.java
deleted file mode 100644
index 84bc212..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/StdSdkLog.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.eclipse.org/org/documents/epl-v10.php
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.sdklib;
-
-import com.android.SdkConstants;
-
-
-/**
- * An implementation of {@link ISdkLog} that prints to {@link System#out} and {@link System#err}.
- * <p/>
- * This is mostly useful for unit tests. It should not be used by GUI-based tools (e.g.
- * Eclipse plugin or SWT-based apps) which should have a better way to expose their logging
- * error and warnings.
- */
-public class StdSdkLog implements ISdkLog {
-
- @Override
- public void error(Throwable t, String errorFormat, Object... args) {
- if (errorFormat != null) {
- String msg = String.format("Error: " + errorFormat, args);
-
- if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS &&
- !msg.endsWith("\r\n") &&
- msg.endsWith("\n")) {
- // remove last \n so that println can use \r\n as needed.
- msg = msg.substring(0, msg.length() - 1);
- }
-
- System.err.print(msg);
-
- if (!msg.endsWith("\n")) {
- System.err.println();
- }
- }
- if (t != null) {
- System.err.println(String.format("Error: %1$s", t.getMessage()));
- }
- }
-
- @Override
- public void warning(String warningFormat, Object... args) {
- String msg = String.format("Warning: " + warningFormat, args);
-
- if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS &&
- !msg.endsWith("\r\n") &&
- msg.endsWith("\n")) {
- // remove last \n so that println can use \r\n as needed.
- msg = msg.substring(0, msg.length() - 1);
- }
-
- System.out.print(msg);
-
- if (!msg.endsWith("\n")) {
- System.out.println();
- }
- }
-
- @Override
- public void printf(String msgFormat, Object... args) {
- String msg = String.format(msgFormat, args);
-
- if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS &&
- !msg.endsWith("\r\n") &&
- msg.endsWith("\n")) {
- // remove last \n so that println can use \r\n as needed.
- msg = msg.substring(0, msg.length() - 1);
- }
-
- System.out.print(msg);
-
- if (!msg.endsWith("\n")) {
- System.out.println();
- }
- }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java
index 9b64689..af9dee3 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java
@@ -23,10 +23,10 @@ import com.android.prefs.AndroidLocation.AndroidLocationException;
import com.android.resources.Keyboard;
import com.android.resources.KeyboardState;
import com.android.resources.Navigation;
-import com.android.sdklib.ISdkLog;
import com.android.sdklib.internal.avd.AvdManager;
import com.android.sdklib.internal.avd.HardwareProperties;
import com.android.sdklib.repository.PkgProps;
+import com.android.utils.ILogger;
import org.xml.sax.SAXException;
@@ -59,7 +59,7 @@ public class DeviceManager {
private final static String sDeviceProfilesProp = "DeviceProfiles";
private final static Pattern sPathPropertyPattern = Pattern.compile("^" + PkgProps.EXTRA_PATH
+ "=" + sDeviceProfilesProp + "$");
- private ISdkLog mLog;
+ private ILogger mLog;
// Vendor devices can't be a static list since they change based on the SDK
// Location
private List<Device> mVendorDevices;
@@ -91,7 +91,7 @@ public class DeviceManager {
// in the same application, which forces us to parse the XML multiple times
// when we don't
// to.
- public DeviceManager(ISdkLog log) {
+ public DeviceManager(ILogger log) {
mLog = log;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java
index df703da..d2ba1b6 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java
@@ -22,7 +22,6 @@ import com.android.io.FileWrapper;
import com.android.prefs.AndroidLocation;
import com.android.prefs.AndroidLocation.AndroidLocationException;
import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISdkLog;
import com.android.sdklib.ISystemImage;
import com.android.sdklib.SdkManager;
import com.android.sdklib.devices.DeviceManager;
@@ -32,6 +31,7 @@ import com.android.sdklib.internal.project.ProjectProperties;
import com.android.sdklib.util.GrabProcessOutput;
import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
import com.android.sdklib.util.GrabProcessOutput.Wait;
+import com.android.utils.ILogger;
import com.android.utils.Pair;
import java.io.File;
@@ -275,12 +275,12 @@ public class AvdManager {
* logging needs. Cannot be null.
* @throws AndroidLocationException
*/
- protected AvdManager(SdkManager sdkManager, ISdkLog log) throws AndroidLocationException {
+ protected AvdManager(SdkManager sdkManager, ILogger log) throws AndroidLocationException {
mSdkManager = sdkManager;
buildAvdList(mAllAvdList, log);
}
- public static AvdManager getInstance(SdkManager sdkManager, ISdkLog log)
+ public static AvdManager getInstance(SdkManager sdkManager, ILogger log)
throws AndroidLocationException {
synchronized(mManagers) {
AvdManager manager;
@@ -511,7 +511,7 @@ public class AvdManager {
* @throws AndroidLocationException if there was an error finding the location of the
* AVD folder.
*/
- public void reloadAvds(ISdkLog log) throws AndroidLocationException {
+ public void reloadAvds(ILogger log) throws AndroidLocationException {
// build the list in a temp list first, in case the method throws an exception.
// It's better than deleting the whole list before reading the new one.
ArrayList<AvdInfo> allList = new ArrayList<AvdInfo>();
@@ -556,7 +556,7 @@ public class AvdManager {
boolean createSnapshot,
boolean removePrevious,
boolean editExisting,
- ISdkLog log) {
+ ILogger log) {
if (log == null) {
throw new IllegalArgumentException("log cannot be null");
}
@@ -647,7 +647,7 @@ public class AvdManager {
if (createSnapshot) {
File snapshotDest = new File(avdFolder, SNAPSHOTS_IMG);
if (snapshotDest.isFile() && editExisting) {
- log.printf("Snapshot image already present, was not changed.\n");
+ log.info("Snapshot image already present, was not changed.\n");
} else {
String toolsLib = mSdkManager.getLocation() + File.separator
@@ -749,7 +749,7 @@ public class AvdManager {
// There's already an sdcard file with the right size and we're
// not overriding it... so don't remove it.
runMkSdcard = false;
- log.printf("SD Card already present with same size, was not changed.\n");
+ log.info("SD Card already present with same size, was not changed.\n");
}
}
@@ -861,7 +861,7 @@ public class AvdManager {
report.append("\n");
}
- log.printf(report.toString());
+ log.info(report.toString());
// create the AvdInfo object, and add it to the list
AvdInfo newAvdInfo = new AvdInfo(
@@ -1002,7 +1002,7 @@ public class AvdManager {
* @param target The target where to find the skin.
* @param log the log object to receive action logs. Cannot be null.
*/
- public String getSkinRelativePath(String skinName, IAndroidTarget target, ISdkLog log) {
+ public String getSkinRelativePath(String skinName, IAndroidTarget target, ILogger log) {
if (log == null) {
throw new IllegalArgumentException("log cannot be null");
}
@@ -1118,13 +1118,13 @@ public class AvdManager {
* @param log the log object to receive action logs. Cannot be null.
* @return True if the AVD was deleted with no error.
*/
- public boolean deleteAvd(AvdInfo avdInfo, ISdkLog log) {
+ public boolean deleteAvd(AvdInfo avdInfo, ILogger log) {
try {
boolean error = false;
File f = avdInfo.getIniFile();
if (f != null && f.exists()) {
- log.printf("Deleting file %1$s\n", f.getCanonicalPath());
+ log.info("Deleting file %1$s\n", f.getCanonicalPath());
if (!f.delete()) {
log.error(null, "Failed to delete %1$s\n", f.getCanonicalPath());
error = true;
@@ -1135,7 +1135,7 @@ public class AvdManager {
if (path != null) {
f = new File(path);
if (f.exists()) {
- log.printf("Deleting folder %1$s\n", f.getCanonicalPath());
+ log.info("Deleting folder %1$s\n", f.getCanonicalPath());
if (deleteContentOf(f) == false || f.delete() == false) {
log.error(null, "Failed to delete %1$s\n", f.getCanonicalPath());
error = true;
@@ -1146,10 +1146,10 @@ public class AvdManager {
removeAvd(avdInfo);
if (error) {
- log.printf("\nAVD '%1$s' deleted with errors. See errors above.\n",
+ log.info("\nAVD '%1$s' deleted with errors. See errors above.\n",
avdInfo.getName());
} else {
- log.printf("\nAVD '%1$s' deleted.\n", avdInfo.getName());
+ log.info("\nAVD '%1$s' deleted.\n", avdInfo.getName());
return true;
}
@@ -1175,7 +1175,7 @@ public class AvdManager {
* @return True if the move succeeded or there was nothing to do.
* If false, this method will have had already output error in the log.
*/
- public boolean moveAvd(AvdInfo avdInfo, String newName, String paramFolderPath, ISdkLog log) {
+ public boolean moveAvd(AvdInfo avdInfo, String newName, String paramFolderPath, ILogger log) {
try {
if (paramFolderPath != null) {
@@ -1227,7 +1227,7 @@ public class AvdManager {
replaceAvd(avdInfo, info);
}
- log.printf("AVD '%1$s' moved.\n", avdInfo.getName());
+ log.info("AVD '%1$s' moved.\n", avdInfo.getName());
} catch (AndroidLocationException e) {
log.error(e, null);
@@ -1311,7 +1311,7 @@ public class AvdManager {
*
* @throws AndroidLocationException if there's a problem getting android root directory.
*/
- private void buildAvdList(ArrayList<AvdInfo> allList, ISdkLog log)
+ private void buildAvdList(ArrayList<AvdInfo> allList, ILogger log)
throws AndroidLocationException {
File[] avds = buildAvdFilesList();
if (avds != null) {
@@ -1332,7 +1332,7 @@ public class AvdManager {
* @return A new {@link AvdInfo} with an {@link AvdStatus} indicating whether this AVD is
* valid or not.
*/
- private AvdInfo parseAvdInfo(File iniPath, ISdkLog log) {
+ private AvdInfo parseAvdInfo(File iniPath, ILogger log) {
Map<String, String> map = ProjectProperties.parsePropertyFile(
new FileWrapper(iniPath),
log);
@@ -1474,7 +1474,7 @@ public class AvdManager {
* @param log the log object to receive action logs. Cannot be null.
* @return True if the sdcard could be created.
*/
- private boolean createSdCard(String toolLocation, String size, String location, ISdkLog log) {
+ private boolean createSdCard(String toolLocation, String size, String location, ILogger log) {
try {
String[] command = new String[3];
command[0] = toolLocation;
@@ -1545,7 +1545,7 @@ public class AvdManager {
* @param log the log object to receive action logs. Cannot be null.
* @throws IOException
*/
- public void updateAvd(String name, ISdkLog log) throws IOException {
+ public void updateAvd(String name, ILogger log) throws IOException {
// find the AVD to update. It should be be in the broken list.
AvdInfo avd = null;
synchronized (mAllAvdList) {
@@ -1573,7 +1573,7 @@ public class AvdManager {
* @param log the log object to receive action logs. Cannot be null.
* @throws IOException
*/
- public void updateAvd(AvdInfo avd, ISdkLog log) throws IOException {
+ public void updateAvd(AvdInfo avd, ILogger log) throws IOException {
// get the properties. This is a unmodifiable Map.
Map<String, String> oldProperties = avd.getProperties();
@@ -1588,12 +1588,12 @@ public class AvdManager {
// create the path to the new system images.
if (setImagePathProperties(avd.getTarget(), avd.getAbiType(), properties, log)) {
if (properties.containsKey(AVD_INI_IMAGES_1)) {
- log.printf("Updated '%1$s' with value '%2$s'\n", AVD_INI_IMAGES_1,
+ log.info("Updated '%1$s' with value '%2$s'\n", AVD_INI_IMAGES_1,
properties.get(AVD_INI_IMAGES_1));
}
if (properties.containsKey(AVD_INI_IMAGES_2)) {
- log.printf("Updated '%1$s' with value '%2$s'\n", AVD_INI_IMAGES_2,
+ log.info("Updated '%1$s' with value '%2$s'\n", AVD_INI_IMAGES_2,
properties.get(AVD_INI_IMAGES_2));
}
@@ -1610,7 +1610,7 @@ public class AvdManager {
public void updateAvd(AvdInfo avd,
Map<String, String> newProperties,
AvdStatus status,
- ISdkLog log) throws IOException {
+ ILogger log) throws IOException {
// now write the config file
File configIniFile = new File(avd.getDataFolderPath(), CONFIG_INI);
writeIniFile(configIniFile, newProperties);
@@ -1644,7 +1644,7 @@ public class AvdManager {
private boolean setImagePathProperties(IAndroidTarget target,
String abiType,
Map<String, String> properties,
- ISdkLog log) {
+ ILogger log) {
properties.remove(AVD_INI_IMAGES_1);
properties.remove(AVD_INI_IMAGES_2);
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/HardwareProperties.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/HardwareProperties.java
index a7a3157..33156b4 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/HardwareProperties.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/HardwareProperties.java
@@ -16,7 +16,7 @@
package com.android.sdklib.internal.avd;
-import com.android.sdklib.ISdkLog;
+import com.android.utils.ILogger;
import java.io.BufferedReader;
import java.io.File;
@@ -153,10 +153,10 @@ public class HardwareProperties {
/**
* Parses the hardware definition file.
* @param file the property file to parse
- * @param log the ISdkLog object receiving warning/error from the parsing. Cannot be null.
+ * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
* @return the map of (key,value) pairs, or null if the parsing failed.
*/
- public static Map<String, HardwareProperty> parseHardwareDefinitions(File file, ISdkLog log) {
+ public static Map<String, HardwareProperty> parseHardwareDefinitions(File file, ILogger log) {
BufferedReader reader = null;
try {
FileInputStream fis = new FileInputStream(file);
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/MakeIdentity.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/MakeIdentity.java
index ca1605a..955a81c 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/MakeIdentity.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/MakeIdentity.java
@@ -17,7 +17,7 @@
package com.android.sdklib.internal.build;
import com.android.appauth.Certificate;
-import com.android.sdklib.ISdkLog;
+import com.android.utils.ILogger;
import java.io.FileInputStream;
import java.io.IOException;
@@ -64,7 +64,7 @@ public class MakeIdentity {
* @throws IOException
* @throws UnrecoverableEntryException
*/
- public boolean make(PrintStream ps, ISdkLog log)
+ public boolean make(PrintStream ps, ILogger log)
throws KeyStoreException, NoSuchAlgorithmException,
CertificateException, IOException, UnrecoverableEntryException {
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java
index 57e9073..8bc5d91 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java
@@ -21,9 +21,9 @@ import com.android.SdkConstants;
import com.android.io.FileWrapper;
import com.android.io.FolderWrapper;
import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISdkLog;
import com.android.sdklib.SdkManager;
import com.android.sdklib.internal.project.ProjectProperties.PropertyType;
+import com.android.utils.ILogger;
import com.android.xml.AndroidManifest;
import com.android.xml.AndroidXPathFactory;
@@ -143,7 +143,7 @@ public class ProjectCreator {
/** The {@link OutputLevel} verbosity. */
private final OutputLevel mLevel;
/** Logger for errors and output. Cannot be null. */
- private final ISdkLog mLog;
+ private final ILogger mLog;
/** The OS path of the SDK folder. */
private final String mSdkFolder;
/** The {@link SdkManager} instance. */
@@ -157,7 +157,7 @@ public class ProjectCreator {
* @param level The {@link OutputLevel} verbosity.
* @param log Logger for errors and output. Cannot be null.
*/
- public ProjectCreator(SdkManager sdkManager, String sdkFolder, OutputLevel level, ISdkLog log) {
+ public ProjectCreator(SdkManager sdkManager, String sdkFolder, OutputLevel level, ILogger log) {
mSdkManager = sdkManager;
mSdkFolder = sdkFolder;
mLevel = level;
@@ -1237,8 +1237,8 @@ public class ProjectCreator {
/**
* Prints a message unless silence is enabled.
* <p/>
- * This is just a convenience wrapper around {@link ISdkLog#printf(String, Object...)} from
- * {@link #mLog} after testing if ouput level is {@link OutputLevel#VERBOSE}.
+ * This is just a convenience wrapper around {@link ILogger#info(String, Object...)} from
+ * {@link #mLog} after testing if output level is {@link OutputLevel#VERBOSE}.
*
* @param format Format for String.format
* @param args Arguments for String.format
@@ -1248,7 +1248,7 @@ public class ProjectCreator {
if (!format.endsWith("\n")) {
format += "\n";
}
- mLog.printf(format, args);
+ mLog.info(format, args);
}
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java
index 458a433..57e6190 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java
@@ -23,7 +23,7 @@ import com.android.io.FolderWrapper;
import com.android.io.IAbstractFile;
import com.android.io.IAbstractFolder;
import com.android.io.StreamException;
-import com.android.sdklib.ISdkLog;
+import com.android.utils.ILogger;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
@@ -420,12 +420,12 @@ public class ProjectProperties implements IPropertySource {
* <p/>If the file is not present, null is returned with no error messages sent to the log.
*
* @param propFile the property file to parse
- * @param log the ISdkLog object receiving warning/error from the parsing.
+ * @param log the ILogger object receiving warning/error from the parsing.
* @return the map of (key,value) pairs, or null if the parsing failed.
*/
public static Map<String, String> parsePropertyFile(
@NonNull IAbstractFile propFile,
- @Nullable ISdkLog log) {
+ @Nullable ILogger log) {
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(propFile.getContents(),
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskMonitor.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskMonitor.java
index 248ec2b..74dd14a 100755
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskMonitor.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskMonitor.java
@@ -16,7 +16,7 @@
package com.android.sdklib.internal.repository;
-import com.android.sdklib.ISdkLog;
+import com.android.utils.ILogger;
/**
@@ -45,9 +45,9 @@ import com.android.sdklib.ISdkLog;
* logged and/or might hide the verbose text unless a flag is checked by the user.
* This is set using {@link #log}, {@link #logError} and {@link #logVerbose}.
* <p/>
- * A monitor is also an {@link ISdkLog} implementation.
+ * A monitor is also an {@link ILogger} implementation.
*/
-public interface ITaskMonitor extends ISdkLog {
+public interface ITaskMonitor extends ILogger {
/**
* Sets the description in the current task dialog.
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java
index ce39d90..313819b 100755
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java
@@ -19,7 +19,6 @@ package com.android.sdklib.internal.repository;
import com.android.SdkConstants;
import com.android.annotations.NonNull;
import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISdkLog;
import com.android.sdklib.ISystemImage;
import com.android.sdklib.ISystemImage.LocationType;
import com.android.sdklib.SdkManager;
@@ -35,6 +34,7 @@ import com.android.sdklib.internal.repository.packages.SamplePackage;
import com.android.sdklib.internal.repository.packages.SourcePackage;
import com.android.sdklib.internal.repository.packages.SystemImagePackage;
import com.android.sdklib.internal.repository.packages.ToolPackage;
+import com.android.utils.ILogger;
import com.android.utils.Pair;
import java.io.File;
@@ -281,7 +281,7 @@ public class LocalSdkParser {
private void scanExtras(SdkManager sdkManager,
HashSet<File> visited,
ArrayList<Package> packages,
- ISdkLog log) {
+ ILogger log) {
File root = new File(sdkManager.getLocation(), SdkConstants.FD_EXTRAS);
if (!root.isDirectory()) {
@@ -303,7 +303,7 @@ public class LocalSdkParser {
private void scanExtrasDirectory(String extrasRoot,
HashSet<File> visited,
ArrayList<Package> packages,
- ISdkLog log) {
+ ILogger log) {
File root = new File(extrasRoot);
if (!root.isDirectory()) {
@@ -349,7 +349,7 @@ public class LocalSdkParser {
private void scanMissingSamples(SdkManager sdkManager,
HashSet<File> visited,
ArrayList<Package> packages,
- ISdkLog log) {
+ ILogger log) {
File root = new File(sdkManager.getLocation());
root = new File(root, SdkConstants.FD_SAMPLES);
@@ -384,7 +384,7 @@ public class LocalSdkParser {
private void scanMissingAddons(SdkManager sdkManager,
HashSet<File> visited,
ArrayList<Package> packages,
- ISdkLog log) {
+ ILogger log) {
File addons = new File(new File(sdkManager.getLocation()), SdkConstants.FD_ADDONS);
File[] files = addons.listFiles();
@@ -423,7 +423,7 @@ public class LocalSdkParser {
private void scanMissingSystemImages(SdkManager sdkManager,
HashSet<File> visited,
ArrayList<Package> packages,
- ISdkLog log) {
+ ILogger log) {
File siRoot = new File(sdkManager.getLocation(), SdkConstants.FD_SYSTEM_IMAGES);
File[] files = siRoot.listFiles();
@@ -469,7 +469,7 @@ public class LocalSdkParser {
private void scanSources(SdkManager sdkManager,
HashSet<File> visited,
ArrayList<Package> packages,
- ISdkLog log) {
+ ILogger log) {
File srcRoot = new File(sdkManager.getLocation(), SdkConstants.FD_PKG_SOURCES);
File[] subDirs = srcRoot.listFiles();
@@ -503,7 +503,7 @@ public class LocalSdkParser {
* Try to find a tools package at the given location.
* Returns null if not found.
*/
- private Package scanTools(File toolFolder, ISdkLog log) {
+ private Package scanTools(File toolFolder, ILogger log) {
// Can we find some properties?
Properties props = parseProperties(new File(toolFolder, SdkConstants.FN_SOURCE_PROP));
@@ -555,7 +555,7 @@ public class LocalSdkParser {
* Try to find a platform-tools package at the given location.
* Returns null if not found.
*/
- private Package scanPlatformTools(File platformToolsFolder, ISdkLog log) {
+ private Package scanPlatformTools(File platformToolsFolder, ILogger log) {
// Can we find some properties?
Properties props = parseProperties(new File(platformToolsFolder,
SdkConstants.FN_SOURCE_PROP));
@@ -594,7 +594,7 @@ public class LocalSdkParser {
* Try to find a docs package at the given location.
* Returns null if not found.
*/
- private Package scanDoc(File docFolder, ISdkLog log) {
+ private Package scanDoc(File docFolder, ILogger log) {
// Can we find some properties?
Properties props = parseProperties(new File(docFolder, SdkConstants.FN_SOURCE_PROP));
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java
index a666232..6464484 100755
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java
@@ -16,8 +16,7 @@
package com.android.sdklib.internal.repository;
-import com.android.sdklib.ISdkLog;
-import com.android.sdklib.NullSdkLog;
+import com.android.utils.ILogger;
/**
@@ -25,12 +24,12 @@ import com.android.sdklib.NullSdkLog;
* <p/>
* This can be passed to methods that require a monitor when the caller doesn't
* have any UI to update or means to report tracked progress.
- * A custom {@link ISdkLog} is used. Clients could use {@link NullSdkLog} if
+ * A custom {@link ILogger} is used. Clients could use {@link NullSdkLog} if
* they really don't care about the logging either.
*/
public class NullTaskMonitor implements ITaskMonitor {
- private final ISdkLog mLog;
+ private final ILogger mLog;
/**
* Creates a no-op {@link ITaskMonitor} that defers logging to the specified
@@ -39,9 +38,9 @@ public class NullTaskMonitor implements ITaskMonitor {
* This can be passed to methods that require a monitor when the caller doesn't
* have any UI to update or means to report tracked progress.
*
- * @param log An {@link ISdkLog}. Must not be null. Consider using {@link NullSdkLog}.
+ * @param log An {@link ILogger}. Must not be null. Consider using {@link NullSdkLog}.
*/
- public NullTaskMonitor(ISdkLog log) {
+ public NullTaskMonitor(ILogger log) {
mLog = log;
}
@@ -52,7 +51,7 @@ public class NullTaskMonitor implements ITaskMonitor {
@Override
public void log(String format, Object...args) {
- mLog.printf(format, args);
+ mLog.info(format, args);
}
@Override
@@ -62,7 +61,7 @@ public class NullTaskMonitor implements ITaskMonitor {
@Override
public void logVerbose(String format, Object...args) {
- mLog.printf(format, args);
+ mLog.verbose(format, args);
}
@Override
@@ -109,7 +108,7 @@ public class NullTaskMonitor implements ITaskMonitor {
return null;
}
- // --- ISdkLog ---
+ // --- ILogger ---
@Override
public void error(Throwable t, String errorFormat, Object... args) {
@@ -122,8 +121,12 @@ public class NullTaskMonitor implements ITaskMonitor {
}
@Override
- public void printf(String msgFormat, Object... args) {
- mLog.printf(msgFormat, args);
+ public void info(String msgFormat, Object... args) {
+ mLog.info(msgFormat, args);
}
+ @Override
+ public void verbose(String msgFormat, Object... args) {
+ mLog.verbose(msgFormat, args);
+ }
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ExtraPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ExtraPackage.java
index 1a4a59d..78a2450 100755
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ExtraPackage.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ExtraPackage.java
@@ -20,7 +20,6 @@ import com.android.SdkConstants;
import com.android.annotations.Nullable;
import com.android.annotations.VisibleForTesting;
import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.NullSdkLog;
import com.android.sdklib.SdkManager;
import com.android.sdklib.internal.repository.IDescription;
import com.android.sdklib.internal.repository.LocalSdkParser;
@@ -31,6 +30,7 @@ import com.android.sdklib.internal.repository.archives.Archive.Os;
import com.android.sdklib.internal.repository.sources.SdkSource;
import com.android.sdklib.repository.PkgProps;
import com.android.sdklib.repository.RepoConstants;
+import com.android.utils.NullLogger;
import org.w3c.dom.Node;
@@ -560,7 +560,7 @@ public class ExtraPackage extends MinToolsPackage
osSdkRoot,
sdkManager,
LocalSdkParser.PARSE_EXTRAS,
- new NullTaskMonitor(new NullSdkLog()));
+ new NullTaskMonitor(NullLogger.getLogger()));
for (Package pkg : pkgs) {
if (sameItemAs(pkg) && pkg instanceof ExtraPackage) {
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSources.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSources.java
index 68b4b98..40915f2 100755
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSources.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSources.java
@@ -18,7 +18,7 @@ package com.android.sdklib.internal.repository.sources;
import com.android.prefs.AndroidLocation;
import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.ISdkLog;
+import com.android.utils.ILogger;
import java.io.File;
import java.io.FileInputStream;
@@ -260,7 +260,7 @@ public class SdkSources {
* <p/>
* This calls {@link #notifyChangeListeners()} at the end of the operation.
*/
- public void loadUserAddons(ISdkLog log) {
+ public void loadUserAddons(ILogger log) {
// Implementation detail: synchronize on the sources list to make sure that
// a- the source list doesn't change while we load/save it, and most important
// b- to make sure it's not being saved while loaded or the reverse.
@@ -334,7 +334,7 @@ public class SdkSources {
* Saves all the user sources.
* @param log Logger. Cannot be null.
*/
- public void saveUserAddons(ISdkLog log) {
+ public void saveUserAddons(ILogger log) {
// See the implementation detail note in loadUserAddons() about the synchronization.
synchronized (mSources) {
FileOutputStream fos = null;
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java
index 530569f..3a86ea7 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java
@@ -18,7 +18,7 @@ package com.android.sdklib.util;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
-import com.android.sdklib.ISdkLog;
+import com.android.utils.ILogger;
import java.util.ArrayList;
import java.util.HashMap;
@@ -97,7 +97,7 @@ public class CommandLineParser {
*/
private final HashMap<String, Arg> mArguments = new HashMap<String, Arg>();
/** Logger */
- private final ISdkLog mLog;
+ private final ILogger mLog;
/**
* Constructs a new command-line processor.
@@ -108,7 +108,7 @@ public class CommandLineParser {
*
* @see #mActions
*/
- public CommandLineParser(ISdkLog logger, String[][] actions) {
+ public CommandLineParser(ILogger logger, String[][] actions) {
mLog = logger;
mActions = actions;
@@ -952,7 +952,7 @@ public class CommandLineParser {
protected void stdout(String format, Object...args) {
String output = String.format(format, args);
output = LineUtil.reflowLine(output);
- mLog.printf("%s\n", output); //$NON-NLS-1$
+ mLog.info("%s\n", output); //$NON-NLS-1$
}
/**