aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/libs/sdklib
Commit message (Collapse)AuthorAgeFilesLines
...
* Add-ons do not support codenames.Raphael Moll2011-08-126-28/+58
| | | | | | | | | | | There was a typo in the repository XSD and the addon XSD that had an optional 'codename' element to the addon type. Since it's optional and (should have) never beend used, it's safe to remove it and document why we're removing it without spinning a new XSD version. Also added a unit-test to enforce it's invalid to have. Change-Id: Id3c5725c022d86ac0f46532efe25ac5c000c1af7
* SDK Manager: don't retry source if http auth canceled by user.Raphael Moll2011-08-123-25/+42
| | | | | | | | | | This fixes a minor workflow issue the case of an SDK source using a Basic HTTP Auth: if the user cancels the login dialog, we don't try to be smart and try alternate URLs. It actually means the URL was just fine but the user didn't want to authenticate. Change-Id: If85dc2e01e30ff26decb78088bd912da785a89f9
* Cleanup a few warnings in SdkLib.Raphael Moll2011-08-1110-44/+73
| | | | Change-Id: Ie8429f077b7e3a2a7166b6fcd7b9454c9bc47088
* Add support for authenticated add-on servers.Pablo Leite2011-08-1110-38/+263
| | | | | | | | | | | Displays a login prompt if necessary. Note: This code depends on Apache http-client libraries. Build files had been modified in order to add this dependency. http-client libraries had also be added on prebuilt project. prebuilt changeID=I084d78dd09a431bc3a2d77e77810b84c693bdcb7 GerritLink=https://review.source.android.com/#change,23387 Change-Id: Icada9b41a21fe3aacef9a1eff209a3fe5591a4e0
* SDK Manager: Fix display of Archive sizes.Raphael Moll2011-07-292-4/+134
| | | | | | SDK Issue: 18875 Change-Id: I702e11cff07bded8e90d415541040fc06ceb7d49
* Style: space after synchronized (object) {...}Raphael Moll2011-07-271-10/+10
| | | | | | | | For keywords such as if, for, while, we put a space between the keyword and the expression. Same should go for synchronized (object) {}. Change-Id: I5b145912f9346e3f4d8367865c2729abea68fdbc
* SDK Manager2: Revamp progress bar handling.Raphael Moll2011-07-276-17/+182
| | | | Change-Id: Ic5751f5c86f7cd4cf31927d83368a7fcb432e216
* SDK Man2: Clear local source caches when reloading.Raphael Moll2011-07-261-0/+16
| | | | Change-Id: I984ae397ada014ff8869d5775be1bc779ef22319
* SDK Manager2: revamp package diff logic.Raphael Moll2011-07-259-0/+446
| | | | | | | | | | | | | | This revamps the diff algorithm used to merge the local and remote packages found during a repository load into the PkgItems displayed in the tree viewer. FYI all the Package and Archive sub-classes are getting an equals() and hashCode() methods to make them behave correctly when put it in a HashTable or Set. These are the auto-generated stuff from Eclipse. Change-Id: I1494a0ed44cd768eed252e3a81b9e74bf86d563c
* Merge "SDK Manager 2: incremental sort when sorting by source + UT"Raphael Moll2011-07-207-11/+61
|\
| * SDK Manager 2: incremental sort when sorting by source + UTRaphael Moll2011-07-167-11/+61
| | | | | | | | | | | | | | | | Also fixes some edge cases with the sort-by-api and ensure switching between sorts doesn't mess too much with the packages shown. Change-Id: I7da43915f4e48bd6cd80760a6a15d657777fa0f7
* | Android project's output for JDT is now bin/classes/Xavier Ducrohet2011-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This matches the bin structure of the Ant build system where the javac output is in bin/classes/ and the Android specific files are in bin/ Also, this will allow us better control of android output files as they won't conflict with javac's output. New projects are created with this setup and existing projects are converted as they are opened. Change-Id: I83339906b0d43d7a988a75927c60b664c183d27f
* | Merge "Read the default skin from sdk.properties."Xavier Ducrohet2011-07-172-2/+12
|\ \ | |/ |/|
| * Read the default skin from sdk.properties.Xavier Ducrohet2011-07-172-2/+12
| | | | | | | | Change-Id: Ifad6f2186e499f579df1608055dda4eca1084830
* | SdkManager: fix issue with double-packages on reload.Raphael Moll2011-07-134-17/+99
|/ | | | | | | Rewrote the merge in place + sort of packages by API. Did some refactoring + added some unit tests. Change-Id: I168b306853185866606ed76c324a8db6051b15bb
* Add "android create avd --abi" parameter.Raphael Moll2011-07-081-5/+3
| | | | | | SDK bug 4965341 Change-Id: Iaff42d1272a9c10ba62534c5d478e35e6c2df6e5
* SdkManager2: fixes for asynchronous sources UI.Raphael Moll2011-06-302-1/+19
| | | | | | | | | - Properly refresh display list when installing/deleting a package. - Gray install/delete buttons during an install/delete to avoid nesting operations. Change-Id: I72fdca1252c447b046040afb70e67dfae77188e4
* Fix SDK Manager unit tests.Raphael Moll2011-06-302-18/+18
| | | | | | | These got broken after I've fixed the sort order of extra packages in SDK Manager 2. Change-Id: Ie18f3fb74f800ac855680be29a7932f8c8d9f54c
* Sdkman2: Load sources asynchronously.Raphael Moll2011-06-262-51/+70
| | | | Change-Id: Ic79b987ce8594e7bfe30b32e961b9384e2538b6b
* Sdkman2: Simplify packages names, fix extra package sort.Raphael Moll2011-06-232-20/+75
| | | | | | | | | | | | | Simplify package names when sorted by API, that is don't repeat "API nn" or "Android x.y" in the package names if it matches to category. Fix sorting of packages to properly sort extras by vendor+path. The previous sort was broken as it was making the revision number more important than the vendor+path for extras. Change-Id: I51ed0114ab9c77ef5d94710fc2449e5be9cd2ad9
* Add cpu.model to AVD running armeabi-v7a system images.Xavier Ducrohet2011-06-163-18/+31
| | | | Change-Id: I5b97b115ada432e284ad2dd3c69bcf7009677aec
* Properly handle CPU Arch/ABI in AVDs.Xavier Ducrohet2011-06-105-56/+44
| | | | | | | | | | | | | | | | | | | | | When we introduced x86 support in the tree there was no generic emulator exe able to act as a launcher to the -arm and -x86 versions of the emulator. This exe is now present and packaged with the SDK, so we remove the code to launch either arch specific version and instead make the AVD Manager and ADT simply launch the normal emulator once again. (This has the side effect of making ADT 12 able to run on Tools r11 and below.) For this to run though, hw.cpu.arch must be set in the AVD if the arch is not arm. The new AVD manager sets this properly. Also fixed some issues from my previous fix to the hardware property. Now the list contains all of them but there's a isValidForUi that's used to not show up some prop in the UI. Change-Id: I7a264a59cb3c5051ff62f6103da9663c7b7eb22f
* Make String-based hw prop not recognized.Xavier Ducrohet2011-06-101-3/+11
| | | | | | | | | Currently all those strings aren't set to be viewed by the user in the AVD UI so we ignore them. In the future we should use a specific flag to ignore some (like avd.name) and allow others. Change-Id: Icab59bcc0b97c14fa14b786c737457434b7f51ac
* Fix various warningsTor Norbye2011-06-091-1/+8
| | | | | | | | | | | | | I ran the latest version of findbugs on our codebase and fixed some (not all!) of the warnings. I also ran with Eclipse 3.7 RC3 and updated our compiler warning settings for the new warnings that are available. I also fixed some DOS line endings in some files (formatted with CRLF instead of LF). Change-Id: I9a9d34a9b60f2cb609245793815d96a4587007b0
* do not package .scala files as resourcesMatthias Granberry2011-06-061-0/+1
| | | | Change-Id: I8b0ac703fd60517f8c7857e7f7ce316e08ab51be
* Repository XML for R12: layoutlib version for addons.Raphael Moll2011-05-2511-76/+270
| | | | Change-Id: I5e68225ae8fb12a845e1eeec7412bf0bf7d9d676
* Merge "Add support for addon providing their own layoutlib and/or res."Xavier Ducrohet2011-05-256-12/+101
|\
| * Add support for addon providing their own layoutlib and/or res.Xavier Ducrohet2011-05-256-12/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During addon parsing, the SDK Manager will detect whether the addon has: - data/layoutlib.jar - data/res/ - data/fonts/ if the first one is present, then it is used during rendering. if *both* the 2nd and 3rd ones are present, then addon resources are used during rendering. On the GLE side, all that's needed is adding addons to the list of rendering targets if they have either library or resources (or both). Change-Id: Id16925eea2c98b9fbaaa884ac6fd8c1c1c444db2
* | Fix flaky SdkRepository test.Raphael Moll2011-05-253-22/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | It seems like class.getResourceAsStream throws a NullPointerException on the test machines whereas it returns null (as documented) other times when the resource is not found. This patch refactors 2 duplicated getXsdStream methods in the base RepoConstants and adjusts to take both behaviors into account. Change-Id: Ieefd92a006efda30828b8043e39f6b7e904bc53f
* | Prevent 'make sdk_repo' from picking up future schemas.Raphael Moll2011-05-245-2/+43
| | | | | | | | Change-Id: I749f4727b4c257ef5a6177b05727f5944d5d81ed
* | Merge "New Repository XSD for R12."Raphael Moll2011-05-2418-28/+2116
|\ \ | |/ |/|
| * New Repository XSD for R12.Raphael Moll2011-05-2418-28/+2116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This add a new schema sdk-repository-4 with the following changes: - <extra> element now has a <project-files> element that contains 1 or or more <path>, each indicating the relative path of a file that this package can contribute to installed projects. - <platform> element now has a mandatory <layoutlib> that indicates the API and revision of that layout library for this particular platform. There's also a matching sdk-addon-2 schema with the same modification to the <extra> element. Change-Id: Id74a5d09dfa36d65f11b9d60a82fe8ba4119eb34
* | Use sdklib.OsHelper in AddCompatibilityJarAction.Raphael Moll2011-05-243-16/+78
|/ | | | | | | | | | | | | ADT's AddCompatibilityJarAction defined 2 new generic useful methods, copyFile and isSameFile. SdkLib already had an OsHelper.copyFile, so I moved that class to a more generic sdklib.io package and added the new method isSameFile. Another suitable candidate would have been io.FileWrapper in the common project. Change-Id: If310e09af112c5f4d87a253b35e67e4f5adb34da
* SdkMan2: Use IDE's log when available.Raphael Moll2011-05-201-8/+41
| | | | Change-Id: Iede7f4f9c1a7bbfbdcbb096f489616478ba94465
* Basic fragment supportTor Norbye2011-05-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | This changeset adds preliminary support for fragments: * Add <fragment> to the palette, along with a drop handler which pops up a class chooser to pick the Fragment class; all project implementations of android.app.Fragment and android.support.v4.app.Fragment are listed. * Adds a fragment descriptor such that code completion works for <fragment> elements * Fix project callback such that it does not complain about a missing class "fragment". * Fix outline to display the name of the fragment rather than the fragment tag name. * This changeset also centers the label in MockViews since those are still used to render fragments Change-Id: I6e062970b335d9c95870f181ed408960978c423e
* SdkManager: handle missing platforms/ and add-ons/ folders.Raphael Moll2011-05-021-15/+29
| | | | | | | | | | | | | | | | | | | | | A while ago, when we were dealing with monolithics SDKs, the strategy was that we wanted to make sure that the 'android' command was invoked from a properly setup SDK folder. Consequently the SdkManager required at least the platforms/ and add-ons/ folders to be present, even if empty. I don't think that behavior is really necessary anymore. The 'android' tool is invoked with knowledge from its tools folder, so we can safely assume the top parent is "the SDK folder" and create these directories if they are missing. We do however try to create them as early as possible if they are missing, so that the tool aborts early if we can't create them. The other alternative would be to just try to create them when we're actually installing a package. Change-Id: I8ea58f23add89c2dac0a22142f6fb5e71b8203aa
* Fix SdkManager unit tests. Refactor AvdInfo.Raphael Moll2011-04-282-337/+406
| | | | | | | | | | | | | | | | | | | | | | | | A couple issues with the current unit tests: - It was correctly allocating a temporary SDK folder. - It was correctly creating temporary AVDs in a temp folder. - However it was still using the regular AVD root for the AVD ini files and leaving them behind. - Minor windows dir-sep issue. This replaces the SdkManagerTestUtils class by a new base TestClass specific to SDK testing that creates both the temporary SDK and AVD manager and correctly overrides the AVD root. One issue is that we have different ways to find what the correct AVD Root is and the default paths used for an AvdInfo where setup using static methods, making them impossible to override in unit tests. This refactors AvdInfo out of AvdManager and most important there's a single non-static method, AvdManager.getBaseAvdFolder(), that is used to know where AVDs should be stored. Change-Id: I4270203f52de15ca9418e9b4f1bf61dbc843c218
* When possible use File.setExecutable instead of doing an exec of chmod.Xavier Ducrohet2011-04-211-3/+51
| | | | Change-Id: I2b2f79bb07e277a1f2caa62b4100cbd8f7e8328d
* When unarchiving install, files that need +x don't need +w too.Xavier Ducrohet2011-04-211-2/+2
| | | | Change-Id: I860c28fa979a1d8673abd9690014b8b28c6e8d7e
* Change logging API used by ITaskMonitor.Raphael Moll2011-04-1510-80/+133
| | | | | | | | | | | | | | | | | | | | | | ITaskMonitor is used by the SDK Manager to display status information and progress bar for asynchronous tasks (e.g. fetching sources, downloading and installing packages). This changes the way text is logged by the monitor. There used to be one setResult() method which historically was designed to report 1 final message (e.g. "Install completed") but then this was actually used to add ongoing logging. So in this change the monitor has 3 replacement methods: log, logError and logVerbose, which gives us more flexibility in controlling what gets displayed. As a side effect, this fixes unit-tests from SdkLib that relied on previous output that changed in a recent CL. Change-Id: I0fa41d59db8f5eea478b88208695ef07e246ba30
* Merge "SDK Manager command line install improvements."Raphael Moll2011-04-152-5/+9
|\
| * SDK Manager command line install improvements.Raphael Moll2011-04-092-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1- In no-ui mode, the "update sdk" command was missing the add-on filter type, e.g.: $ android update sdk --no-ui --filter add-on This restores it and adds a unit-test to make sure the cmd line check is in sync with the array definitions. 2- Adds a new command line option "list sdk" to list all possible packages that can be found and updated from the remote sites. The list has indexes which can then be used with the "update sdk --filter" option to pick specific packages to install. Example: $ android list sdk Packages available for install: 7 1- Android SDK Tools, revision 10 2- Documentation for Android SDK, API 11, revision 1 ... $ android update sdk --no-ui --filter doc,3,7 This will install "all doc packages" as well as the packages 3 and 7 mentioned in the "list sdk" output. 3- Changed the "--obsolete" flag to list not only obsolete packages but actually *all* packages. This works around the issue that the SDK Manager tries, by default, to only show unknown platforms that are higher than whatever is currently installed, so there was no way with the UI to install an older platform (e.g. if you had API 11 installed, it would not list APIS 3-10 for new installation.) I'll revisit this behavior later. SDK Issue: http://code.google.com/p/android/issues/detail?id=15933 Change-Id: I7626257c39602908058eb7359b4c98cc3f54eef3
* | SDK Manager: Fix detection of emulator in tools local folder.Raphael Moll2011-04-111-1/+5
|/ | | | | | | | | | | | | | | That's because the constant used did not have the extension anymore. Note: this was only an issue on Windows since mac/linux don't need the .exe extension in emulator. Also this doesn't fix the missing "emulator.exe" in AOSP, but digit has the CL for that. So in AOSP one need to manually copy tools/emulator-arm to tools/emulator for the local tools package to be correctly recognized. Change-Id: I9ab254eec5c28c4d006ba4132d6b0c6d87c01e15
* Make debug key expire in 30 years (instead of 1).Raphael Moll2011-04-052-19/+144
| | | | | | | | | | | | | The 1 year expiration on the default debug key is made annoying since we don't regenerate it automatically when it expires. Also added a simple unit test to check key creation and expiration date. SDK Bug: http://code.google.com/p/android/issues/detail?id=15370 Change-Id: Ie1ee14d8888275c2dae282bfb1235af54753ac0e
* Pick layout themes from manifest registrations and target SDKTor Norbye2011-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset changes the way the layout editor picks themes when a layout is opened. It used to just pick the first available theme in the theme chooser. Now it performs the following checks, in order: * Does this layout have a persisted theme setting from a previous run of the tool? If yes, use it. * Can the activity for this layout be determined? If so, look at the manifest registration for the corresponding activity, and if it specifies a theme, use it. * If not, does the manifest specify a default theme for the project? If so, use it. * If not, is the target SDK version (or the minimum SDK version, if the target is not specified) at least API level 11 or higher? If so, the default theme is "Theme.Holo" * If not, the default theme is "Theme". * If the file to be opened is included from some other layout, use the no-decorations versions of the default layouts, e.g. Theme.NoTitleBar or Theme.Holo.NoActionBar. * At the end of this resolution, the computed theme is stored as the persisted theme setting for this layout, so the above algorithm will only be computed once. We might want to tweak this such that it distinguishes between a default computation of a theme and a manual user choice of a theme. * If the file is opened as "Show Included In" (e.g. rendered within an outer file) then the theme chosen is the one for the outer file. During startup, this information will be asked for each and every layout being reopened, so there is now a "ManifestInfo" class attached to the project which keeps manifest information around. It checks the timestamp of the AndroidManifest.xml file and refreshes its information lazily if necessary. All themes mentioned in the manifest are listed in a special section at the top of the theme chooser (below the entry for the default computed described above). The code to look up the associated Activity of a layout is using a simple heuristic: it looks for usages of the corresponding R.layout field, and prefers references from methods called onCreate or in classes whose superclass name ends with Activity. I tried a different approach where I searched for usages of Activity.setContentView(int) but this failed to identify a number of cases where the activity was doing some simple logic and didn't pass the layout id directly as a parameter in setContentView, so I went back to the basic approach. Change-Id: Ibd3c0f089fefe38e6e6c607d65524990699c86d3
* Fix AvdManager to correctly find emulator in AOSP.Raphael Moll2011-03-221-1/+17
| | | | | | | This is a temporary workaround on the lack of a main "emulator" binary in AOSP, which will be fixed later. Change-Id: I61f03ed8a54a410469f95a1100ef38eef7ab4bf6
* Merge "SDK Manager dialog to manage user add-on sites."Raphael Moll2011-03-212-2/+10
|\
| * SDK Manager dialog to manage user add-on sites.Raphael Moll2011-03-162-2/+10
| | | | | | | | Change-Id: I36209964b8a59c6f8b987032e175849a35cf467a
* | Merge "Revamp of the SDK Manager UI."Raphael Moll2011-03-219-15/+162
|\ \ | |/
| * Revamp of the SDK Manager UI.Raphael Moll2011-03-169-15/+162
| | | | | | | | | | | | | | | | | | | | | | | | This replaces the Installed Packages and Available Packages page by a single one that combines both installed and available updates. This is still experimental and is actually not enabled unless the env var EXPERIMENTAL is set. Change-Id: I5ec5776da69d2668ce746c07df022bf5adc6fbf7