diff options
author | Raphael Moll <ralf@android.com> | 2013-03-12 10:39:00 -0700 |
---|---|---|
committer | Raphael Moll <ralf@android.com> | 2013-03-13 20:34:20 -0700 |
commit | f6a5b596f5473558ecc859e8af931a9f1b80a7ea (patch) | |
tree | 885f0080f18c5ba1a94781b9d61077d2c67e3add /sdkmanager | |
parent | bc982e5d2a6ffc0fa5c76eaf39e77e4ec415e637 (diff) | |
download | sdk-f6a5b596f5473558ecc859e8af931a9f1b80a7ea.zip sdk-f6a5b596f5473558ecc859e8af931a9f1b80a7ea.tar.gz sdk-f6a5b596f5473558ecc859e8af931a9f1b80a7ea.tar.bz2 |
SDK: Delete projects moved to tools/base or tools/swt.
Change-Id: Iba15f82cb00d19217382c78d8ff37dda1e97ea59
Diffstat (limited to 'sdkmanager')
36 files changed, 0 insertions, 4770 deletions
diff --git a/sdkmanager/.gitignore b/sdkmanager/.gitignore deleted file mode 100644 index 7c578b4..0000000 --- a/sdkmanager/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/app/bin -/build -/libs/build -/libs/sdklib/bin -/libs/sdklib/build -/libs/sdkuilib/bin - diff --git a/sdkmanager/Android.mk b/sdkmanager/Android.mk deleted file mode 100644 index fdc9968..0000000 --- a/sdkmanager/Android.mk +++ /dev/null @@ -1,19 +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. -# -SDKMANAGER_LOCAL_DIR := $(call my-dir) -include $(SDKMANAGER_LOCAL_DIR)/app/Android.mk -include $(SDKMANAGER_LOCAL_DIR)/libs/Android.mk - diff --git a/sdkmanager/MODULE_LICENSE_APACHE2 b/sdkmanager/MODULE_LICENSE_APACHE2 deleted file mode 100644 index e69de29..0000000 --- a/sdkmanager/MODULE_LICENSE_APACHE2 +++ /dev/null diff --git a/sdkmanager/app/.classpath b/sdkmanager/app/.classpath deleted file mode 100644 index 98cdeb1..0000000 --- a/sdkmanager/app/.classpath +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry excluding="**/Android.mk" kind="src" path="src/main/java"/> - <classpathentry excluding="**/Android.mk" kind="src" path="src/test/java"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry combineaccessrules="false" kind="src" path="/sdklib"/> - <classpathentry combineaccessrules="false" kind="src" path="/sdkuilib"/> - <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> - <classpathentry combineaccessrules="false" kind="src" path="/common"/> - <classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/sdkmanager/app/.project b/sdkmanager/app/.project deleted file mode 100644 index aa82db5..0000000 --- a/sdkmanager/app/.project +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>SdkManager</name>
- <comment></comment>
- <projects>
- <project>SdkLib</project>
- <project>SdkUiLib</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9dbff07..0000000 --- a/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,98 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled -org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/sdkmanager/app/Android.mk b/sdkmanager/app/Android.mk deleted file mode 100644 index 428b8a0..0000000 --- a/sdkmanager/app/Android.mk +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 2007 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. -# -ORIG_LOCAL_PATH := $(call my-dir) -LOCAL_PATH := $(ORIG_LOCAL_PATH) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java) -LOCAL_JAVA_RESOURCE_DIRS := src/main/java - -LOCAL_JAR_MANIFEST := etc/manifest.txt - -# IMPORTANT: if you add a new dependency here, please make sure -# to also check the following files: -# sdkmanager/app/etc/manifest.txt -# sdkmanager/app/etc/android.bat -# (Note that we don't reference swt.jar in these files since -# it is dynamically added by android.bat/.sh based on whether the -# current VM is 32 or 64 bit.) -LOCAL_JAVA_LIBRARIES := \ - common \ - guava-tools \ - sdklib \ - sdkuilib \ - swt \ - org.eclipse.jface_3.6.2.M20110210-1200 \ - org.eclipse.equinox.common_3.6.0.v20100503 \ - org.eclipse.core.commands_3.6.0.I20100512-1500 - -LOCAL_MODULE := sdkmanager -LOCAL_MODULE_TAGS := optional - -include $(BUILD_HOST_JAVA_LIBRARY) - -# Build all sub-directories -include $(call all-makefiles-under,$(LOCAL_PATH)) - - -# ----- TESTS ------ -# Copyright (C) 2011 The Android Open Source Project - -LOCAL_PATH := $(ORIG_LOCAL_PATH) -include $(CLEAR_VARS) - -# Only compile source java files in this lib. -LOCAL_SRC_FILES := $(call all-java-files-under, src/test/java) - -LOCAL_MODULE := sdkmanager-tests -LOCAL_MODULE_TAGS := optional - -LOCAL_JAVA_LIBRARIES := \ - guava-tools \ - httpclient-4.1.1 \ - httpcore-4.1 \ - httpmime-4.1.1 \ - junit \ - sdkmanager \ - sdklib - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/sdkmanager/app/NOTICE b/sdkmanager/app/NOTICE deleted file mode 100644 index c5b1efa..0000000 --- a/sdkmanager/app/NOTICE +++ /dev/null @@ -1,190 +0,0 @@ - - Copyright (c) 2005-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. - - 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. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - diff --git a/sdkmanager/app/etc/Android.mk b/sdkmanager/app/etc/Android.mk deleted file mode 100644 index 8e3786e..0000000 --- a/sdkmanager/app/etc/Android.mk +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2008 The Android Open Source Project -# -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_PREBUILT_EXECUTABLES := android -LOCAL_MODULE_TAGS := optional -include $(BUILD_HOST_PREBUILT) - diff --git a/sdkmanager/app/etc/android b/sdkmanager/app/etc/android deleted file mode 100755 index f186ebb..0000000 --- a/sdkmanager/app/etc/android +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -# Copyright 2005-2007, 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. - -# Set up prog to be the path of this script, including following symlinks, -# and set up progdir to be the fully-qualified pathname of its directory. -prog="$0" -while [ -h "${prog}" ]; do - newProg=`/bin/ls -ld "${prog}"` - newProg=`expr "${newProg}" : ".* -> \(.*\)$"` - if expr "x${newProg}" : 'x/' >/dev/null; then - prog="${newProg}" - else - progdir=`dirname "${prog}"` - prog="${progdir}/${newProg}" - fi -done -oldwd=`pwd` -progdir=`dirname "${prog}"` -cd "${progdir}" -progdir=`pwd` -prog="${progdir}"/`basename "${prog}"` -cd "${oldwd}" - -jarfile=sdkmanager.jar -frameworkdir="$progdir" -if [ ! -r "$frameworkdir/$jarfile" ] -then - frameworkdir=`dirname "$progdir"`/tools/lib -fi -if [ ! -r "$frameworkdir/$jarfile" ] -then - frameworkdir=`dirname "$progdir"`/framework -fi -if [ ! -r "$frameworkdir/$jarfile" ] -then - echo `basename "$prog"`": can't find $jarfile" - exit 1 -fi - - -# Check args. -if [ debug = "$1" ]; then - # add this in for debugging - java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y - shift 1 -else - java_debug= -fi - -java_cmd="java" - -# Mac OS X needs an additional arg, or you get an "illegal thread" complaint. -if [ `uname` = "Darwin" ]; then - os_opts="-XstartOnFirstThread" -else - os_opts= -fi - -if [ `uname` = "Linux" ]; then - export GDK_NATIVE_WINDOWS=true -fi - -if [ "$OSTYPE" = "cygwin" ] ; then - jarpath=`cygpath -w "$frameworkdir/$jarfile"` - jarpath="$jarpath;"`cygpath -w "$frameworkdir/swtmenubar.jar"` - progdir=`cygpath -w "$progdir"` -else - jarpath="$frameworkdir/$jarfile:$frameworkdir/swtmenubar.jar" -fi - -# Get the current content of java.ext.dirs so that we can add to it instead of replacing -javaExtDirs=`"${java_cmd}" -jar "${frameworkdir}/archquery.jar" java.ext.dirs` - -# Figure out the path to the swt.jar for the current architecture. -# if ANDROID_SWT is defined, then just use this. -# else, if running in the Android source tree, then look for the correct swt folder in prebuilt -# else, look for the correct swt folder in the SDK under tools/lib/ -swtpath="" -if [ -n "$ANDROID_SWT" ]; then - swtpath="$ANDROID_SWT" -else - vmarch=`"${java_cmd}" -jar "${frameworkdir}/archquery.jar"` - if [ -n "$ANDROID_BUILD_TOP" ]; then - osname=`uname -s | tr A-Z a-z` - swtpath="${ANDROID_BUILD_TOP}/prebuilts/tools/${osname}-${vmarch}/swt" - else - swtpath="${frameworkdir}/${vmarch}" - fi -fi - -if [ ! -d "$swtpath" ]; then - echo "SWT folder '${swtpath}' does not exist." - echo "Please export ANDROID_SWT to point to the folder containing swt.jar for your platform." - exit 1 -fi - -# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored -exec "$java_cmd" \ - -Xmx256M $os_opts $java_debug \ - -Dcom.android.sdkmanager.toolsdir="$progdir" \ - -classpath "$jarpath:$swtpath/swt.jar" \ - com.android.sdkmanager.Main "$@" diff --git a/sdkmanager/app/etc/android.bat b/sdkmanager/app/etc/android.bat deleted file mode 100755 index 222ea88..0000000 --- a/sdkmanager/app/etc/android.bat +++ /dev/null @@ -1,84 +0,0 @@ -@echo off
-rem Copyright (C) 2007 The Android Open Source Project
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem Useful links:
-rem Command-line reference:
-rem http://technet.microsoft.com/en-us/library/bb490890.aspx
-
-rem don't modify the caller's environment
-setlocal
-
-rem Set up prog to be the path of this script, including following symlinks,
-rem and set up progdir to be the fully-qualified pathname of its directory.
-set prog=%~f0
-
-rem Grab current directory before we change it
-set work_dir="%cd%"
-
-rem Change current directory and drive to where the script is, to avoid
-rem issues with directories containing whitespaces.
-cd /d %~dp0
-
-
-rem Check we have a valid Java.exe in the path.
-set java_exe=
-call lib\find_java.bat
-if not defined java_exe goto :EOF
-
-set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar
-
-rem Set SWT.Jar path based on current architecture (x86 or x86_64)
-for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
-
-:MkTempCopy
- rem Copy android.bat and its required libs to a temp dir.
- rem This avoids locking the tool dir in case the user is trying to update it.
-
- set tmp_dir=%TEMP%\temp-android-tool
- xcopy %swt_path% %tmp_dir%\%swt_path% /I /E /C /G /R /Y /Q > nul
- copy /B /D /Y lib\common.jar %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\commons-codec* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\commons-compress* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\commons-logging* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\dvlib.jar %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\guava* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\httpclient* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\httpcore* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\httpmime* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\layoutlib_api.jar %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\org.eclipse.* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\sdk* %tmp_dir%\lib\ > nul
- copy /B /D /Y lib\swtmenubar.jar %tmp_dir%\lib\ > nul
-
- rem jar_path and swt_path are relative to PWD so we don't need to adjust them, just change dirs.
- set tools_dir=%cd%
- cd /d %tmp_dir%
-
-:EndTempCopy
-
-rem The global ANDROID_SWT always override the SWT.Jar path
-if defined ANDROID_SWT set swt_path=%ANDROID_SWT%
-
-if exist %swt_path% goto SetPath
- echo ERROR: SWT folder '%swt_path%' does not exist.
- echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
- goto :EOF
-
-:SetPath
-rem Finally exec the java program and end here.
-REM set REMOTE_DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-call %java_exe% %REMOTE_DEBUG% -Dcom.android.sdkmanager.toolsdir="%tools_dir%" -Dcom.android.sdkmanager.workdir=%work_dir% -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*
-
-rem EOF
diff --git a/sdkmanager/app/etc/manifest.txt b/sdkmanager/app/etc/manifest.txt deleted file mode 100644 index 44be3b8..0000000 --- a/sdkmanager/app/etc/manifest.txt +++ /dev/null @@ -1,2 +0,0 @@ -Main-Class: com.android.sdkmanager.Main -Class-Path: common.jar sdklib.jar sdkuilib.jar swtmenubar.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar guava-tools.jar diff --git a/sdkmanager/app/src/main/java/com/android/sdkmanager/Main.java b/sdkmanager/app/src/main/java/com/android/sdkmanager/Main.java deleted file mode 100644 index 0ef18b8..0000000 --- a/sdkmanager/app/src/main/java/com/android/sdkmanager/Main.java +++ /dev/null @@ -1,1617 +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.sdkmanager; - -import com.android.SdkConstants; -import com.android.annotations.NonNull; -import com.android.annotations.VisibleForTesting; -import com.android.annotations.VisibleForTesting.Visibility; -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.IAndroidTarget.IOptionalLibrary; -import com.android.sdklib.ISystemImage; -import com.android.sdklib.SdkManager; -import com.android.sdklib.internal.avd.AvdInfo; -import com.android.sdklib.internal.avd.AvdManager; -import com.android.sdklib.internal.avd.HardwareProperties; -import com.android.sdklib.internal.avd.HardwareProperties.HardwareProperty; -import com.android.sdklib.internal.project.ProjectCreator; -import com.android.sdklib.internal.project.ProjectCreator.OutputLevel; -import com.android.sdklib.internal.project.ProjectProperties; -import com.android.sdklib.internal.project.ProjectProperties.PropertyType; -import com.android.sdklib.internal.project.ProjectPropertiesWorkingCopy; -import com.android.sdklib.internal.repository.DownloadCache; -import com.android.sdklib.internal.repository.DownloadCache.Strategy; -import com.android.sdklib.internal.repository.packages.PlatformToolPackage; -import com.android.sdklib.internal.repository.packages.ToolPackage; -import com.android.sdklib.internal.repository.updater.SdkUpdaterNoWindow; -import com.android.sdklib.repository.SdkAddonConstants; -import com.android.sdklib.repository.SdkRepoConstants; -import com.android.sdkuilib.internal.widgets.MessageBoxLog; -import com.android.sdkuilib.repository.AvdManagerWindow; -import com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext; -import com.android.sdkuilib.repository.SdkUpdaterWindow; -import com.android.sdkuilib.repository.SdkUpdaterWindow.SdkInvocationContext; -import com.android.utils.ILogger; -import com.android.utils.Pair; -import com.android.xml.AndroidXPathFactory; - -import org.eclipse.swt.widgets.Display; -import org.xml.sax.InputSource; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathExpressionException; - -/** - * Main class for the 'android' application. - */ -public class Main { - - /** Java property that defines the location of the sdk/tools directory. */ - public final static String TOOLSDIR = "com.android.sdkmanager.toolsdir"; - /** Java property that defines the working directory. On Windows the current working directory - * is actually the tools dir, in which case this is used to get the original CWD. */ - private final static String WORKDIR = "com.android.sdkmanager.workdir"; - - /** Value returned by {@link #resolveTargetName(String)} when the target id does not match. */ - private final static int INVALID_TARGET_ID = 0; - - private final static String[] BOOLEAN_YES_REPLIES = new String[] { "yes", "y" }; - private final static String[] BOOLEAN_NO_REPLIES = new String[] { "no", "n" }; - - /** Path to the SDK folder. This is the parent of {@link #TOOLSDIR}. */ - private String mOsSdkFolder; - /** Logger object. Use this to print normal output, warnings or errors. */ - private ILogger mSdkLog; - /** The SDK manager parses the SDK folder and gives access to the content. */ - private SdkManager mSdkManager; - /** Command-line processor with options specific to SdkManager. */ - private SdkCommandLine mSdkCommandLine; - /** The working directory, either null or set to an existing absolute canonical directory. */ - private File mWorkDir; - - public static void main(String[] args) { - new Main().run(args); - } - - /** Used by tests to set the sdk manager. */ - @VisibleForTesting(visibility=Visibility.PRIVATE) - void setSdkManager(SdkManager sdkManager) { - mSdkManager = sdkManager; - } - - /** - * Runs the sdk manager app - */ - private void run(String[] args) { - createLogger(); - init(); - mSdkCommandLine.parseArgs(args); - parseSdk(); - doAction(); - } - - /** - * Creates the {@link #mSdkLog} object. - * This must be done before {@link #init()} as it will be used to report errors. - * This logger prints to the attached console. - */ - private void createLogger() { - mSdkLog = new ILogger() { - @Override - public void error(Throwable t, String errorFormat, Object... args) { - if (errorFormat != null) { - System.err.printf("Error: " + errorFormat, args); - if (!errorFormat.endsWith("\n")) { - System.err.printf("\n"); - } - } - if (t != null) { - System.err.printf("Error: %s\n", t.getMessage()); - } - } - - @Override - public void warning(@NonNull String warningFormat, Object... args) { - if (mSdkCommandLine.isVerbose()) { - System.out.printf("Warning: " + warningFormat, args); - if (!warningFormat.endsWith("\n")) { - System.out.printf("\n"); - } - } - } - - @Override - public void info(@NonNull String msgFormat, Object... args) { - System.out.printf(msgFormat, args); - } - - @Override - public void verbose(@NonNull String msgFormat, Object... args) { - System.out.printf(msgFormat, args); - } - }; - } - - /** For testing */ - public void setLogger(ILogger logger) { - mSdkLog = logger; - } - - /** - * Init the application by making sure the SDK path is available and - * doing basic parsing of the SDK. - */ - private void init() { - mSdkCommandLine = new SdkCommandLine(mSdkLog); - - // We get passed a property for the tools dir - String toolsDirProp = System.getProperty(TOOLSDIR); - if (toolsDirProp == null) { - // for debugging, it's easier to override using the process environment - toolsDirProp = System.getenv(TOOLSDIR); - } - - if (toolsDirProp != null) { - // got back a level for the SDK folder - File tools; - if (toolsDirProp.length() > 0) { - tools = new File(toolsDirProp); - mOsSdkFolder = tools.getParent(); - } else { - try { - tools = new File(".").getCanonicalFile(); - mOsSdkFolder = tools.getParent(); - } catch (IOException e) { - // Will print an error below since mSdkFolder is not defined - } - } - } - - if (mOsSdkFolder == null) { - errorAndExit("The tools directory property is not set, please make sure you are executing %1$s", - SdkConstants.androidCmdName()); - } - - // We might get passed a property for the working directory - // Either it is a valid directory and mWorkDir is set to it's absolute canonical value - // or mWorkDir remains null. - String workDirProp = System.getProperty(WORKDIR); - if (workDirProp == null) { - workDirProp = System.getenv(WORKDIR); - } - if (workDirProp != null) { - // This should be a valid directory - mWorkDir = new File(workDirProp); - try { - mWorkDir = mWorkDir.getCanonicalFile().getAbsoluteFile(); - } catch (IOException e) { - mWorkDir = null; - } - if (mWorkDir == null || !mWorkDir.isDirectory()) { - errorAndExit("The working directory does not seem to be valid: '%1$s", workDirProp); - } - } - } - - /** - * Does the basic SDK parsing required for all actions - */ - private void parseSdk() { - mSdkManager = SdkManager.createManager(mOsSdkFolder, mSdkLog); - - if (mSdkManager == null) { - errorAndExit("Unable to parse SDK content."); - } - } - - /** - * Actually do an action... - */ - private void doAction() { - - if (mSdkCommandLine.hasClearCache()) { - DownloadCache d = new DownloadCache(Strategy.SERVE_CACHE); - d.clearCache(); - mSdkLog.info("SDK Manager repository: manifest cache cleared.\n"); - } - - String verb = mSdkCommandLine.getVerb(); - String directObject = mSdkCommandLine.getDirectObject(); - - if (SdkCommandLine.VERB_LIST.equals(verb)) { - // list action. - if (SdkCommandLine.OBJECT_TARGET.equals(directObject)) { - displayTargetList(); - - } else if (SdkCommandLine.OBJECT_AVD.equals(directObject)) { - displayAvdList(); - - } else if (SdkCommandLine.OBJECT_SDK.equals(directObject)) { - displayRemoteSdkListNoUI(); - - } else { - displayTargetList(); - displayAvdList(); - } - - } else if (SdkCommandLine.VERB_CREATE.equals(verb)) { - if (SdkCommandLine.OBJECT_AVD.equals(directObject)) { - createAvd(); - - } else if (SdkCommandLine.OBJECT_PROJECT.equals(directObject)) { - createProject(false /*library*/); - - } else if (SdkCommandLine.OBJECT_TEST_PROJECT.equals(directObject)) { - createTestProject(); - - } else if (SdkCommandLine.OBJECT_LIB_PROJECT.equals(directObject)) { - createProject(true /*library*/); - - } else if (SdkCommandLine.OBJECT_UITEST_PROJECT.equals(directObject)) { - createUiTestProject(); - - } - } else if (SdkCommandLine.VERB_UPDATE.equals(verb)) { - if (SdkCommandLine.OBJECT_AVD.equals(directObject)) { - updateAvd(); - - } else if (SdkCommandLine.OBJECT_PROJECT.equals(directObject)) { - updateProject(false /*library*/); - - } else if (SdkCommandLine.OBJECT_TEST_PROJECT.equals(directObject)) { - updateTestProject(); - - } else if (SdkCommandLine.OBJECT_LIB_PROJECT.equals(directObject)) { - updateProject(true /*library*/); - - } else if (SdkCommandLine.OBJECT_SDK.equals(directObject)) { - if (mSdkCommandLine.getFlagNoUI(verb)) { - updateSdkNoUI(); - } else { - showSdkManagerWindow(); - } - - } else if (SdkCommandLine.OBJECT_ADB.equals(directObject)) { - updateAdb(); - - } - } else if (SdkCommandLine.VERB_SDK.equals(verb)) { - showSdkManagerWindow(); - - } else if (SdkCommandLine.VERB_AVD.equals(verb)) { - showAvdManagerWindow(); - - } else if (SdkCommandLine.VERB_DELETE.equals(verb) && - SdkCommandLine.OBJECT_AVD.equals(directObject)) { - deleteAvd(); - - } else if (SdkCommandLine.VERB_MOVE.equals(verb) && - SdkCommandLine.OBJECT_AVD.equals(directObject)) { - moveAvd(); - - } else if (verb == null && directObject == null) { - showSdkManagerWindow(); - - } else { - mSdkCommandLine.printHelpAndExit(null); - } - } - - /** - * Display the main SDK Manager app window - */ - private void showSdkManagerWindow() { - try { - MessageBoxLog errorLogger = new MessageBoxLog( - "SDK Manager", - Display.getCurrent(), - true /*logErrorsOnly*/); - - SdkUpdaterWindow window = new SdkUpdaterWindow( - null /* parentShell */, - errorLogger, - mOsSdkFolder, - SdkInvocationContext.STANDALONE); - window.open(); - - errorLogger.displayResult(true); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * Display the main AVD Manager app window - */ - private void showAvdManagerWindow() { - try { - MessageBoxLog errorLogger = new MessageBoxLog( - "AVD Manager", - Display.getCurrent(), - true /*logErrorsOnly*/); - - AvdManagerWindow window = new AvdManagerWindow( - null /* parentShell */, - errorLogger, - mOsSdkFolder, - AvdInvocationContext.STANDALONE); - - window.open(); - - errorLogger.displayResult(true); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void displayRemoteSdkListNoUI() { - boolean force = mSdkCommandLine.getFlagForce(); - boolean useHttp = mSdkCommandLine.getFlagNoHttps(); - boolean all = mSdkCommandLine.getFlagAll(); - boolean extended = mSdkCommandLine.getFlagExtended(); - String proxyHost = mSdkCommandLine.getParamProxyHost(); - String proxyPort = mSdkCommandLine.getParamProxyPort(); - - boolean obsolete = mSdkCommandLine.getFlagObsolete(); - all |= obsolete; - - SdkUpdaterNoWindow upd = new SdkUpdaterNoWindow( - mOsSdkFolder, - mSdkManager, - mSdkLog, - force, - useHttp, - proxyHost, - proxyPort); - upd.listRemotePackages(all, extended); - - if (obsolete) { - mSdkLog.info("Note: Flag --obsolete is deprecated and will be removed in the next version.\n Please use --all instead.\n"); - } - } - - /** - * Updates the whole SDK without any UI, just using console output. - */ - private void updateSdkNoUI() { - boolean force = mSdkCommandLine.getFlagForce(); - boolean useHttp = mSdkCommandLine.getFlagNoHttps(); - boolean dryMode = mSdkCommandLine.getFlagDryMode(); - boolean all = mSdkCommandLine.getFlagAll(); - String proxyHost = mSdkCommandLine.getParamProxyHost(); - String proxyPort = mSdkCommandLine.getParamProxyPort(); - - boolean obsolete = mSdkCommandLine.getFlagObsolete(); - all |= obsolete; - - // Check filter types. - Pair<String, ArrayList<String>> filterResult = - checkFilterValues(mSdkCommandLine.getParamFilter()); - if (filterResult.getFirst() != null) { - // We got an error. - errorAndExit(filterResult.getFirst()); - } - - SdkUpdaterNoWindow upd = new SdkUpdaterNoWindow( - mOsSdkFolder, - mSdkManager, - mSdkLog, - force, - useHttp, - proxyHost, - proxyPort); - upd.updateAll(filterResult.getSecond(), all, dryMode); - - if (obsolete) { - mSdkLog.info("Note: Flag --obsolete is deprecated and will be removed in the next version.\n Please use --all instead.\n"); - } - } - - /** - * Checks the values from the filter parameter and returns a tuple - * (error , accepted values). Either error is null and accepted values is not, - * or the reverse. - * <p/> - * Note that this is a quick sanity check of the --filter parameter *before* we - * start loading the remote repository sources. Loading the remotes takes a while - * so it's worth doing a quick sanity check before hand. - * - * @param filter A comma-separated list of keywords - * @return A pair <error string, usable values>, only one must be null and the other non-null. - */ - @VisibleForTesting(visibility=Visibility.PRIVATE) - Pair<String, ArrayList<String>> checkFilterValues(String filter) { - ArrayList<String> pkgFilter = new ArrayList<String>(); - - if (filter != null && filter.length() > 0) { - // Available types - Set<String> filterTypes = new TreeSet<String>(); - filterTypes.addAll(Arrays.asList(SdkRepoConstants.NODES)); - filterTypes.addAll(Arrays.asList(SdkAddonConstants.NODES)); - - for (String t : filter.split(",")) { //$NON-NLS-1$ - if (t == null) { - continue; - } - t = t.trim(); - if (t.length() <= 0) { - continue; - } - - if (t.indexOf('-') > 0 || - t.equals(ToolPackage.INSTALL_ID) || - t.equals(PlatformToolPackage.INSTALL_ID)) { - // Heuristic: if the filter name contains a dash, it is probably - // a variable package install id. Since we haven't loaded the remote - // repositories we can't validate it yet, so just accept it. - pkgFilter.add(t); - continue; - } - - if (t.replaceAll("[0-9]+", "").length() == 0) { //$NON-NLS-1$ //$NON-NLS-2$ - // If the filter argument *only* contains digits, accept it. - // It's probably an index for the remote repository list, - // which we can't validate yet. - pkgFilter.add(t); - continue; - } - - if (filterTypes.contains(t)) { - pkgFilter.add(t); - continue; - } - - return Pair.of( - String.format( - "Unknown package filter type '%1$s'.\nAccepted values are: %2$s", - t, - Arrays.toString(filterTypes.toArray())), - null); - } - } - - return Pair.of(null, pkgFilter); - } - - /** - * Returns a configured {@link ProjectCreator} instance. - */ - private ProjectCreator getProjectCreator() { - ProjectCreator creator = new ProjectCreator(mSdkManager, mOsSdkFolder, - mSdkCommandLine.isVerbose() ? OutputLevel.VERBOSE : - mSdkCommandLine.isSilent() ? OutputLevel.SILENT : - OutputLevel.NORMAL, - mSdkLog); - return creator; - } - - - /** - * Creates a new Android project based on command-line parameters - */ - private void createProject(boolean library) { - String directObject = library? SdkCommandLine.OBJECT_LIB_PROJECT : - SdkCommandLine.OBJECT_PROJECT; - - // get the target and try to resolve it. - int targetId = resolveTargetName(mSdkCommandLine.getParamTargetId()); - IAndroidTarget[] targets = mSdkManager.getTargets(); - if (targetId == INVALID_TARGET_ID || targetId > targets.length) { - errorAndExit("Target id is not valid. Use '%s list targets' to get the target ids.", - SdkConstants.androidCmdName()); - } - IAndroidTarget target = targets[targetId - 1]; // target id is 1-based - - ProjectCreator creator = getProjectCreator(); - - String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath()); - - String projectName = mSdkCommandLine.getParamName(); - String packageName = mSdkCommandLine.getParamProjectPackage(directObject); - String activityName = null; - if (library == false) { - activityName = mSdkCommandLine.getParamProjectActivity(); - } - - if (projectName != null && - !ProjectCreator.RE_PROJECT_NAME.matcher(projectName).matches()) { - errorAndExit( - "Project name '%1$s' contains invalid characters.\nAllowed characters are: %2$s", - projectName, ProjectCreator.CHARS_PROJECT_NAME); - return; - } - - if (activityName != null && - !ProjectCreator.RE_ACTIVITY_NAME.matcher(activityName).matches()) { - errorAndExit( - "Activity name '%1$s' contains invalid characters.\nAllowed characters are: %2$s", - activityName, ProjectCreator.CHARS_ACTIVITY_NAME); - return; - } - - if (packageName != null && - !ProjectCreator.RE_PACKAGE_NAME.matcher(packageName).matches()) { - errorAndExit( - "Package name '%1$s' contains invalid characters.\n" + - "A package name must be constitued of two Java identifiers.\n" + - "Each identifier allowed characters are: %2$s", - packageName, ProjectCreator.CHARS_PACKAGE_NAME); - return; - } - - creator.createProject(projectDir, - projectName, - packageName, - activityName, - target, - library, - null /*pathToMain*/); - } - - /** - * Creates a new Android test project based on command-line parameters - */ - private void createTestProject() { - - String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath()); - - // first check the path of the parent project, and make sure it's valid. - String pathToMainProject = mSdkCommandLine.getParamTestProjectMain(); - - File parentProject = new File(pathToMainProject); - if (parentProject.isAbsolute() == false) { - // if the path is not absolute, we need to resolve it based on the - // destination path of the project - try { - parentProject = new File(projectDir, pathToMainProject).getCanonicalFile(); - } catch (IOException e) { - errorAndExit("Unable to resolve Main project's directory: %1$s", - pathToMainProject); - return; // help Eclipse static analyzer understand we'll never execute the rest. - } - } - - if (parentProject.isDirectory() == false) { - errorAndExit("Main project's directory does not exist: %1$s", - pathToMainProject); - return; - } - - // now look for a manifest in there - File manifest = new File(parentProject, SdkConstants.FN_ANDROID_MANIFEST_XML); - if (manifest.isFile() == false) { - errorAndExit("No AndroidManifest.xml file found in the main project directory: %1$s", - parentProject.getAbsolutePath()); - return; - } - - // now query the manifest for the package file. - XPath xpath = AndroidXPathFactory.newXPath(); - String packageName, activityName; - - try { - packageName = xpath.evaluate("/manifest/@package", - new InputSource(new FileInputStream(manifest))); - - mSdkLog.info("Found main project package: %1$s\n", packageName); - - // now get the name of the first activity we find - activityName = xpath.evaluate("/manifest/application/activity[1]/@android:name", - new InputSource(new FileInputStream(manifest))); - // xpath will return empty string when there's no match - if (activityName == null || activityName.length() == 0) { - activityName = null; - } else { - mSdkLog.info("Found main project activity: %1$s\n", activityName); - } - } catch (FileNotFoundException e) { - // this shouldn't happen as we test it above. - errorAndExit("No AndroidManifest.xml file found in main project."); - return; // this is not strictly needed because errorAndExit will stop the execution, - // but this makes the java compiler happy, wrt to uninitialized variables. - } catch (XPathExpressionException e) { - // looks like the main manifest is not valid. - errorAndExit("Unable to parse main project manifest to get information."); - return; // this is not strictly needed because errorAndExit will stop the execution, - // but this makes the java compiler happy, wrt to uninitialized variables. - } - - // now get the target hash - ProjectProperties p = ProjectProperties.load(parentProject.getAbsolutePath(), - PropertyType.PROJECT); - if (p == null) { - errorAndExit("Unable to load the main project's %1$s", - PropertyType.PROJECT.getFilename()); - return; - } - - String targetHash = p.getProperty(ProjectProperties.PROPERTY_TARGET); - if (targetHash == null) { - errorAndExit("Couldn't find the main project target"); - return; - } - - // and resolve it. - IAndroidTarget target = mSdkManager.getTargetFromHashString(targetHash); - if (target == null) { - errorAndExit( - "Unable to resolve main project target '%1$s'. You may want to install the platform in your SDK.", - targetHash); - return; - } - - mSdkLog.info("Found main project target: %1$s\n", target.getFullName()); - - ProjectCreator creator = getProjectCreator(); - - String projectName = mSdkCommandLine.getParamName(); - - if (projectName != null && - !ProjectCreator.RE_PROJECT_NAME.matcher(projectName).matches()) { - errorAndExit( - "Project name '%1$s' contains invalid characters.\nAllowed characters are: %2$s", - projectName, ProjectCreator.CHARS_PROJECT_NAME); - return; - } - - creator.createProject(projectDir, - projectName, - packageName, - activityName, - target, - false /* library*/, - pathToMainProject); - } - - /** - * Creates a new Android UI test project based on command-line parameters - */ - private void createUiTestProject() { - - String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath()); - - // get the target and try to resolve it. - int targetId = resolveTargetName(mSdkCommandLine.getParamTargetId()); - IAndroidTarget[] targets = mSdkManager.getTargets(); - if (targetId == INVALID_TARGET_ID || targetId > targets.length) { - errorAndExit("Target id is not valid. Use '%s list targets' to get the target ids.", - SdkConstants.androidCmdName()); - } - IAndroidTarget target = targets[targetId - 1]; // target id is 1-based - - if (target.getVersion().getApiLevel() < 16) { - errorAndExit("UI test projects can only target API 16 and above"); - } - - // get the project name - String projectName = mSdkCommandLine.getParamName(); - // if none, use the folder name. - if (projectName == null) { - File f = new File(projectDir); - projectName = f.getName(); - } - - try { - // create src folder - File srcFolder = new File(projectDir, SdkConstants.FD_SOURCES); - srcFolder.mkdir(); - - // create the local.prop file. - // location of the SDK goes in localProperty - ProjectPropertiesWorkingCopy localProperties = ProjectProperties.create(projectDir, - PropertyType.LOCAL); - localProperties.setProperty(ProjectProperties.PROPERTY_SDK, mOsSdkFolder); - localProperties.save(); - - // target goes in project properties - ProjectPropertiesWorkingCopy projectProperties = ProjectProperties.create(projectDir, - PropertyType.PROJECT); - projectProperties.setProperty(ProjectProperties.PROPERTY_TARGET, target.hashString()); - projectProperties.save(); - - // copy the build file using the keywords replacement. - final Map<String, String> keywords = new HashMap<String, String>(); - keywords.put(ProjectCreator.PH_PROJECT_NAME, projectName); - - ProjectCreator creator = getProjectCreator(); - - creator.installTemplate("uibuild.template", - new File(projectDir, SdkConstants.FN_BUILD_XML), - keywords); - } catch (Exception e) { - mSdkLog.error(e, null); - } - } - - /** - * Updates an existing Android project based on command-line parameters - * @param library whether the project is a library project. - */ - private void updateProject(boolean library) { - // get the target and try to resolve it. - IAndroidTarget target = null; - String targetStr = mSdkCommandLine.getParamTargetId(); - // For "update project" the target parameter is optional so having null is acceptable. - // However if there's a value, it must be valid. - if (targetStr != null) { - IAndroidTarget[] targets = mSdkManager.getTargets(); - int targetId = resolveTargetName(targetStr); - if (targetId == INVALID_TARGET_ID || targetId > targets.length) { - errorAndExit("Target id '%1$s' is not valid. Use '%2$s list targets' to get the target ids.", - targetStr, - SdkConstants.androidCmdName()); - } - target = targets[targetId - 1]; // target id is 1-based - } - - ProjectCreator creator = getProjectCreator(); - - String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath()); - - String libraryPath = library ? null : - mSdkCommandLine.getParamProjectLibrary(SdkCommandLine.OBJECT_PROJECT); - - creator.updateProject(projectDir, - target, - mSdkCommandLine.getParamName(), - libraryPath); - - if (library == false) { - boolean doSubProjects = mSdkCommandLine.getParamSubProject(); - boolean couldHaveDone = false; - - // If there are any sub-folders with a manifest, try to update them as projects - // too. This will take care of updating any underlying test project even if the - // user changed the folder name. - File[] files = new File(projectDir).listFiles(); - if (files != null) { - for (File dir : files) { - if (dir.isDirectory() && - new File(dir, SdkConstants.FN_ANDROID_MANIFEST_XML).isFile()) { - if (doSubProjects) { - creator.updateProject(dir.getPath(), - target, - mSdkCommandLine.getParamName(), - null /*libraryPath*/); - } else { - couldHaveDone = true; - } - } - } - } - - if (couldHaveDone) { - mSdkLog.info( - "It seems that there are sub-projects. If you want to update them\nplease use the --%1$s parameter.\n", - SdkCommandLine.KEY_SUBPROJECTS); - } - } - } - - /** - * Updates an existing test project with a new path to the main project. - */ - private void updateTestProject() { - ProjectCreator creator = getProjectCreator(); - - String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath()); - - creator.updateTestProject(projectDir, mSdkCommandLine.getParamTestProjectMain(), - mSdkManager); - } - - /** - * Adjusts the project location to make it absolute & canonical relative to the - * working directory, if any. - * - * @return The project absolute path relative to {@link #mWorkDir} or the original - * newProjectLocation otherwise. - */ - private String getProjectLocation(String newProjectLocation) { - - // If the new project location is absolute, use it as-is - File projectDir = new File(newProjectLocation); - if (projectDir.isAbsolute()) { - return newProjectLocation; - } - - // if there's no working directory, just use the project location as-is. - if (mWorkDir == null) { - return newProjectLocation; - } - - // Combine then and get an absolute canonical directory - try { - projectDir = new File(mWorkDir, newProjectLocation).getCanonicalFile(); - - return projectDir.getPath(); - } catch (IOException e) { - errorAndExit("Failed to combine working directory '%1$s' with project location '%2$s': %3$s", - mWorkDir.getPath(), - newProjectLocation, - e.getMessage()); - return null; - } - } - - /** - * Displays the list of available Targets (Platforms and Add-ons) - */ - @VisibleForTesting(visibility=Visibility.PRIVATE) - void displayTargetList() { - - // Compact output, suitable for scripts. - if (mSdkCommandLine != null && mSdkCommandLine.getFlagCompact()) { - char eol = mSdkCommandLine.getFlagEolNull() ? '\0' : '\n'; - - for (IAndroidTarget target : mSdkManager.getTargets()) { - mSdkLog.info("%1$s%2$c", target.hashString(), eol); - } - - return; - } - - mSdkLog.info("Available Android targets:\n"); - - int index = 1; - for (IAndroidTarget target : mSdkManager.getTargets()) { - mSdkLog.info("----------\n"); - mSdkLog.info("id: %1$d or \"%2$s\"\n", index, target.hashString()); - mSdkLog.info(" Name: %s\n", target.getName()); - if (target.isPlatform()) { - mSdkLog.info(" Type: Platform\n"); - mSdkLog.info(" API level: %s\n", target.getVersion().getApiString()); - mSdkLog.info(" Revision: %d\n", target.getRevision()); - } else { - mSdkLog.info(" Type: Add-On\n"); - mSdkLog.info(" Vendor: %s\n", target.getVendor()); - mSdkLog.info(" Revision: %d\n", target.getRevision()); - if (target.getDescription() != null) { - mSdkLog.info(" Description: %s\n", target.getDescription()); - } - mSdkLog.info(" Based on Android %s (API level %s)\n", - target.getVersionName(), target.getVersion().getApiString()); - - // display the optional libraries. - IOptionalLibrary[] libraries = target.getOptionalLibraries(); - if (libraries != null) { - mSdkLog.info(" Libraries:\n"); - for (IOptionalLibrary library : libraries) { - mSdkLog.info(" * %1$s (%2$s)\n", - library.getName(), library.getJarName()); - mSdkLog.info(" %1$s\n", library.getDescription()); - } - } - } - - // get the target skins & ABIs - displaySkinList(target, " Skins: "); - displayAbiList (target, " ABIs : "); - - if (target.getUsbVendorId() != IAndroidTarget.NO_USB_ID) { - mSdkLog.info(" Adds USB support for devices (Vendor: 0x%04X)\n", - target.getUsbVendorId()); - } - - index++; - } - } - - /** - * Displays the skins valid for the given target. - */ - @VisibleForTesting(visibility=Visibility.PRIVATE) - void displaySkinList(IAndroidTarget target, String message) { - String[] skins = target.getSkins(); - String defaultSkin = target.getDefaultSkin(); - mSdkLog.info(message); - if (skins != null) { - boolean first = true; - for (String skin : skins) { - if (first == false) { - mSdkLog.info(", "); - } else { - first = false; - } - mSdkLog.info(skin); - - if (skin.equals(defaultSkin)) { - mSdkLog.info(" (default)"); - } - } - mSdkLog.info("\n"); - } else { - mSdkLog.info("no skins.\n"); - } - } - - /** - * Displays the ABIs valid for the given target. - */ - @VisibleForTesting(visibility=Visibility.PRIVATE) - void displayAbiList(IAndroidTarget target, String message) { - ISystemImage[] systemImages = target.getSystemImages(); - mSdkLog.info(message); - if (systemImages.length > 0) { - boolean first = true; - for (ISystemImage si : systemImages) { - if (first == false) { - mSdkLog.info(", "); - } else { - first = false; - } - mSdkLog.info(si.getAbiType()); - } - mSdkLog.info("\n"); - } else { - mSdkLog.info("no ABIs.\n"); - } - } - - /** - * Displays the list of available AVDs for the given AvdManager. - * - * @param avdManager - */ - @VisibleForTesting(visibility=Visibility.PRIVATE) - void displayAvdList(AvdManager avdManager) { - - AvdInfo[] avds = avdManager.getValidAvds(); - - // Compact output, suitable for scripts. - if (mSdkCommandLine != null && mSdkCommandLine.getFlagCompact()) { - char eol = mSdkCommandLine.getFlagEolNull() ? '\0' : '\n'; - - for (int index = 0 ; index < avds.length ; index++) { - AvdInfo info = avds[index]; - mSdkLog.info("%1$s%2$c", info.getName(), eol); - } - - return; - } - - mSdkLog.info("Available Android Virtual Devices:\n"); - - for (int index = 0 ; index < avds.length ; index++) { - AvdInfo info = avds[index]; - if (index > 0) { - mSdkLog.info("---------\n"); - } - mSdkLog.info(" Name: %s\n", info.getName()); - mSdkLog.info(" Path: %s\n", info.getDataFolderPath()); - - // get the target of the AVD - IAndroidTarget target = info.getTarget(); - if (target.isPlatform()) { - mSdkLog.info(" Target: %s (API level %s)\n", target.getName(), - target.getVersion().getApiString()); - } else { - mSdkLog.info(" Target: %s (%s)\n", target.getName(), target - .getVendor()); - mSdkLog.info(" Based on Android %s (API level %s)\n", - target.getVersionName(), target.getVersion().getApiString()); - } - mSdkLog.info(" ABI: %s\n", info.getAbiType()); - - // display some extra values. - Map<String, String> properties = info.getProperties(); - if (properties != null) { - String skin = properties.get(AvdManager.AVD_INI_SKIN_NAME); - if (skin != null) { - mSdkLog.info(" Skin: %s\n", skin); - } - String sdcard = properties.get(AvdManager.AVD_INI_SDCARD_SIZE); - if (sdcard == null) { - sdcard = properties.get(AvdManager.AVD_INI_SDCARD_PATH); - } - if (sdcard != null) { - mSdkLog.info(" Sdcard: %s\n", sdcard); - } - String snapshot = properties.get(AvdManager.AVD_INI_SNAPSHOT_PRESENT); - if (snapshot != null) { - mSdkLog.info("Snapshot: %s\n", snapshot); - } - } - } - - // Are there some unused AVDs? - AvdInfo[] badAvds = avdManager.getBrokenAvds(); - - if (badAvds.length == 0) { - return; - } - - mSdkLog.info("\nThe following Android Virtual Devices could not be loaded:\n"); - boolean needSeparator = false; - for (AvdInfo info : badAvds) { - if (needSeparator) { - mSdkLog.info("---------\n"); - } - mSdkLog.info(" Name: %s\n", info.getName() == null ? "--" : info.getName()); - mSdkLog.info(" Path: %s\n", - info.getDataFolderPath() == null ? "--" : info.getDataFolderPath()); - - String error = info.getErrorMessage(); - mSdkLog.info(" Error: %s\n", error == null ? "Uknown error" : error); - needSeparator = true; - } - } - - /** - * Displays the list of available AVDs. - */ - private void displayAvdList() { - try { - AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog); - displayAvdList(avdManager); - } catch (AndroidLocationException e) { - errorAndExit(e.getMessage()); - } - } - - /** - * Creates a new AVD. This is a text based creation with command line prompt. - */ - private void createAvd() { - // find a matching target - int targetId = resolveTargetName(mSdkCommandLine.getParamTargetId()); - IAndroidTarget[] targets = mSdkManager.getTargets(); - - if (targetId == INVALID_TARGET_ID || targetId > targets.length) { - errorAndExit("Target id is not valid. Use '%s list targets' to get the target ids.", - SdkConstants.androidCmdName()); - } - - IAndroidTarget target = targets[targetId-1]; // target id is 1-based - - try { - boolean removePrevious = mSdkCommandLine.getFlagForce(); - AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog); - - String avdName = mSdkCommandLine.getParamName(); - - if (!AvdManager.RE_AVD_NAME.matcher(avdName).matches()) { - errorAndExit( - "AVD name '%1$s' contains invalid characters.\nAllowed characters are: %2$s", - avdName, AvdManager.CHARS_AVD_NAME); - return; - } - - AvdInfo info = avdManager.getAvd(avdName, false /*validAvdOnly*/); - if (info != null) { - if (removePrevious) { - mSdkLog.warning( - "Android Virtual Device '%s' already exists and will be replaced.", - avdName); - } else { - errorAndExit("Android Virtual Device '%s' already exists.\n" + - "Use --force if you want to replace it.", - avdName); - return; - } - } - - String paramFolderPath = mSdkCommandLine.getParamLocationPath(); - File avdFolder = null; - if (paramFolderPath != null) { - avdFolder = new File(paramFolderPath); - } else { - avdFolder = AvdInfo.getDefaultAvdFolder(avdManager, avdName); - } - - // Validate skin is either default (empty) or NNNxMMM or a valid skin name. - Map<String, String> skinHardwareConfig = null; - String skin = mSdkCommandLine.getParamSkin(); - if (skin != null && skin.length() == 0) { - skin = null; - } - - if (skin != null && target != null) { - boolean valid = false; - // Is it a know skin name for this target? - for (String s : target.getSkins()) { - if (skin.equalsIgnoreCase(s)) { - skin = s; // Make skin names case-insensitive. - valid = true; - - // get the hardware properties for this skin - File skinFolder = avdManager.getSkinPath(skin, target); - FileWrapper skinHardwareFile = new FileWrapper(skinFolder, - AvdManager.HARDWARE_INI); - if (skinHardwareFile.isFile()) { - skinHardwareConfig = ProjectProperties.parsePropertyFile( - skinHardwareFile, mSdkLog); - } - break; - } - } - - // Is it NNNxMMM? - if (!valid) { - valid = AvdManager.NUMERIC_SKIN_SIZE.matcher(skin).matches(); - } - - if (!valid) { - displaySkinList(target, "Valid skins: "); - errorAndExit("'%s' is not a valid skin name or size (NNNxMMM)", skin); - return; - } - } - - String abiType = mSdkCommandLine.getParamAbi(); - if (target != null && (abiType == null || abiType.length() == 0)) { - ISystemImage[] systemImages = target.getSystemImages(); - if (systemImages != null && systemImages.length == 1) { - // Auto-select the single ABI available - abiType = systemImages[0].getAbiType(); - mSdkLog.info("Auto-selecting single ABI %1$s\n", abiType); - } else { - displayAbiList(target, "Valid ABIs: "); - errorAndExit("This platform has more than one ABI. Please specify one using --%1$s.", - SdkCommandLine.KEY_ABI); - } - } - - Map<String, String> hardwareConfig = null; - if (target != null && target.isPlatform()) { - try { - hardwareConfig = promptForHardware(target, skinHardwareConfig); - } catch (IOException e) { - errorAndExit(e.getMessage()); - } - } - - @SuppressWarnings("unused") // oldAvdInfo is never read, yet useful for debugging - AvdInfo oldAvdInfo = null; - if (removePrevious) { - oldAvdInfo = avdManager.getAvd(avdName, false /*validAvdOnly*/); - } - - @SuppressWarnings("unused") // newAvdInfo is never read, yet useful for debugging - AvdInfo newAvdInfo = avdManager.createAvd(avdFolder, - avdName, - target, - abiType, - skin, - mSdkCommandLine.getParamSdCard(), - hardwareConfig, - mSdkCommandLine.getFlagSnapshot(), - removePrevious, - false, //edit existing - mSdkLog); - - } catch (AndroidLocationException e) { - errorAndExit(e.getMessage()); - } - } - - /** - * Delete an AVD. If the AVD name is not part of the available ones look for an - * invalid AVD (one not loaded due to some error) to remove it too. - */ - private void deleteAvd() { - try { - String avdName = mSdkCommandLine.getParamName(); - AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog); - AvdInfo info = avdManager.getAvd(avdName, false /*validAvdOnly*/); - - if (info == null) { - errorAndExit("There is no Android Virtual Device named '%s'.", avdName); - return; - } - - avdManager.deleteAvd(info, mSdkLog); - } catch (AndroidLocationException e) { - errorAndExit(e.getMessage()); - } - } - - /** - * Moves an AVD. - */ - private void moveAvd() { - try { - String avdName = mSdkCommandLine.getParamName(); - AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog); - AvdInfo info = avdManager.getAvd(avdName, true /*validAvdOnly*/); - - if (info == null) { - errorAndExit("There is no valid Android Virtual Device named '%s'.", avdName); - return; - } - - // This is a rename if there's a new name for the AVD - String newName = mSdkCommandLine.getParamMoveNewName(); - if (newName != null && newName.equals(info.getName())) { - // same name, not actually a rename operation - newName = null; - } - - // This is a move (of the data files) if there's a new location path - String paramFolderPath = mSdkCommandLine.getParamLocationPath(); - if (paramFolderPath != null) { - // check if paths are the same. Use File methods to account for OS idiosyncrasies. - try { - File f1 = new File(paramFolderPath).getCanonicalFile(); - File f2 = new File(info.getDataFolderPath()).getCanonicalFile(); - if (f1.equals(f2)) { - // same canonical path, so not actually a move - paramFolderPath = null; - } - } catch (IOException e) { - // Fail to resolve canonical path. Fail now since a move operation might fail - // later and be harder to recover from. - errorAndExit(e.getMessage()); - return; - } - } - - if (newName == null && paramFolderPath == null) { - mSdkLog.warning("Move operation aborted: same AVD name, same canonical data path"); - return; - } - - // If a rename was requested and no data move was requested, check if the original - // data path is our default constructed from the AVD name. In this case we still want - // to rename that folder too. - if (newName != null && paramFolderPath == null) { - // Compute the original data path - File originalFolder = new File( - AndroidLocation.getFolder() + AndroidLocation.FOLDER_AVD, - info.getName() + AvdManager.AVD_FOLDER_EXTENSION); - if (info.getDataFolderPath() != null && - originalFolder.equals(new File(info.getDataFolderPath()))) { - try { - // The AVD is using the default data folder path based on the AVD name. - // That folder needs to be adjusted to use the new name. - File f = new File(AndroidLocation.getFolder() + AndroidLocation.FOLDER_AVD, - newName + AvdManager.AVD_FOLDER_EXTENSION); - paramFolderPath = f.getCanonicalPath(); - } catch (IOException e) { - // Fail to resolve canonical path. Fail now rather than later. - errorAndExit(e.getMessage()); - } - } - } - - // Check for conflicts - if (newName != null) { - if (avdManager.getAvd(newName, false /*validAvdOnly*/) != null) { - errorAndExit("There is already an AVD named '%s'.", newName); - return; - } - - File ini = info.getIniFile(); - if (ini.equals(AvdInfo.getDefaultIniFile(avdManager, newName))) { - errorAndExit("The AVD file '%s' is in the way.", ini.getCanonicalPath()); - return; - } - } - - if (paramFolderPath != null && new File(paramFolderPath).exists()) { - errorAndExit( - "There is already a file or directory at '%s'.\nUse --path to specify a different data folder.", - paramFolderPath); - } - - avdManager.moveAvd(info, newName, paramFolderPath, mSdkLog); - } catch (AndroidLocationException e) { - errorAndExit(e.getMessage()); - } catch (IOException e) { - errorAndExit(e.getMessage()); - } - } - - /** - * Updates a broken AVD. - */ - private void updateAvd() { - try { - String avdName = mSdkCommandLine.getParamName(); - AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog); - avdManager.updateAvd(avdName, mSdkLog); - } catch (AndroidLocationException e) { - errorAndExit(e.getMessage()); - } catch (IOException e) { - errorAndExit(e.getMessage()); - } - } - - /** - * Updates adb with the USB devices declared in the SDK add-ons. - */ - private void updateAdb() { - try { - mSdkManager.updateAdb(); - - mSdkLog.info( - "adb has been updated. You must restart adb with the following commands\n" + - "\tadb kill-server\n" + - "\tadb start-server\n"); - } catch (AndroidLocationException e) { - errorAndExit(e.getMessage()); - } catch (IOException e) { - errorAndExit(e.getMessage()); - } - } - - - - /** - * Prompts the user to setup a hardware config for a Platform-based AVD. - * @throws IOException - */ - private Map<String, String> promptForHardware(IAndroidTarget createTarget, - Map<String, String> skinHardwareConfig) throws IOException { - byte[] readLineBuffer = new byte[256]; - String result; - String defaultAnswer = "no"; - - mSdkLog.info("%s is a basic Android platform.\n", createTarget.getName()); - mSdkLog.info("Do you wish to create a custom hardware profile [%s]", - defaultAnswer); - - result = readLine(readLineBuffer).trim(); - // handle default: - if (result.length() == 0) { - result = defaultAnswer; - } - - if (getBooleanReply(result) == false) { - // no custom config, return the skin hardware config in case there is one. - return skinHardwareConfig; - } - - mSdkLog.info("\n"); // empty line - - // get the list of possible hardware properties - File hardwareDefs = new File (mOsSdkFolder + File.separator + - SdkConstants.OS_SDK_TOOLS_LIB_FOLDER, SdkConstants.FN_HARDWARE_INI); - Map<String, HardwareProperty> hwMap = HardwareProperties.parseHardwareDefinitions( - hardwareDefs, null /*sdkLog*/); - - HashMap<String, String> map = new HashMap<String, String>(); - - // we just want to loop on the HardwareProperties - HardwareProperty[] hwProperties = hwMap.values().toArray( - new HardwareProperty[hwMap.size()]); - for (int i = 0 ; i < hwProperties.length ;) { - HardwareProperty property = hwProperties[i]; - - String description = property.getDescription(); - if (description != null) { - mSdkLog.info("%s: %s\n", property.getAbstract(), description); - } else { - mSdkLog.info("%s\n", property.getAbstract()); - } - - String defaultValue = property.getDefault(); - String defaultFromSkin = skinHardwareConfig != null ? skinHardwareConfig.get( - property.getName()) : null; - - if (defaultFromSkin != null) { - mSdkLog.info("%s [%s (from skin)]:", property.getName(), defaultFromSkin); - } else if (defaultValue != null) { - mSdkLog.info("%s [%s]:", property.getName(), defaultValue); - } else { - mSdkLog.info("%s (%s):", property.getName(), property.getType()); - } - - result = readLine(readLineBuffer); - if (result.length() == 0) { - if (defaultFromSkin != null || defaultValue != null) { - if (defaultFromSkin != null) { - // we need to write this one in the AVD file - map.put(property.getName(), defaultFromSkin); - } - - mSdkLog.info("\n"); // empty line - i++; // go to the next property if we have a valid default value. - // if there's no default, we'll redo this property - } - continue; - } - - switch (property.getType()) { - case BOOLEAN: - try { - if (getBooleanReply(result)) { - map.put(property.getName(), "yes"); - i++; // valid reply, move to next property - } else { - map.put(property.getName(), "no"); - i++; // valid reply, move to next property - } - } catch (IOException e) { - // display error, and do not increment i to redo this property - mSdkLog.info("\n%s\n", e.getMessage()); - } - break; - case INTEGER: - try { - Integer.parseInt(result); - map.put(property.getName(), result); - i++; // valid reply, move to next property - } catch (NumberFormatException e) { - // display error, and do not increment i to redo this property - mSdkLog.info("\n%s\n", e.getMessage()); - } - break; - case DISKSIZE: - // TODO check validity - map.put(property.getName(), result); - i++; // valid reply, move to next property - break; - } - - mSdkLog.info("\n"); // empty line - } - - return map; - } - - /** - * Reads a line from the input stream. - * @param buffer - * @throws IOException - */ - private String readLine(byte[] buffer) throws IOException { - int count = System.in.read(buffer); - - // is the input longer than the buffer? - if (count == buffer.length && buffer[count-1] != 10) { - // create a new temp buffer - byte[] tempBuffer = new byte[256]; - - // and read the rest - String secondHalf = readLine(tempBuffer); - - // return a concat of both - return new String(buffer, 0, count) + secondHalf; - } - - // ignore end whitespace - while (count > 0 && (buffer[count-1] == '\r' || buffer[count-1] == '\n')) { - count--; - } - - return new String(buffer, 0, count); - } - - /** - * Reads a line from the input stream, masking it as much as possible. - */ - @SuppressWarnings("unused") - private String promptPassword(String prompt) throws IOException { - - // Setup a thread that tries to overwrite any input by - // masking the last character with a space. This is quite - // crude but is a documented workaround to the lack of a - // proper password getter. - final AtomicBoolean keepErasing = new AtomicBoolean(true); - - Thread eraser = new Thread(new Runnable() { - @Override - public void run() { - while (keepErasing.get()) { - System.err.print("\b "); //$NON-NLS-1$. \b=Backspace - try { - Thread.sleep(10 /*millis*/); - } catch (InterruptedException e) { - // Ignore - } - } - } - }, "eraser"); //$NON-NLS-1$ - - try { - System.err.print(prompt); - eraser.start(); - byte[] buffer = new byte[256]; - return readLine(buffer); - } finally { - keepErasing.set(false); - try { - eraser.join(); - } catch (InterruptedException e) { - // Ignore - } - } - } - - /** - * Returns the boolean value represented by the string. - * @throws IOException If the value is not a boolean string. - */ - private boolean getBooleanReply(String reply) throws IOException { - - for (String valid : BOOLEAN_YES_REPLIES) { - if (valid.equalsIgnoreCase(reply)) { - return true; - } - } - - for (String valid : BOOLEAN_NO_REPLIES) { - if (valid.equalsIgnoreCase(reply)) { - return false; - } - } - - throw new IOException(String.format("%s is not a valid reply", reply)); - } - - private void errorAndExit(String format, Object...args) { - mSdkLog.error(null, format, args); - System.exit(1); - } - - /** - * Converts a symbolic target name (such as those accepted by --target on the command-line) - * to an internal target index id. A valid target name is either a numeric target id (> 0) - * or a target hash string. - * <p/> - * If the given target can't be mapped, {@link #INVALID_TARGET_ID} (0) is returned. - * It's up to the caller to output an error. - * <p/> - * On success, returns a value > 0. - */ - private int resolveTargetName(String targetName) { - - if (targetName == null) { - return INVALID_TARGET_ID; - } - - targetName = targetName.trim(); - - // Case of an integer number - if (targetName.matches("[0-9]*")) { - try { - int n = Integer.parseInt(targetName); - return n < 1 ? INVALID_TARGET_ID : n; - } catch (NumberFormatException e) { - // Ignore. Should not happen. - } - } - - // Let's try to find a platform or addon name. - IAndroidTarget[] targets = mSdkManager.getTargets(); - for (int i = 0; i < targets.length; i++) { - if (targetName.equals(targets[i].hashString())) { - return i + 1; - } - } - - return INVALID_TARGET_ID; - } -} diff --git a/sdkmanager/app/src/main/java/com/android/sdkmanager/SdkCommandLine.java b/sdkmanager/app/src/main/java/com/android/sdkmanager/SdkCommandLine.java deleted file mode 100644 index 6a74c29..0000000 --- a/sdkmanager/app/src/main/java/com/android/sdkmanager/SdkCommandLine.java +++ /dev/null @@ -1,599 +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.sdkmanager; - -import com.android.sdklib.SdkManager; -import com.android.sdklib.repository.SdkRepoConstants; -import com.android.sdklib.util.CommandLineParser; -import com.android.utils.ILogger; - -import java.util.Arrays; - - -/** - * Specific command-line flags for the {@link SdkManager}. - */ -class SdkCommandLine extends CommandLineParser { - - /* - * Steps needed to add a new action: - * - Each action is defined as a "verb object" followed by parameters. - * - Either reuse a VERB_ constant or define a new one. - * - Either reuse an OBJECT_ constant or define a new one. - * - Add a new entry to mAction with a one-line help summary. - * - In the constructor, add a define() call for each parameter (either mandatory - * or optional) for the given action. - */ - - public final static String VERB_LIST = "list"; //$NON-NLS-1$ - public final static String VERB_CREATE = "create"; //$NON-NLS-1$ - public final static String VERB_MOVE = "move"; //$NON-NLS-1$ - public final static String VERB_DELETE = "delete"; //$NON-NLS-1$ - public final static String VERB_UPDATE = "update"; //$NON-NLS-1$ - public final static String VERB_SDK = "sdk"; //$NON-NLS-1$ - public final static String VERB_AVD = "avd"; //$NON-NLS-1$ - - public static final String OBJECT_SDK = "sdk"; //$NON-NLS-1$ - public static final String OBJECT_AVD = "avd"; //$NON-NLS-1$ - public static final String OBJECT_AVDS = "avds"; //$NON-NLS-1$ - public static final String OBJECT_TARGET = "target"; //$NON-NLS-1$ - public static final String OBJECT_TARGETS = "targets"; //$NON-NLS-1$ - public static final String OBJECT_PROJECT = "project"; //$NON-NLS-1$ - public static final String OBJECT_TEST_PROJECT = "test-project"; //$NON-NLS-1$ - public static final String OBJECT_UITEST_PROJECT = "uitest-project"; //$NON-NLS-1$ - public static final String OBJECT_LIB_PROJECT = "lib-project"; //$NON-NLS-1$ - public static final String OBJECT_ADB = "adb"; //$NON-NLS-1$ - - public static final String ARG_ALIAS = "alias"; //$NON-NLS-1$ - public static final String ARG_ACTIVITY = "activity"; //$NON-NLS-1$ - - public static final String KEY_ACTIVITY = ARG_ACTIVITY; - public static final String KEY_PACKAGE = "package"; //$NON-NLS-1$ - public static final String KEY_MODE = "mode"; //$NON-NLS-1$ - public static final String KEY_TARGET_ID = OBJECT_TARGET; - public static final String KEY_NAME = "name"; //$NON-NLS-1$ - public static final String KEY_LIBRARY = "library"; //$NON-NLS-1$ - public static final String KEY_PATH = "path"; //$NON-NLS-1$ - public static final String KEY_FILTER = "filter"; //$NON-NLS-1$ - public static final String KEY_SKIN = "skin"; //$NON-NLS-1$ - public static final String KEY_SDCARD = "sdcard"; //$NON-NLS-1$ - public static final String KEY_FORCE = "force"; //$NON-NLS-1$ - public static final String KEY_RENAME = "rename"; //$NON-NLS-1$ - public static final String KEY_SUBPROJECTS = "subprojects"; //$NON-NLS-1$ - public static final String KEY_MAIN_PROJECT = "main"; //$NON-NLS-1$ - public static final String KEY_NO_UI = "no-ui"; //$NON-NLS-1$ - public static final String KEY_NO_HTTPS = "no-https"; //$NON-NLS-1$ - public static final String KEY_PROXY_PORT = "proxy-port"; //$NON-NLS-1$ - public static final String KEY_PROXY_HOST = "proxy-host"; //$NON-NLS-1$ - public static final String KEY_DRY_MODE = "dry-mode"; //$NON-NLS-1$ - public static final String KEY_ALL = "all"; //$NON-NLS-1$ - public static final String KEY_EXTENDED = "extended"; //$NON-NLS-1$ - public static final String KEY_SNAPSHOT = "snapshot"; //$NON-NLS-1$ - public static final String KEY_COMPACT = "compact"; //$NON-NLS-1$ - public static final String KEY_EOL_NULL = "null"; //$NON-NLS-1$ - public static final String KEY_ABI = "abi"; //$NON-NLS-1$ - public static final String KEY_ACCOUNT = "account"; //$NON-NLS-1$ - public static final String KEY_KEYSTORE = "keystore"; //$NON-NLS-1$ - public static final String KEY_ALIAS = "alias"; //$NON-NLS-1$ - public static final String KEY_STOREPASS = "storepass"; //$NON-NLS-1$ - public static final String KEY_KEYPASS = "keypass"; //$NON-NLS-1$ - public static final String KEY_CLEAR_CACHE = "clear-cache"; //$NON-NLS-1$ - - /** - * Action definitions for SdkManager command line. - * <p/> - * This list serves two purposes: first it is used to know which verb/object - * actions are acceptable on the command-line; second it provides a summary - * for each action that is printed in the help. - * <p/> - * Each entry is a string array with: - * <ul> - * <li> the verb. - * <li> an object (use #NO_VERB_OBJECT if there's no object). - * <li> a description. - * <li> an alternate form for the object (e.g. plural). - * </ul> - */ - private final static String[][] ACTIONS = { - - { VERB_SDK, NO_VERB_OBJECT, - "Displays the SDK Manager window." }, - { VERB_AVD, NO_VERB_OBJECT, - "Displays the AVD Manager window.", - }, - - { VERB_LIST, NO_VERB_OBJECT, - "Lists existing targets or virtual devices." }, - { VERB_LIST, OBJECT_AVD, - "Lists existing Android Virtual Devices.", - OBJECT_AVDS }, - { VERB_LIST, OBJECT_TARGET, - "Lists existing targets.", - OBJECT_TARGETS }, - { VERB_LIST, OBJECT_SDK, - "Lists remote SDK repository." }, - - { VERB_CREATE, OBJECT_AVD, - "Creates a new Android Virtual Device." }, - { VERB_MOVE, OBJECT_AVD, - "Moves or renames an Android Virtual Device." }, - { VERB_DELETE, OBJECT_AVD, - "Deletes an Android Virtual Device." }, - { VERB_UPDATE, OBJECT_AVD, - "Updates an Android Virtual Device to match the folders of a new SDK." }, - - { VERB_CREATE, OBJECT_PROJECT, - "Creates a new Android project." }, - { VERB_UPDATE, OBJECT_PROJECT, - "Updates an Android project (must already have an AndroidManifest.xml)." }, - - { VERB_CREATE, OBJECT_TEST_PROJECT, - "Creates a new Android project for a test package." }, - { VERB_UPDATE, OBJECT_TEST_PROJECT, - "Updates the Android project for a test package (must already have an AndroidManifest.xml)." }, - - { VERB_CREATE, OBJECT_LIB_PROJECT, - "Creates a new Android library project." }, - { VERB_UPDATE, OBJECT_LIB_PROJECT, - "Updates an Android library project (must already have an AndroidManifest.xml)." }, - - { VERB_CREATE, OBJECT_UITEST_PROJECT, - "Creates a new UI test project." }, - - { VERB_UPDATE, OBJECT_ADB, - "Updates adb to support the USB devices declared in the SDK add-ons." }, - - { VERB_UPDATE, OBJECT_SDK, - "Updates the SDK by suggesting new platforms to install if available." }, - }; - - public SdkCommandLine(ILogger logger) { - super(logger, ACTIONS); - - // The following defines the parameters of the actions defined in mAction. - - // --- generic actions that can work on any verb --- - - define(Mode.BOOLEAN, false, - GLOBAL_FLAG_VERB, NO_VERB_OBJECT, ""/*shortName*/, KEY_CLEAR_CACHE, //$NON-NLS-1$ - "Clear the SDK Manager repository manifest cache.", false); //$NON-NLS-1$ - - // --- list avds --- - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_AVD, "c", KEY_COMPACT, //$NON-NLS-1$ - "Compact output (suitable for scripts)", false); - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_AVD, "0", KEY_EOL_NULL, //$NON-NLS-1$ - "Terminates lines with \\0 instead of \\n (e.g. for xargs -0). Only used by --" + KEY_COMPACT + ".", - false); - - // --- list targets --- - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_TARGET, "c", KEY_COMPACT, //$NON-NLS-1$ - "Compact output (suitable for scripts)", false); - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_TARGET, "0", KEY_EOL_NULL, //$NON-NLS-1$ - "Terminates lines with \\0 instead of \\n (e.g. for xargs -0) Only used by --" + KEY_COMPACT + ".", - false); - - // --- create avd --- - - define(Mode.STRING, false, - VERB_CREATE, OBJECT_AVD, "p", KEY_PATH, //$NON-NLS-1$ - "Directory where the new AVD will be created.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_AVD, "n", KEY_NAME, //$NON-NLS-1$ - "Name of the new AVD.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_AVD, "t", KEY_TARGET_ID, //$NON-NLS-1$ - "Target ID of the new AVD.", null); - define(Mode.STRING, false, - VERB_CREATE, OBJECT_AVD, "s", KEY_SKIN, //$NON-NLS-1$ - "Skin for the new AVD.", null); - define(Mode.STRING, false, - VERB_CREATE, OBJECT_AVD, "c", KEY_SDCARD, //$NON-NLS-1$ - "Path to a shared SD card image, or size of a new sdcard for the new AVD.", null); - define(Mode.BOOLEAN, false, - VERB_CREATE, OBJECT_AVD, "f", KEY_FORCE, //$NON-NLS-1$ - "Forces creation (overwrites an existing AVD)", false); - define(Mode.BOOLEAN, false, - VERB_CREATE, OBJECT_AVD, "a", KEY_SNAPSHOT, //$NON-NLS-1$ - "Place a snapshots file in the AVD, to enable persistence.", false); - define(Mode.STRING, false, - VERB_CREATE, OBJECT_AVD, "b", KEY_ABI, //$NON-NLS-1$ - "The ABI to use for the AVD. The default is to auto-select the ABI if the platform has only one ABI for its system images.", - null); - - // --- delete avd --- - - define(Mode.STRING, true, - VERB_DELETE, OBJECT_AVD, "n", KEY_NAME, //$NON-NLS-1$ - "Name of the AVD to delete.", null); - - // --- move avd --- - - define(Mode.STRING, true, - VERB_MOVE, OBJECT_AVD, "n", KEY_NAME, //$NON-NLS-1$ - "Name of the AVD to move or rename.", null); - define(Mode.STRING, false, - VERB_MOVE, OBJECT_AVD, "r", KEY_RENAME, //$NON-NLS-1$ - "New name of the AVD.", null); - define(Mode.STRING, false, - VERB_MOVE, OBJECT_AVD, "p", KEY_PATH, //$NON-NLS-1$ - "Path to the AVD's new directory.", null); - - // --- update avd --- - - define(Mode.STRING, true, - VERB_UPDATE, OBJECT_AVD, "n", KEY_NAME, //$NON-NLS-1$ - "Name of the AVD to update", null); - - // --- list sdk --- - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_SDK, "u", KEY_NO_UI, //$NON-NLS-1$ - "Displays list result on console (no GUI)", true); - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_SDK, "s", KEY_NO_HTTPS, //$NON-NLS-1$ - "Uses HTTP instead of HTTPS (the default) for downloads.", false); - - define(Mode.STRING, false, - VERB_LIST, OBJECT_SDK, "", KEY_PROXY_PORT, //$NON-NLS-1$ - "HTTP/HTTPS proxy port (overrides settings if defined)", - null); - - define(Mode.STRING, false, - VERB_LIST, OBJECT_SDK, "", KEY_PROXY_HOST, //$NON-NLS-1$ - "HTTP/HTTPS proxy host (overrides settings if defined)", - null); - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_SDK, "a", KEY_ALL, //$NON-NLS-1$ - "Lists all available packages (including obsolete and installed ones)", - false); - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_SDK, "o", "obsolete", //$NON-NLS-1$ - "Deprecated. Please use --all instead.", - false); - - define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_SDK, "e", KEY_EXTENDED, //$NON-NLS-1$ - "Displays extended details on each package", - false); - - // --- update sdk --- - - define(Mode.BOOLEAN, false, - VERB_UPDATE, OBJECT_SDK, "u", KEY_NO_UI, //$NON-NLS-1$ - "Updates from command-line (does not display the GUI)", false); - - define(Mode.BOOLEAN, false, - VERB_UPDATE, OBJECT_SDK, "s", KEY_NO_HTTPS, //$NON-NLS-1$ - "Uses HTTP instead of HTTPS (the default) for downloads.", false); - - define(Mode.STRING, false, - VERB_UPDATE, OBJECT_SDK, "", KEY_PROXY_PORT, //$NON-NLS-1$ - "HTTP/HTTPS proxy port (overrides settings if defined)", - null); - - define(Mode.STRING, false, - VERB_UPDATE, OBJECT_SDK, "", KEY_PROXY_HOST, //$NON-NLS-1$ - "HTTP/HTTPS proxy host (overrides settings if defined)", - null); - - define(Mode.BOOLEAN, false, - VERB_UPDATE, OBJECT_SDK, "f", KEY_FORCE, //$NON-NLS-1$ - "Forces replacement of a package or its parts, even if something has been modified.", - false); - - define(Mode.STRING, false, - VERB_UPDATE, OBJECT_SDK, "t", KEY_FILTER, //$NON-NLS-1$ - "A filter that limits the update to the specified types of packages in the form of a comma-separated list of " + - Arrays.toString(SdkRepoConstants.NODES) + - ". This also accepts the identifiers returned by 'list sdk --extended'.", - null); - - define(Mode.BOOLEAN, false, - VERB_UPDATE, OBJECT_SDK, "a", KEY_ALL, //$NON-NLS-1$ - "Includes all packages (such as obsolete and non-dependent ones.)", - false); - - define(Mode.BOOLEAN, false, - VERB_UPDATE, OBJECT_SDK, "p", "obsolete", //$NON-NLS-1$ - "Deprecated. Please use --all instead.", - false); - - define(Mode.BOOLEAN, false, - VERB_UPDATE, OBJECT_SDK, "n", KEY_DRY_MODE, //$NON-NLS-1$ - "Simulates the update but does not download or install anything.", - false); - - // --- create project --- - - /* Disabled for ADT 0.9 / Cupcake SDK 1.5_r1 release. [bug #1795718]. - This currently does not work, the alias build rules need to be fixed. - - define(Mode.ENUM, true, - VERB_CREATE, OBJECT_PROJECT, "m", KEY_MODE, //$NON-NLS-1$ - "Project mode", new String[] { ARG_ACTIVITY, ARG_ALIAS }); - */ - define(Mode.STRING, true, - VERB_CREATE, OBJECT_PROJECT, - "p", KEY_PATH, - "The new project's directory.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_PROJECT, "t", KEY_TARGET_ID, //$NON-NLS-1$ - "Target ID of the new project.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_PROJECT, "k", KEY_PACKAGE, //$NON-NLS-1$ - "Android package name for the application.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_PROJECT, "a", KEY_ACTIVITY, //$NON-NLS-1$ - "Name of the default Activity that is created.", null); - define(Mode.STRING, false, - VERB_CREATE, OBJECT_PROJECT, "n", KEY_NAME, //$NON-NLS-1$ - "Project name.", null); - - // --- create test-project --- - - define(Mode.STRING, true, - VERB_CREATE, OBJECT_TEST_PROJECT, "p", KEY_PATH, //$NON-NLS-1$ - "The new project's directory.", null); - define(Mode.STRING, false, - VERB_CREATE, OBJECT_TEST_PROJECT, "n", KEY_NAME, //$NON-NLS-1$ - "Project name.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_TEST_PROJECT, "m", KEY_MAIN_PROJECT, //$NON-NLS-1$ - "Path to directory of the app under test, relative to the test project directory.", - null); - - // --- create uitest-project --- - - define(Mode.STRING, true, - VERB_CREATE, OBJECT_UITEST_PROJECT, "p", KEY_PATH, //$NON-NLS-1$ - "The new project's directory.", null); - define(Mode.STRING, false, - VERB_CREATE, OBJECT_UITEST_PROJECT, "n", KEY_NAME, //$NON-NLS-1$ - "Project name.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_UITEST_PROJECT, "t", KEY_TARGET_ID, //$NON-NLS-1$ - "Target ID of the new project.", null); - - // --- create lib-project --- - - define(Mode.STRING, true, - VERB_CREATE, OBJECT_LIB_PROJECT, "p", KEY_PATH, //$NON-NLS-1$ - "The new project's directory.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_LIB_PROJECT, "t", KEY_TARGET_ID, //$NON-NLS-1$ - "Target ID of the new project.", null); - define(Mode.STRING, false, - VERB_CREATE, OBJECT_LIB_PROJECT, "n", KEY_NAME, //$NON-NLS-1$ - "Project name.", null); - define(Mode.STRING, true, - VERB_CREATE, OBJECT_LIB_PROJECT, "k", KEY_PACKAGE, //$NON-NLS-1$ - "Android package name for the library.", null); - - // --- update project --- - - define(Mode.STRING, true, - VERB_UPDATE, OBJECT_PROJECT, "p", KEY_PATH, //$NON-NLS-1$ - "The project's directory.", null); - define(Mode.STRING, false, - VERB_UPDATE, OBJECT_PROJECT, "t", KEY_TARGET_ID, //$NON-NLS-1$ - "Target ID to set for the project.", null); - define(Mode.STRING, false, - VERB_UPDATE, OBJECT_PROJECT, "n", KEY_NAME, //$NON-NLS-1$ - "Project name.", null); - define(Mode.BOOLEAN, false, - VERB_UPDATE, OBJECT_PROJECT, "s", KEY_SUBPROJECTS, //$NON-NLS-1$ - "Also updates any projects in sub-folders, such as test projects.", false); - define(Mode.STRING, false, - VERB_UPDATE, OBJECT_PROJECT, "l", KEY_LIBRARY, //$NON-NLS-1$ - "Directory of an Android library to add, relative to this project's directory.", - null); - - // --- update test project --- - - define(Mode.STRING, true, - VERB_UPDATE, OBJECT_TEST_PROJECT, "p", KEY_PATH, //$NON-NLS-1$ - "The project's directory.", null); - define(Mode.STRING, true, - VERB_UPDATE, OBJECT_TEST_PROJECT, "m", KEY_MAIN_PROJECT, //$NON-NLS-1$ - "Directory of the app under test, relative to the test project directory.", null); - - // --- update lib project --- - - define(Mode.STRING, true, - VERB_UPDATE, OBJECT_LIB_PROJECT, "p", KEY_PATH, //$NON-NLS-1$ - "The project's directory.", null); - define(Mode.STRING, false, - VERB_UPDATE, OBJECT_LIB_PROJECT, "t", KEY_TARGET_ID, //$NON-NLS-1$ - "Target ID to set for the project.", null); - - } - - @Override - public boolean acceptLackOfVerb() { - return true; - } - - // -- some helpers for generic action flags - - /** Helper that returns true if --verbose was requested. */ - public boolean hasClearCache() { - return - ((Boolean) getValue(GLOBAL_FLAG_VERB, NO_VERB_OBJECT, KEY_CLEAR_CACHE)).booleanValue(); - } - - /** Helper to retrieve the --path value. */ - public String getParamLocationPath() { - return (String) getValue(null, null, KEY_PATH); - } - - /** - * Helper to retrieve the --target id value. - * The id is a string. It can be one of: - * - an integer, in which case it's the index of the target (cf "android list targets") - * - a symbolic name such as android-N for platforn API N - * - a symbolic add-on name such as written in the avd/*.ini files, - * e.g. "Google Inc.:Google APIs:3" - */ - public String getParamTargetId() { - return (String) getValue(null, null, KEY_TARGET_ID); - } - - /** Helper to retrieve the --name value. */ - public String getParamName() { - return (String) getValue(null, null, KEY_NAME); - } - - /** Helper to retrieve the --skin value. */ - public String getParamSkin() { - return (String) getValue(null, null, KEY_SKIN); - } - - /** Helper to retrieve the --sdcard value. */ - public String getParamSdCard() { - return (String) getValue(null, null, KEY_SDCARD); - } - - /** Helper to retrieve the --force flag. */ - public boolean getFlagForce() { - return ((Boolean) getValue(null, null, KEY_FORCE)).booleanValue(); - } - - /** Helper to retrieve the --snapshot flag. */ - public boolean getFlagSnapshot() { - return ((Boolean) getValue(null, null, KEY_SNAPSHOT)).booleanValue(); - } - - // -- some helpers for avd action flags - - /** Helper to retrieve the --rename value for a move verb. */ - public String getParamMoveNewName() { - return (String) getValue(VERB_MOVE, null, KEY_RENAME); - } - - - // -- some helpers for project action flags - - /** Helper to retrieve the --package value. - * @param directObject the directObject of the action, either {@link #OBJECT_PROJECT} - * or {@link #OBJECT_LIB_PROJECT}. - */ - public String getParamProjectPackage(String directObject) { - return ((String) getValue(null, directObject, KEY_PACKAGE)); - } - - /** Helper to retrieve the --activity for any project action. */ - public String getParamProjectActivity() { - return ((String) getValue(null, OBJECT_PROJECT, KEY_ACTIVITY)); - } - - /** Helper to retrieve the --library value. - * @param directObject the directObject of the action, either {@link #OBJECT_PROJECT} - * or {@link #OBJECT_LIB_PROJECT}. - */ - public String getParamProjectLibrary(String directObject) { - return ((String) getValue(null, directObject, KEY_LIBRARY)); - } - - - /** Helper to retrieve the --subprojects for any project action. */ - public boolean getParamSubProject() { - return ((Boolean) getValue(null, OBJECT_PROJECT, KEY_SUBPROJECTS)).booleanValue(); - } - - // -- some helpers for test-project action flags - - /** Helper to retrieve the --main value. */ - public String getParamTestProjectMain() { - return ((String) getValue(null, null, KEY_MAIN_PROJECT)); - } - - - // -- some helpers for update sdk flags - - /** Helper to retrieve the --no-ui flag. */ - public boolean getFlagNoUI(String verb) { - return ((Boolean) getValue(verb, null, KEY_NO_UI)).booleanValue(); - } - - /** Helper to retrieve the --no-https flag. */ - public boolean getFlagNoHttps() { - return ((Boolean) getValue(null, null, KEY_NO_HTTPS)).booleanValue(); - } - - /** Helper to retrieve the --dry-mode flag. */ - public boolean getFlagDryMode() { - return ((Boolean) getValue(null, null, KEY_DRY_MODE)).booleanValue(); - } - - /** Helper to retrieve the --obsolete flag. */ - public boolean getFlagObsolete() { - return ((Boolean) getValue(null, null, "obsolete")).booleanValue(); - } - - /** Helper to retrieve the --all flag. */ - public boolean getFlagAll() { - return ((Boolean) getValue(null, null, KEY_ALL)).booleanValue(); - } - - /** Helper to retrieve the --extended flag. */ - public boolean getFlagExtended() { - return ((Boolean) getValue(null, null, KEY_EXTENDED)).booleanValue(); - } - - /** Helper to retrieve the --filter value. */ - public String getParamFilter() { - return ((String) getValue(null, null, KEY_FILTER)); - } - - /** Helper to retrieve the --abi value. */ - public String getParamAbi() { - return ((String) getValue(null, null, KEY_ABI)); - } - - /** Helper to retrieve the --proxy-host value. */ - public String getParamProxyHost() { - return ((String) getValue(null, null, KEY_PROXY_HOST)); - } - - /** Helper to retrieve the --proxy-port value. */ - public String getParamProxyPort() { - return ((String) getValue(null, null, KEY_PROXY_PORT)); - } - - // -- some helpers for list avds and list targets flags - - /** Helper to retrieve the --compact value. */ - public boolean getFlagCompact() { - return ((Boolean) getValue(null, null, KEY_COMPACT)).booleanValue(); - } - - /** Helper to retrieve the --null value. */ - public boolean getFlagEolNull() { - return ((Boolean) getValue(null, null, KEY_EOL_NULL)).booleanValue(); - } -} diff --git a/sdkmanager/app/src/test/java/com/android/sdklib/SdkManagerTestCase.java b/sdkmanager/app/src/test/java/com/android/sdklib/SdkManagerTestCase.java deleted file mode 100755 index ab45785..0000000 --- a/sdkmanager/app/src/test/java/com/android/sdklib/SdkManagerTestCase.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (C) 2011 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. - */ - - -/* - Note: this file is duplicated from tools/base/sdklib/src/tests. - The version of sdkmanager-tests in sdk.git does no longer have - access to sdklib-tests. - FIXME: if this generic enough, move it to test-utils. -*/ - -package com.android.sdklib; - - -import com.android.SdkConstants; -import com.android.prefs.AndroidLocation; -import com.android.prefs.AndroidLocation.AndroidLocationException; -import com.android.sdklib.internal.avd.AvdManager; -import com.android.sdklib.io.FileOp; -import com.android.sdklib.mock.MockLog; -import com.android.sdklib.repository.PkgProps; -import com.android.utils.ILogger; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -import junit.framework.TestCase; - -/** - * Test case that allocates a temporary SDK, a temporary AVD base folder - * with an SdkManager and an AvdManager that points to them. - */ -public class SdkManagerTestCase extends TestCase { - - private File mFakeSdk; - private MockLog mLog; - private SdkManager mSdkManager; - private TmpAvdManager mAvdManager; - - /** Returns the {@link MockLog} for this test case. */ - public MockLog getLog() { - return mLog; - } - - /** Returns the {@link SdkManager} for this test case. */ - public SdkManager getSdkManager() { - return mSdkManager; - } - - /** Returns the {@link AvdManager} for this test case. */ - public TmpAvdManager getAvdManager() { - return mAvdManager; - } - - /** - * Sets up a {@link MockLog}, a fake SDK in a temporary directory - * and an AVD Manager pointing to an initially-empty AVD directory. - */ - @Override - public void setUp() throws Exception { - mLog = new MockLog(); - mFakeSdk = makeFakeSdk(); - mSdkManager = SdkManager.createManager(mFakeSdk.getAbsolutePath(), mLog); - assertNotNull("SdkManager location was invalid", mSdkManager); - - mAvdManager = new TmpAvdManager(mSdkManager, mLog); - } - - /** - * Removes the temporary SDK and AVD directories. - */ - @Override - public void tearDown() throws Exception { - deleteDir(mFakeSdk); - } - - /** - * A empty test method to placate the JUnit test runner, which doesn't - * like TestCase classes with no test methods. - */ - public void testPlaceholder() { - } - - /** - * An {@link AvdManager} that uses a temporary directory - * located <em>inside</em> the SDK directory for testing. - * The AVD list should be initially empty. - */ - protected static class TmpAvdManager extends AvdManager { - - /* - * Implementation detail: - * - When the super.AvdManager constructor is invoked, it will invoke - * the buildAvdFilesList() to fill the initial AVD list, which will in - * turn call getBaseAvdFolder(). - * - That's why mTmpAvdRoot is initialized in getAvdRoot() rather than - * in the constructor, since we can't initialize fields before the super() - * call. - */ - - /** - * AVD Root, initialized "lazily" when the AVD root is first requested. - */ - private File mTmpAvdRoot; - - public TmpAvdManager(SdkManager sdkManager, ILogger log) throws AndroidLocationException { - super(sdkManager, log); - } - - @Override - public String getBaseAvdFolder() throws AndroidLocationException { - if (mTmpAvdRoot == null) { - mTmpAvdRoot = new File(getSdkManager().getLocation(), "tmp_avds"); - mTmpAvdRoot.mkdirs(); - } - return mTmpAvdRoot.getAbsolutePath(); - } - } - - /** - * Build enough of a skeleton SDK to make the tests pass. - * <p/> - * Ideally this wouldn't touch the file system but the current - * structure of the SdkManager and AvdManager makes this difficult. - * - * @return Path to the temporary SDK root - * @throws IOException - */ - private File makeFakeSdk() throws IOException { - // First we create a temp file to "reserve" the temp directory name we want to use. - File sdkDir = File.createTempFile( - this.getClass().getSimpleName() + '_' + this.getName(), null); - // Then erase the file and make the directory - sdkDir.delete(); - sdkDir.mkdirs(); - - AndroidLocation.resetFolder(); - File addonsDir = new File(sdkDir, SdkConstants.FD_ADDONS); - addonsDir.mkdir(); - - File toolsDir = new File(sdkDir, SdkConstants.OS_SDK_TOOLS_FOLDER); - toolsDir.mkdir(); - new File(toolsDir, SdkConstants.androidCmdName()).createNewFile(); - new File(toolsDir, SdkConstants.FN_EMULATOR).createNewFile(); - - // TODO makePlatformTools with at least a source props - - File toolsLibEmuDir = new File(sdkDir, SdkConstants.OS_SDK_TOOLS_LIB_FOLDER + "emulator"); - toolsLibEmuDir.mkdirs(); - new File(toolsLibEmuDir, "snapshots.img").createNewFile(); - File platformsDir = new File(sdkDir, SdkConstants.FD_PLATFORMS); - - // Creating a fake target here on down - File targetDir = makeFakeTargetInternal(platformsDir); - - File imagesDir = new File(targetDir, "images"); - makeFakeSysImgInternal(imagesDir, SdkConstants.ABI_ARMEABI); - - makeFakeSkinInternal(targetDir); - makeFakeSourceInternal(sdkDir); - return sdkDir; - } - - /** - * Creates the system image folder and places a fake userdata.img in it. - * - * @param systemImage A system image with a valid location. - * @throws IOException if the file fails to be created. - */ - protected void makeSystemImageFolder(ISystemImage systemImage) throws IOException { - File imagesDir = systemImage.getLocation(); - imagesDir.mkdirs(); - - makeFakeSysImgInternal(imagesDir, systemImage.getAbiType()); - } - - //---- - - /** Utility used by {@link #makeFakeSdk()} to create a fake target with API 0, rev 0. */ - private File makeFakeTargetInternal(File platformsDir) throws IOException { - File targetDir = new File(platformsDir, "v0_0"); - targetDir.mkdirs(); - new File(targetDir, SdkConstants.FN_FRAMEWORK_LIBRARY).createNewFile(); - new File(targetDir, SdkConstants.FN_FRAMEWORK_AIDL).createNewFile(); - - File sourceProp = new File(targetDir, SdkConstants.FN_SOURCE_PROP); - sourceProp.createNewFile(); - FileWriter out = new FileWriter(sourceProp); - out.write(PkgProps.LAYOUTLIB_API + "=5\n"); - out.write(PkgProps.LAYOUTLIB_REV + "=2\n"); - out.close(); - - File buildProp = new File(targetDir, SdkConstants.FN_BUILD_PROP); - out = new FileWriter(buildProp); - out.write(SdkManager.PROP_VERSION_RELEASE + "=0.0\n"); - out.write(SdkManager.PROP_VERSION_SDK + "=0\n"); - out.write(SdkManager.PROP_VERSION_CODENAME + "=REL\n"); - out.close(); - return targetDir; - } - - /** Utility to create a fake sys image in the given folder. */ - private void makeFakeSysImgInternal(File imagesDir, String abiType) throws IOException { - imagesDir.mkdirs(); - new File(imagesDir, "userdata.img").createNewFile(); - - File sourceProp = new File(imagesDir, SdkConstants.FN_SOURCE_PROP); - sourceProp.createNewFile(); - FileWriter out = new FileWriter(sourceProp); - out.write(PkgProps.VERSION_API_LEVEL + "=0\n"); - out.write(PkgProps.SYS_IMG_ABI + "=" + abiType + "\n"); - out.close(); - } - - /** Utility to make a fake skin for the given target */ - private void makeFakeSkinInternal(File targetDir) { - FileOp.append(targetDir, "skins", "HVGA").mkdirs(); - } - - /** Utility to create a fake source with a few files in the given sdk folder. */ - private void makeFakeSourceInternal(File sdkDir) throws IOException { - File sourcesDir = FileOp.append(sdkDir, SdkConstants.FD_PKG_SOURCES, "android-0"); - sourcesDir.mkdirs(); - - File sourceProp = new File(sourcesDir, SdkConstants.FN_SOURCE_PROP); - sourceProp.createNewFile(); - FileWriter out = new FileWriter(sourceProp); - out.write(PkgProps.VERSION_API_LEVEL + "=0\n"); - out.close(); - - File dir1 = FileOp.append(sourcesDir, "src", "com", "android"); - dir1.mkdirs(); - FileOp.append(dir1, "File1.java").createNewFile(); - FileOp.append(dir1, "File2.java").createNewFile(); - - FileOp.append(sourcesDir, "res", "values").mkdirs(); - FileOp.append(sourcesDir, "res", "values", "styles.xml").createNewFile(); - } - - /** - * Recursive delete directory. Mostly for fake SDKs. - * - * @param root directory to delete - */ - private void deleteDir(File root) { - if (root.exists()) { - for (File file : root.listFiles()) { - if (file.isDirectory()) { - deleteDir(file); - } else { - file.delete(); - } - } - root.delete(); - } - } - -} diff --git a/sdkmanager/app/src/test/java/com/android/sdklib/mock/MockLog.java b/sdkmanager/app/src/test/java/com/android/sdklib/mock/MockLog.java deleted file mode 100644 index e64ed51..0000000 --- a/sdkmanager/app/src/test/java/com/android/sdklib/mock/MockLog.java +++ /dev/null @@ -1,84 +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. - */ - - -/* - Note: this file is duplicated from tools/base/sdklib/src/tests. - The version of sdkmanager-tests in sdk.git does no longer have - access to sdklib-tests. - FIXME: if this generic enough, move it to test-utils. -*/ - -package com.android.sdklib.mock; - -import com.android.annotations.NonNull; -import com.android.utils.ILogger; - -import java.util.ArrayList; -import java.util.Formatter; -import java.util.List; - -/** - * An instance of {@link ILogger} that captures all messages to an internal list. - * Messages can be retrieved later using {@link #toString()}. - * Useful for unit-tests. - */ -public class MockLog implements ILogger { - private ArrayList<String> mMessages = new ArrayList<String>(); - - private void add(String code, String format, Object... args) { - Formatter formatter = new Formatter(); - mMessages.add(formatter.format(code + format, args).toString()); - formatter.close(); - } - - @Override - public void warning(@NonNull String format, Object... args) { - add("W ", format, args); - } - - @Override - public void info(@NonNull String format, Object... args) { - add("P ", format, args); - } - - @Override - public void verbose(@NonNull String format, Object... args) { - add("V ", format, args); - } - - @Override - public void error(Throwable t, String format, Object... args) { - if (t != null) { - add("T", "%s", t.toString()); - } - add("E ", format, args); - } - - @Override - public String toString() { - return mMessages.toString(); - } - - @NonNull - public List<String> getMessages() { - return mMessages; - } - - public void clear() { - mMessages.clear(); - } -} diff --git a/sdkmanager/app/src/test/java/com/android/sdkmanager/AvdManagerTest.java b/sdkmanager/app/src/test/java/com/android/sdkmanager/AvdManagerTest.java deleted file mode 100644 index a376490..0000000 --- a/sdkmanager/app/src/test/java/com/android/sdkmanager/AvdManagerTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2010 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.sdkmanager; - -import com.android.SdkConstants; -import com.android.io.FileWrapper; -import com.android.sdklib.IAndroidTarget; -import com.android.sdklib.SdkManagerTestCase; -import com.android.sdklib.internal.avd.AvdInfo; -import com.android.sdklib.internal.project.ProjectProperties; - -import java.io.File; -import java.util.Map; - -public class AvdManagerTest extends SdkManagerTestCase { - - private IAndroidTarget mTarget; - private File mAvdFolder; - - @Override - public void setUp() throws Exception { - super.setUp(); - - mTarget = getSdkManager().getTargets()[0]; - mAvdFolder = AvdInfo.getDefaultAvdFolder(getAvdManager(), getName()); - } - - @Override - public void tearDown() throws Exception { - super.tearDown(); - } - - public void testCreateAvdWithoutSnapshot() { - - getAvdManager().createAvd( - mAvdFolder, - this.getName(), - mTarget, - SdkConstants.ABI_ARMEABI, - null, // skinName - null, // sdName - null, // properties - false, // createSnapshot - false, // removePrevious - false, // editExisting - getLog()); - - assertEquals("[P Created AVD '" + this.getName() + "' based on Android 0.0, ARM (armeabi) processor\n]", - getLog().toString()); - assertTrue("Expected config.ini in " + mAvdFolder, - new File(mAvdFolder, "config.ini").exists()); - Map<String, String> map = ProjectProperties.parsePropertyFile( - new FileWrapper(mAvdFolder, "config.ini"), getLog()); - assertEquals("HVGA", map.get("skin.name")); - assertEquals("platforms/v0_0/skins/HVGA", map.get("skin.path").replace(File.separatorChar, '/')); - assertEquals("platforms/v0_0/images/", map.get("image.sysdir.1").replace(File.separatorChar, '/')); - assertEquals(null, map.get("snapshot.present")); - assertTrue("Expected userdata.img in " + mAvdFolder, - new File(mAvdFolder, "userdata.img").exists()); - assertFalse("Expected NO snapshots.img in " + mAvdFolder, - new File(mAvdFolder, "snapshots.img").exists()); - } - - public void testCreateAvdWithSnapshot() { - - getAvdManager().createAvd( - mAvdFolder, - this.getName(), - mTarget, - SdkConstants.ABI_ARMEABI, - null, // skinName - null, // sdName - null, // properties - true, // createSnapshot - false, // removePrevious - false, // editExisting - getLog()); - - assertEquals("[P Created AVD '" + this.getName() + "' based on Android 0.0, ARM (armeabi) processor\n]", - getLog().toString()); - assertTrue("Expected snapshots.img in " + mAvdFolder, - new File(mAvdFolder, "snapshots.img").exists()); - Map<String, String> map = ProjectProperties.parsePropertyFile( - new FileWrapper(mAvdFolder, "config.ini"), getLog()); - assertEquals("true", map.get("snapshot.present")); - } -} diff --git a/sdkmanager/app/src/test/java/com/android/sdkmanager/MainTest.java b/sdkmanager/app/src/test/java/com/android/sdkmanager/MainTest.java deleted file mode 100644 index 24a644b..0000000 --- a/sdkmanager/app/src/test/java/com/android/sdkmanager/MainTest.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright (C) 2010 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.sdkmanager; - - -import com.android.SdkConstants; -import com.android.sdklib.IAndroidTarget; -import com.android.sdklib.SdkManager; -import com.android.sdklib.SdkManagerTestCase; -import com.android.sdklib.internal.avd.AvdInfo; -import com.android.sdklib.internal.repository.CanceledByUserException; -import com.android.sdklib.internal.repository.DownloadCache; -import com.android.sdklib.internal.repository.DownloadCache.Strategy; -import com.android.sdklib.internal.repository.NullTaskMonitor; -import com.android.sdklib.repository.SdkAddonConstants; -import com.android.sdklib.repository.SdkRepoConstants; -import com.android.utils.Pair; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Set; -import java.util.TreeSet; - -public class MainTest extends SdkManagerTestCase { - - private IAndroidTarget mTarget; - private File mAvdFolder; - - @Override - public void setUp() throws Exception { - super.setUp(); - - mTarget = getSdkManager().getTargets()[0]; - mAvdFolder = AvdInfo.getDefaultAvdFolder(getAvdManager(), getName()); - } - - @Override - public void tearDown() throws Exception { - super.tearDown(); - } - - public void testDisplayEmptyAvdList() { - Main main = new Main(); - main.setLogger(getLog()); - getLog().clear(); - main.displayAvdList(getAvdManager()); - assertEquals("[P Available Android Virtual Devices:\n]", getLog().toString()); - } - - public void testDisplayAvdListOfOneNonSnapshot() { - Main main = new Main(); - main.setLogger(getLog()); - getAvdManager().createAvd( - mAvdFolder, - this.getName(), - mTarget, - SdkConstants.ABI_ARMEABI, - null, // skinName - null, // sdName - null, // properties - false, // createSnapshot - false, // removePrevious - false, // editExisting - getLog()); - - getLog().clear(); - main.displayAvdList(getAvdManager()); - assertEquals( - "[P Available Android Virtual Devices:\n" - + ", P Name: " + this.getName() + "\n" - + ", P Path: " + mAvdFolder + "\n" - + ", P Target: Android 0.0 (API level 0)\n" - + ", P ABI: armeabi\n" - + ", P Skin: HVGA\n" - + "]", - getLog().toString()); - } - - public void testDisplayAvdListOfOneSnapshot() { - Main main = new Main(); - main.setLogger(getLog()); - - getAvdManager().createAvd( - mAvdFolder, - this.getName(), - mTarget, - SdkConstants.ABI_ARMEABI, - null, // skinName - null, // sdName - null, // properties - true, // createSnapshot - false, // removePrevious - false, // editExisting - getLog()); - - getLog().clear(); - main.displayAvdList(getAvdManager()); - assertEquals( - "[P Available Android Virtual Devices:\n" - + ", P Name: " + this.getName() + "\n" - + ", P Path: " + mAvdFolder + "\n" - + ", P Target: Android 0.0 (API level 0)\n" - + ", P ABI: armeabi\n" - + ", P Skin: HVGA\n" - + ", P Snapshot: true\n" - + "]", - getLog().toString()); - } - - public void testDisplayTargetList() { - Main main = new Main(); - main.setLogger(getLog()); - main.setSdkManager(getSdkManager()); - getLog().clear(); - main.displayTargetList(); - assertEquals( - "[P Available Android targets:\n" + - ", P ----------\n" + - ", P id: 1 or \"android-0\"\n" + - ", P Name: Android 0.0\n" + - ", P Type: Platform\n" + - ", P API level: 0\n" + - ", P Revision: 1\n" + - ", P Skins: , P \n" + - ", P ABIs : , P armeabi, P \n" + - "]", - getLog().toString()); - } - - public void testDisplayAbiList() { - Main main = new Main(); - main.setLogger(getLog()); - main.setSdkManager(getSdkManager()); - getLog().clear(); - main.displayAbiList(mTarget, "message"); - assertEquals( - "[P message, P armeabi, P \n" + - "]", - getLog().toString()); - } - - public void testDisplaySkinList() { - Main main = new Main(); - main.setLogger(getLog()); - main.setSdkManager(getSdkManager()); - getLog().clear(); - main.displaySkinList(mTarget, "message"); - assertEquals( - "[P message, P \n" + - "]", - getLog().toString()); - } - - public void testSdkManagerHasChanged() throws IOException { - Main main = new Main(); - main.setLogger(getLog()); - SdkManager sdkman = getSdkManager(); - main.setSdkManager(sdkman); - getLog().clear(); - - assertFalse(sdkman.hasChanged()); - - File addonsDir = new File(sdkman.getLocation(), SdkConstants.FD_ADDONS); - assertTrue(addonsDir.isDirectory()); - - FileWriter readme = new FileWriter(new File(addonsDir, "android.txt")); - readme.write("test\n"); - readme.close(); - - // Adding a file doesn't alter sdk.hasChanged - assertFalse(sdkman.hasChanged()); - sdkman.reloadSdk(getLog()); - assertFalse(sdkman.hasChanged()); - - File fakeAddon = new File(addonsDir, "google-addon"); - fakeAddon.mkdirs(); - File sourceProps = new File(fakeAddon, SdkConstants.FN_SOURCE_PROP); - FileWriter propsWriter = new FileWriter(sourceProps); - propsWriter.write("revision=7\n"); - propsWriter.close(); - - // Adding a directory does alter sdk.hasChanged even if not a real add-on - assertTrue(sdkman.hasChanged()); - // Once reloaded, sdk.hasChanged will be reset - sdkman.reloadSdk(getLog()); - assertFalse(sdkman.hasChanged()); - - // Changing the source.properties file alters sdk.hasChanged - propsWriter = new FileWriter(sourceProps); - propsWriter.write("revision=8\n"); - propsWriter.close(); - assertTrue(sdkman.hasChanged()); - // Once reloaded, sdk.hasChanged will be reset - sdkman.reloadSdk(getLog()); - assertFalse(sdkman.hasChanged()); - } - - public void testCheckFilterValues() { - // These are the values we expect checkFilterValues() to match. - String[] expectedValues = { - "platform", - "system-image", - "tool", - "platform-tool", - "doc", - "sample", - "add-on", - "extra", - "source" - }; - - Set<String> expectedSet = new TreeSet<String>(Arrays.asList(expectedValues)); - - // First check the values are actually defined in the proper arrays - // in the Sdk*Constants.NODES - for (String node : SdkRepoConstants.NODES) { - assertTrue( - String.format( - "Error: value '%1$s' from SdkRepoConstants.NODES should be used in unit-test", - node), - expectedSet.contains(node)); - } - for (String node : SdkAddonConstants.NODES) { - assertTrue( - String.format( - "Error: value '%1$s' from SdkAddonConstants.NODES should be used in unit-test", - node), - expectedSet.contains(node)); - } - - // Now check none of these values are NOT present in the NODES arrays - for (String node : SdkRepoConstants.NODES) { - expectedSet.remove(node); - } - for (String node : SdkAddonConstants.NODES) { - expectedSet.remove(node); - } - assertTrue( - String.format( - "Error: values %1$s are missing from Sdk[Repo|Addons]Constants.NODES", - Arrays.toString(expectedSet.toArray())), - expectedSet.isEmpty()); - - // We're done with expectedSet now - expectedSet = null; - - // Finally check that checkFilterValues accepts all these values, one by one. - Main main = new Main(); - main.setLogger(getLog()); - - for (int step = 0; step < 3; step++) { - for (String value : expectedValues) { - switch(step) { - // step 0: use value as-is - case 1: - // add some whitespace before and after - value = " " + value + " "; - break; - case 2: - // same with some empty arguments that should get ignored - value = " ," + value + " , "; - break; - } - - Pair<String, ArrayList<String>> result = main.checkFilterValues(value); - assertNull( - String.format("Expected error to be null for value '%1$s', got: %2$s", - value, result.getFirst()), - result.getFirst()); - assertEquals( - String.format("[%1$s]", value.replace(',', ' ').trim()), - Arrays.toString(result.getSecond().toArray())); - } - } - } - - public void testLocalFileDownload() throws IOException, CanceledByUserException { - Main main = new Main(); - main.setLogger(getLog()); - SdkManager sdkman = getSdkManager(); - main.setSdkManager(sdkman); - getLog().clear(); - - IAndroidTarget target = sdkman.getTargets()[0]; - File sourceProps = new File(target.getLocation(), SdkConstants.FN_SOURCE_PROP); - assertTrue(sourceProps.isFile()); - - String urlStr = getFileUrl(sourceProps); - assertTrue(urlStr.startsWith("file:///")); - - DownloadCache cache = new DownloadCache(Strategy.DIRECT); - NullTaskMonitor monitor = new NullTaskMonitor(getLog()); - Pair<InputStream, Integer> result = cache.openDirectUrl(urlStr, monitor); - assertNotNull(result); - assertEquals(200, result.getSecond().intValue()); - - int len = (int) sourceProps.length(); - byte[] buf = new byte[len]; - FileInputStream is = new FileInputStream(sourceProps); - is.read(buf); - is.close(); - String expected = new String(buf, "UTF-8"); - - buf = new byte[len]; - result.getFirst().read(buf); - result.getFirst().close(); - String actual = new String(buf, "UTF-8"); - assertEquals(expected, actual); - } - - private String getFileUrl(File file) throws IOException { - // Note: to create a file:// URL, one would typically use something like - // f.toURI().toURL().toString(). However this generates a broken path on - // Windows, namely "C:\\foo" is converted to "file:/C:/foo" instead of - // "file:///C:/foo" (i.e. there should be 3 / after "file:"). So we'll - // do the correct thing manually. - - String path = file.getCanonicalPath(); - if (File.separatorChar != '/') { - path = path.replace(File.separatorChar, '/'); - } - // A file:// should start with 3 // (2 for file:// and 1 to make it an absolute - // path. On Windows that should look like file:///C:/. Linux/Mac will already - // have that leading / in their path so we need to compensate for windows. - if (!path.startsWith("/")) { - path = "/" + path; - } - - // For some reason the URL class doesn't add the mandatory "//" after - // the "file:" protocol name, so it has to be hacked into the path. - URL url = new URL("file", null, "//" + path); //$NON-NLS-1$ //$NON-NLS-2$ - String result = url.toString(); - return result; - - } - -} diff --git a/sdkmanager/app/src/test/java/com/android/sdkmanager/SdkCommandLineTest.java b/sdkmanager/app/src/test/java/com/android/sdkmanager/SdkCommandLineTest.java deleted file mode 100644 index e88d892..0000000 --- a/sdkmanager/app/src/test/java/com/android/sdkmanager/SdkCommandLineTest.java +++ /dev/null @@ -1,189 +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.sdkmanager; - -import com.android.utils.ILogger; -import com.android.utils.StdLogger; - -import junit.framework.TestCase; - -public class SdkCommandLineTest extends TestCase { - - private StdLogger mLog; - - /** - * A mock version of the {@link SdkCommandLine} class that does not - * exits and discards its stdout/stderr output. - */ - public static class MockSdkCommandLine extends SdkCommandLine { - private boolean mExitCalled; - private boolean mHelpCalled; - - public MockSdkCommandLine(ILogger logger) { - super(logger); - } - - @Override - public void printHelpAndExitForAction(String verb, String directObject, - String errorFormat, Object... args) { - mHelpCalled = true; - super.printHelpAndExitForAction(verb, directObject, errorFormat, args); - } - - @Override - protected void exit() { - mExitCalled = true; - } - - @Override - protected void stdout(String format, Object... args) { - // discard - } - - @Override - protected void stderr(String format, Object... args) { - // discard - } - - public boolean wasExitCalled() { - return mExitCalled; - } - - public boolean wasHelpCalled() { - return mHelpCalled; - } - } - - @Override - protected void setUp() throws Exception { - mLog = new StdLogger(StdLogger.Level.VERBOSE); - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** Test list */ - public final void testList_Avd_Verbose() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "-v", "list", "avd" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("list", c.getVerb()); - assertEquals("avd", c.getDirectObject()); - assertTrue(c.isVerbose()); - } - - public final void testList_Target() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "list", "target" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("list", c.getVerb()); - assertEquals("target", c.getDirectObject()); - assertFalse(c.isVerbose()); - } - - public final void testList_None() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "list" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("list", c.getVerb()); - assertEquals("", c.getDirectObject()); - assertFalse(c.isVerbose()); - } - - public final void testList_Invalid() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "list", "unknown" }); - assertTrue(c.wasHelpCalled()); - assertTrue(c.wasExitCalled()); - assertEquals(null, c.getVerb()); - assertEquals(null, c.getDirectObject()); - assertFalse(c.isVerbose()); - } - - public final void testList_Plural() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "list", "avds" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("list", c.getVerb()); - // we get the non-plural form - assertEquals("avd", c.getDirectObject()); - assertFalse(c.isVerbose()); - - c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "list", "targets" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("list", c.getVerb()); - // we get the non-plural form - assertEquals("target", c.getDirectObject()); - assertFalse(c.isVerbose()); - } - - public final void testCreate_Avd() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "create", "avd", "-t", "android-100", "-n", "myProject" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("create", c.getVerb()); - assertEquals("avd", c.getDirectObject()); - assertFalse(c.getFlagSnapshot()); - assertEquals("android-100", c.getParamTargetId()); - assertEquals("myProject", c.getParamName()); - assertFalse(c.isVerbose()); - } - - public final void testCreate_Avd_Snapshot() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "create", "avd", "-t", "android-100", "-n", "myProject", "-a" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("create", c.getVerb()); - assertEquals("avd", c.getDirectObject()); - assertTrue(c.getFlagSnapshot()); - assertEquals("android-100", c.getParamTargetId()); - assertEquals("myProject", c.getParamName()); - assertFalse(c.isVerbose()); - } - - public final void testDirectSdk() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "sdk" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("sdk", c.getVerb()); - assertEquals("", c.getDirectObject()); - assertFalse(c.isVerbose()); - } - - public final void testDirectAvd() { - MockSdkCommandLine c = new MockSdkCommandLine(mLog); - c.parseArgs(new String[] { "avd" }); - assertFalse(c.wasHelpCalled()); - assertFalse(c.wasExitCalled()); - assertEquals("avd", c.getVerb()); - assertEquals("", c.getDirectObject()); - assertFalse(c.isVerbose()); - } - -} diff --git a/sdkmanager/libs/Android.mk b/sdkmanager/libs/Android.mk deleted file mode 100644 index a934aa7..0000000 --- a/sdkmanager/libs/Android.mk +++ /dev/null @@ -1,18 +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. -# -SDKLIBS_LOCAL_DIR := $(call my-dir) -include $(SDKLIBS_LOCAL_DIR)/sdklib/Android.mk -include $(SDKLIBS_LOCAL_DIR)/sdkuilib/Android.mk diff --git a/sdkmanager/libs/sdklib/.classpath b/sdkmanager/libs/sdklib/.classpath deleted file mode 100644 index b2642d7..0000000 --- a/sdkmanager/libs/sdklib/.classpath +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src/main/java"/> - <classpathentry kind="src" path="src/test/java"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> - <classpathentry combineaccessrules="false" kind="src" path="/common"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/commons-compress/commons-compress-1.0.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/commons-codec-1.4.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/commons-logging-1.1.1.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpclient-4.1.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-client-4.1.1-src.zip"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpcore-4.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-core-4.1-src.zip"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpmime-4.1.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-client-4.1.1-src.zip"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/> - <classpathentry combineaccessrules="false" kind="src" path="/dvlib"/> - <classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/sdkmanager/libs/sdklib/.project b/sdkmanager/libs/sdklib/.project deleted file mode 100644 index 97a8578..0000000 --- a/sdkmanager/libs/sdklib/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>SdkLib</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/sdkmanager/libs/sdklib/.settings/org.eclipse.core.resources.prefs b/sdkmanager/libs/sdklib/.settings/org.eclipse.core.resources.prefs deleted file mode 100755 index 3d65728..0000000 --- a/sdkmanager/libs/sdklib/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Mon Aug 29 11:46:20 PDT 2011
-eclipse.preferences.version=1
-encoding//src/test/java/com/android/sdklib/testdata/addon_sample_1.xml=UTF-8
-encoding//src/test/java/com/android/sdklib/io/MockFileOpTest.java=UTF-8
diff --git a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9dbff07..0000000 --- a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,98 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled -org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.ui.prefs b/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100755 index 4712267..0000000 --- a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,55 +0,0 @@ -#Tue Aug 07 12:32:32 PDT 2012 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=false -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=false -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=false -sp_cleanup.remove_trailing_whitespaces_ignore_empty=true -sp_cleanup.remove_unnecessary_casts=false -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/sdkmanager/libs/sdklib/Android.mk b/sdkmanager/libs/sdklib/Android.mk deleted file mode 100644 index c24fc5a..0000000 --- a/sdkmanager/libs/sdklib/Android.mk +++ /dev/null @@ -1,45 +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. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# The sdklib code has moved to tools/base/sdklib. -# The rule below uses the prebuilt sdklib.jar if found. -# -# If you want to run the tests, cd to tools/base -# and run ./gradlew :sdklib:test - -LOCAL_MODULE := sdklib -LOCAL_MODULE_TAGS := optional - -LOCAL_JAVA_LIBRARIES := \ - common \ - commons-codec-1.4 \ - commons-compress-1.0 \ - commons-logging-1.1.1 \ - dvlib \ - guava-tools \ - httpclient-4.1.1 \ - httpcore-4.1 \ - httpmime-4.1.1 \ - mkidentity-prebuilt \ - layoutlib_api - -LOCAL_PREBUILT_JAVA_LIBRARIES := \ - ../../../../prebuilts/devtools/tools/lib/$(LOCAL_MODULE)$(COMMON_JAVA_PACKAGE_SUFFIX) - -include $(BUILD_HOST_PREBUILT) - diff --git a/sdkmanager/libs/sdklib/NOTICE b/sdkmanager/libs/sdklib/NOTICE deleted file mode 100644 index c5b1efa..0000000 --- a/sdkmanager/libs/sdklib/NOTICE +++ /dev/null @@ -1,190 +0,0 @@ - - Copyright (c) 2005-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. - - 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. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - diff --git a/sdkmanager/libs/sdklib/manifest.txt b/sdkmanager/libs/sdklib/manifest.txt deleted file mode 100644 index 5d6cbd8..0000000 --- a/sdkmanager/libs/sdklib/manifest.txt +++ /dev/null @@ -1 +0,0 @@ -Class-Path: layoutlib_api.jar common.jar guava-tools.jar commons-compress-1.0.jar httpclient-4.1.1.jar httpcore-4.1.jar httpmime-4.1.1.jar commons-logging-1.1.1.jar commons-codec-1.4.jar dvlib.jar diff --git a/sdkmanager/libs/sdkuilib/.classpath b/sdkmanager/libs/sdkuilib/.classpath deleted file mode 100644 index 9b127cd..0000000 --- a/sdkmanager/libs/sdkuilib/.classpath +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry excluding="**/Android.mk" kind="src" path="src"/> - <classpathentry excluding="**/Android.mk" kind="src" path="tests"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry combineaccessrules="false" kind="src" path="/sdklib"/> - <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> - <classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swtmenubar.jar" sourcepath="/ANDROID_SRC/sdk/swtmenubar/src"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/commons-codec-1.4.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/commons-logging-1.1.1.jar"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpclient-4.1.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-client-4.1.1-src.zip"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpcore-4.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-core-4.1-src.zip"/> - <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpmime-4.1.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-client-4.1.1-src.zip"/> - <classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/> - <classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/> - <classpathentry combineaccessrules="false" kind="src" path="/common"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/sdkmanager/libs/sdkuilib/.project b/sdkmanager/libs/sdkuilib/.project deleted file mode 100644 index 0fc6a73..0000000 --- a/sdkmanager/libs/sdkuilib/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>SdkUiLib</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 9dbff07..0000000 --- a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,98 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore -org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull -org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault -org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled -org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning -org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning -org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error -org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.ui.prefs b/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100755 index cc5f0a2..0000000 --- a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,55 +0,0 @@ -#Tue Aug 07 12:32:25 PDT 2012 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=false -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=false -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=false -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=false -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/sdkmanager/libs/sdkuilib/Android.mk b/sdkmanager/libs/sdkuilib/Android.mk deleted file mode 100644 index 155da45..0000000 --- a/sdkmanager/libs/sdkuilib/Android.mk +++ /dev/null @@ -1,48 +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. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -# The sdkuilib code has moved to tools/swt/sdkuilib. -# The rule below uses the prebuilt sdkuilib.jar if found. -# -# If you want to run the tests, cd to tools/swt -# and run ./gradlew :sdkuilib:test - -LOCAL_MODULE := sdkuilib -LOCAL_MODULE_TAGS := optional - -LOCAL_JAVA_LIBRARIES := \ - common \ - commons-codec-1.4 \ - commons-compress-1.0 \ - commons-logging-1.1.1 \ - httpclient-4.1.1 \ - httpcore-4.1 \ - httpmime-4.1.1 \ - org.eclipse.jface_3.6.2.M20110210-1200 \ - org.eclipse.equinox.common_3.6.0.v20100503 \ - org.eclipse.core.commands_3.6.0.I20100512-1500 \ - sdklib \ - layoutlib_api \ - swt \ - swtmenubar - -LOCAL_PREBUILT_JAVA_LIBRARIES := \ - ../../../../prebuilts/devtools/tools/lib/$(LOCAL_MODULE)$(COMMON_JAVA_PACKAGE_SUFFIX) - -include $(BUILD_HOST_PREBUILT) - diff --git a/sdkmanager/libs/sdkuilib/NOTICE b/sdkmanager/libs/sdkuilib/NOTICE deleted file mode 100644 index c5b1efa..0000000 --- a/sdkmanager/libs/sdkuilib/NOTICE +++ /dev/null @@ -1,190 +0,0 @@ - - Copyright (c) 2005-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. - - 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. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - diff --git a/sdkmanager/libs/sdkuilib/README b/sdkmanager/libs/sdkuilib/README deleted file mode 100644 index dee4a24..0000000 --- a/sdkmanager/libs/sdkuilib/README +++ /dev/null @@ -1,45 +0,0 @@ -Using the Eclipse project SdkUiLib ----------------------------------- - -1- sdkuilib requires SWT to compile. - -SWT is available in the tree under prebuild/<platform>/swt - -Because the build path cannot contain relative path that are not inside the project directory, -the .classpath file references a user library called ANDROID_SWT. - -In order to compile the project: -- Open Preferences > Java > Build Path > User Libraries -- Create a new user library named ANDROID_SWT -- Add the following 4 JAR files: - - - prebuilt/<platform>/swt/swt.jar - - prebuilt/common/eclipse/org.eclipse.core.commands_3.*.jar - - prebuilt/common/eclipse/org.eclipse.equinox.common_3.*.jar - - prebuilt/common/eclipse/org.eclipse.jface_3.*.jar - - -2- sdkuilib also requires the compiled swtmenubar library. - -Build the swtmenubar library: -$ cd $TOP (top of Android tree) -$ . build/envsetup.sh && lunch sdk-eng -$ sdk/eclipse/scripts/create_sdkman_symlinks.sh - -Define a classpath variable in Eclipse: -- Open Preferences > Java > Build Path > Classpath Variables -- Create a new classpath variable named ANDROID_OUT_FRAMEWORK -- Set its folder value to <Android tree>/out/host/<platform>/framework -- Create a new classpath variable named ANDROID_SRC -- Set its folder value to <Android tree> - -You might need to clean the SdkUiLib project (Project > Clean...) after -you add the new classpath variable, otherwise previous errors might not -go away automatically. - -The ANDROID_SRC part should be optional. It allows you to have access to -the SwtMenuBar generic parts from the Java editor. - - --- -EOF diff --git a/sdkmanager/libs/sdkuilib/etc/manifest.txt b/sdkmanager/libs/sdkuilib/etc/manifest.txt deleted file mode 100644 index 37def3a..0000000 --- a/sdkmanager/libs/sdkuilib/etc/manifest.txt +++ /dev/null @@ -1 +0,0 @@ -Class-Path: sdklib.jar layoutlib_api.jar common.jar commons-compress-1.0.jar httpclient-4.1.1.jar httpcore-4.1.jar httpmime-4.1.1.jar commons-logging-1.1.1.jar commons-codec-1.4.jar swtmenubar.jar swt.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar |