From b26189333d3db21355daa3131b9f5e69f3044c2e Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Tue, 15 Mar 2011 12:10:31 -0700 Subject: Add missing notice files. Also fix some makefiles to make sure the notices are picked up. - move the makefile outside of the source folder. - resources are now in the source folder directly instead of being inside src/resources. It's much simpler. Change-Id: Ica8ee4c2bc8a9b035d23fc914d4137cdca7e567d --- androidprefs/Android.mk | 12 +- androidprefs/NOTICE | 190 +++++++++ androidprefs/src/Android.mk | 24 -- anttasks/Android.mk | 18 +- anttasks/NOTICE | 190 +++++++++ anttasks/src/Android.mk | 29 -- apkbuilder/NOTICE | 190 +++++++++ archquery/Android.mk | 15 +- archquery/NOTICE | 190 +++++++++ archquery/src/Android.mk | 25 -- common/NOTICE | 190 +++++++++ ddms/app/.classpath | 3 +- ddms/app/Android.mk | 30 +- ddms/app/NOTICE | 190 +++++++++ ddms/app/src/Android.mk | 26 -- ddms/app/src/images/ddms-icon.png | Bin 0 -> 3633 bytes ddms/app/src/images/ddms-logo.png | Bin 0 -> 3633 bytes ddms/app/src/resources/images/ddms-icon.png | Bin 3633 -> 0 bytes ddms/app/src/resources/images/ddms-logo.png | Bin 3633 -> 0 bytes ddms/libs/ddmlib/Android.mk | 1 + ddms/libs/ddmlib/NOTICE | 190 +++++++++ ddms/libs/ddmuilib/.classpath | 3 +- ddms/libs/ddmuilib/Android.mk | 28 +- ddms/libs/ddmuilib/NOTICE | 190 +++++++++ ddms/libs/ddmuilib/src/Android.mk | 27 -- ddms/libs/ddmuilib/src/images/add.png | Bin 0 -> 146 bytes ddms/libs/ddmuilib/src/images/android.png | Bin 0 -> 3609 bytes ddms/libs/ddmuilib/src/images/backward.png | Bin 0 -> 136 bytes ddms/libs/ddmuilib/src/images/capture.png | Bin 0 -> 691 bytes ddms/libs/ddmuilib/src/images/clear.png | Bin 0 -> 217 bytes ddms/libs/ddmuilib/src/images/d.png | Bin 0 -> 638 bytes ddms/libs/ddmuilib/src/images/debug-attach.png | Bin 0 -> 156 bytes ddms/libs/ddmuilib/src/images/debug-error.png | Bin 0 -> 222 bytes ddms/libs/ddmuilib/src/images/debug-wait.png | Bin 0 -> 156 bytes ddms/libs/ddmuilib/src/images/delete.png | Bin 0 -> 107 bytes ddms/libs/ddmuilib/src/images/device.png | Bin 0 -> 135 bytes ddms/libs/ddmuilib/src/images/down.png | Bin 0 -> 141 bytes ddms/libs/ddmuilib/src/images/e.png | Bin 0 -> 511 bytes ddms/libs/ddmuilib/src/images/edit.png | Bin 0 -> 223 bytes ddms/libs/ddmuilib/src/images/empty.png | Bin 0 -> 75 bytes ddms/libs/ddmuilib/src/images/emulator.png | Bin 0 -> 287 bytes ddms/libs/ddmuilib/src/images/file.png | Bin 0 -> 157 bytes ddms/libs/ddmuilib/src/images/folder.png | Bin 0 -> 123 bytes ddms/libs/ddmuilib/src/images/forward.png | Bin 0 -> 137 bytes ddms/libs/ddmuilib/src/images/gc.png | Bin 0 -> 165 bytes ddms/libs/ddmuilib/src/images/halt.png | Bin 0 -> 197 bytes ddms/libs/ddmuilib/src/images/heap.png | Bin 0 -> 222 bytes ddms/libs/ddmuilib/src/images/hprof.png | Bin 0 -> 317 bytes ddms/libs/ddmuilib/src/images/i.png | Bin 0 -> 498 bytes ddms/libs/ddmuilib/src/images/importBug.png | Bin 0 -> 191 bytes ddms/libs/ddmuilib/src/images/load.png | Bin 0 -> 163 bytes ddms/libs/ddmuilib/src/images/pause.png | Bin 0 -> 98 bytes ddms/libs/ddmuilib/src/images/play.png | Bin 0 -> 138 bytes ddms/libs/ddmuilib/src/images/pull.png | Bin 0 -> 329 bytes ddms/libs/ddmuilib/src/images/push.png | Bin 0 -> 228 bytes ddms/libs/ddmuilib/src/images/save.png | Bin 0 -> 240 bytes ddms/libs/ddmuilib/src/images/sort_down.png | Bin 0 -> 102 bytes ddms/libs/ddmuilib/src/images/sort_up.png | Bin 0 -> 105 bytes ddms/libs/ddmuilib/src/images/thread.png | Bin 0 -> 121 bytes ddms/libs/ddmuilib/src/images/tracing_start.png | Bin 0 -> 227 bytes ddms/libs/ddmuilib/src/images/tracing_stop.png | Bin 0 -> 217 bytes ddms/libs/ddmuilib/src/images/up.png | Bin 0 -> 134 bytes ddms/libs/ddmuilib/src/images/v.png | Bin 0 -> 587 bytes ddms/libs/ddmuilib/src/images/w.png | Bin 0 -> 681 bytes ddms/libs/ddmuilib/src/images/warning.png | Bin 0 -> 147 bytes ddms/libs/ddmuilib/src/resources/images/add.png | Bin 146 -> 0 bytes .../libs/ddmuilib/src/resources/images/android.png | Bin 3609 -> 0 bytes .../ddmuilib/src/resources/images/backward.png | Bin 136 -> 0 bytes .../libs/ddmuilib/src/resources/images/capture.png | Bin 691 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/clear.png | Bin 217 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/d.png | Bin 638 -> 0 bytes .../ddmuilib/src/resources/images/debug-attach.png | Bin 156 -> 0 bytes .../ddmuilib/src/resources/images/debug-error.png | Bin 222 -> 0 bytes .../ddmuilib/src/resources/images/debug-wait.png | Bin 156 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/delete.png | Bin 107 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/device.png | Bin 135 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/down.png | Bin 141 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/e.png | Bin 511 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/edit.png | Bin 223 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/empty.png | Bin 75 -> 0 bytes .../ddmuilib/src/resources/images/emulator.png | Bin 287 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/file.png | Bin 157 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/folder.png | Bin 123 -> 0 bytes .../libs/ddmuilib/src/resources/images/forward.png | Bin 137 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/gc.png | Bin 165 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/halt.png | Bin 197 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/heap.png | Bin 222 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/hprof.png | Bin 317 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/i.png | Bin 498 -> 0 bytes .../ddmuilib/src/resources/images/importBug.png | Bin 191 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/load.png | Bin 163 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/pause.png | Bin 98 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/play.png | Bin 138 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/pull.png | Bin 329 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/push.png | Bin 228 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/save.png | Bin 240 -> 0 bytes .../ddmuilib/src/resources/images/sort_down.png | Bin 102 -> 0 bytes .../libs/ddmuilib/src/resources/images/sort_up.png | Bin 105 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/thread.png | Bin 121 -> 0 bytes .../src/resources/images/tracing_start.png | Bin 227 -> 0 bytes .../ddmuilib/src/resources/images/tracing_stop.png | Bin 217 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/up.png | Bin 134 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/v.png | Bin 587 -> 0 bytes ddms/libs/ddmuilib/src/resources/images/w.png | Bin 681 -> 0 bytes .../libs/ddmuilib/src/resources/images/warning.png | Bin 147 -> 0 bytes draw9patch/Android.mk | 20 +- draw9patch/NOTICE | 190 +++++++++ draw9patch/src/Android.mk | 26 -- draw9patch/src/images/checker.png | Bin 0 -> 1889 bytes draw9patch/src/images/drop.png | Bin 0 -> 5479 bytes draw9patch/src/resources/images/checker.png | Bin 1889 -> 0 bytes draw9patch/src/resources/images/drop.png | Bin 5479 -> 0 bytes dumpeventlog/NOTICE | 190 +++++++++ eventanalyzer/NOTICE | 190 +++++++++ hierarchyviewer2/app/Android.mk | 26 +- hierarchyviewer2/app/NOTICE | 190 +++++++++ hierarchyviewer2/app/src/Android.mk | 33 -- hierarchyviewer2/libs/hierarchyviewerlib/NOTICE | 190 +++++++++ ide_common/NOTICE | 190 +++++++++ layoutlib_api/NOTICE | 190 +++++++++ layoutopt/NOTICE | 190 +++++++++ ninepatch/NOTICE | 190 +++++++++ screenshot/NOTICE | 190 +++++++++ sdklauncher/NOTICE | 190 +++++++++ sdkmanager/app/Android.mk | 31 +- sdkmanager/app/NOTICE | 190 +++++++++ sdkmanager/app/src/Android.mk | 30 -- sdkmanager/app/tests/Android.mk | 2 +- sdkmanager/libs/sdklib/.classpath | 4 +- sdkmanager/libs/sdklib/Android.mk | 24 +- sdkmanager/libs/sdklib/NOTICE | 190 +++++++++ sdkmanager/libs/sdklib/src/Android.mk | 35 -- sdkmanager/libs/sdklib/tests/Android.mk | 5 +- .../internal/repository/AddonsListFetcherTest.java | 160 -------- .../internal/repository/BrokenPackageTest.java | 54 --- .../internal/repository/MockAddonPackage.java | 161 -------- .../internal/repository/MockBrokenPackage.java | 43 --- .../internal/repository/MockEmptySdkManager.java | 30 -- .../sdklib/internal/repository/MockMonitor.java | 67 ---- .../internal/repository/MockPlatformPackage.java | 193 --------- .../repository/MockPlatformToolPackage.java | 49 --- .../internal/repository/MockToolPackage.java | 57 --- .../internal/repository/SdkAddonSourceTest.java | 253 ------------ .../internal/repository/SdkRepoSourceTest.java | 429 --------------------- .../tests/com/android/sdklib/mock/MockLog.java | 59 --- .../sdklib/repository/SdkRepositoryTest.java | 335 ---------------- .../testdata/AndroidManifest-instrumentation.xml | 19 - .../sdklib/testdata/AndroidManifest-testapp.xml | 29 -- .../sdklib/testdata/AndroidManifest-testapp2.xml | 8 - .../com/android/sdklib/testdata/addon_sample_1.xml | 164 -------- .../sdklib/testdata/addons_list_sample_1.xml | 38 -- .../sdklib/testdata/repository_sample_1.xml | 274 ------------- .../sdklib/testdata/repository_sample_2.xml | 309 --------------- .../sdklib/testdata/repository_sample_3.xml | 261 ------------- .../sdklib/xml/AndroidManifestParserTest.java | 163 -------- .../android/sdklib/xml/SupportsScreensTest.java | 146 ------- .../internal/repository/AddonsListFetcherTest.java | 160 ++++++++ .../internal/repository/BrokenPackageTest.java | 54 +++ .../internal/repository/MockAddonPackage.java | 161 ++++++++ .../internal/repository/MockBrokenPackage.java | 43 +++ .../internal/repository/MockEmptySdkManager.java | 30 ++ .../sdklib/internal/repository/MockMonitor.java | 67 ++++ .../internal/repository/MockPlatformPackage.java | 193 +++++++++ .../repository/MockPlatformToolPackage.java | 49 +++ .../internal/repository/MockToolPackage.java | 57 +++ .../internal/repository/SdkAddonSourceTest.java | 253 ++++++++++++ .../internal/repository/SdkRepoSourceTest.java | 429 +++++++++++++++++++++ .../tests/src/com/android/sdklib/mock/MockLog.java | 59 +++ .../sdklib/repository/SdkRepositoryTest.java | 335 ++++++++++++++++ .../testdata/AndroidManifest-instrumentation.xml | 19 + .../sdklib/testdata/AndroidManifest-testapp.xml | 29 ++ .../sdklib/testdata/AndroidManifest-testapp2.xml | 8 + .../com/android/sdklib/testdata/addon_sample_1.xml | 164 ++++++++ .../sdklib/testdata/addons_list_sample_1.xml | 38 ++ .../sdklib/testdata/repository_sample_1.xml | 274 +++++++++++++ .../sdklib/testdata/repository_sample_2.xml | 309 +++++++++++++++ .../sdklib/testdata/repository_sample_3.xml | 261 +++++++++++++ .../sdklib/xml/AndroidManifestParserTest.java | 163 ++++++++ .../android/sdklib/xml/SupportsScreensTest.java | 146 +++++++ sdkmanager/libs/sdkuilib/Android.mk | 27 +- sdkmanager/libs/sdkuilib/NOTICE | 190 +++++++++ sdkmanager/libs/sdkuilib/src/Android.mk | 25 -- sdkstats/NOTICE | 190 +++++++++ traceview/NOTICE | 190 +++++++++ 184 files changed, 8077 insertions(+), 3614 deletions(-) create mode 100644 androidprefs/NOTICE delete mode 100644 androidprefs/src/Android.mk create mode 100644 anttasks/NOTICE delete mode 100644 anttasks/src/Android.mk create mode 100644 apkbuilder/NOTICE create mode 100644 archquery/NOTICE delete mode 100644 archquery/src/Android.mk create mode 100644 common/NOTICE create mode 100644 ddms/app/NOTICE delete mode 100644 ddms/app/src/Android.mk create mode 100644 ddms/app/src/images/ddms-icon.png create mode 100644 ddms/app/src/images/ddms-logo.png delete mode 100644 ddms/app/src/resources/images/ddms-icon.png delete mode 100644 ddms/app/src/resources/images/ddms-logo.png create mode 100644 ddms/libs/ddmlib/NOTICE create mode 100644 ddms/libs/ddmuilib/NOTICE delete mode 100644 ddms/libs/ddmuilib/src/Android.mk create mode 100644 ddms/libs/ddmuilib/src/images/add.png create mode 100644 ddms/libs/ddmuilib/src/images/android.png create mode 100644 ddms/libs/ddmuilib/src/images/backward.png create mode 100644 ddms/libs/ddmuilib/src/images/capture.png create mode 100644 ddms/libs/ddmuilib/src/images/clear.png create mode 100644 ddms/libs/ddmuilib/src/images/d.png create mode 100644 ddms/libs/ddmuilib/src/images/debug-attach.png create mode 100644 ddms/libs/ddmuilib/src/images/debug-error.png create mode 100644 ddms/libs/ddmuilib/src/images/debug-wait.png create mode 100644 ddms/libs/ddmuilib/src/images/delete.png create mode 100644 ddms/libs/ddmuilib/src/images/device.png create mode 100644 ddms/libs/ddmuilib/src/images/down.png create mode 100644 ddms/libs/ddmuilib/src/images/e.png create mode 100644 ddms/libs/ddmuilib/src/images/edit.png create mode 100644 ddms/libs/ddmuilib/src/images/empty.png create mode 100644 ddms/libs/ddmuilib/src/images/emulator.png create mode 100644 ddms/libs/ddmuilib/src/images/file.png create mode 100644 ddms/libs/ddmuilib/src/images/folder.png create mode 100644 ddms/libs/ddmuilib/src/images/forward.png create mode 100644 ddms/libs/ddmuilib/src/images/gc.png create mode 100644 ddms/libs/ddmuilib/src/images/halt.png create mode 100644 ddms/libs/ddmuilib/src/images/heap.png create mode 100644 ddms/libs/ddmuilib/src/images/hprof.png create mode 100644 ddms/libs/ddmuilib/src/images/i.png create mode 100644 ddms/libs/ddmuilib/src/images/importBug.png create mode 100644 ddms/libs/ddmuilib/src/images/load.png create mode 100644 ddms/libs/ddmuilib/src/images/pause.png create mode 100644 ddms/libs/ddmuilib/src/images/play.png create mode 100644 ddms/libs/ddmuilib/src/images/pull.png create mode 100644 ddms/libs/ddmuilib/src/images/push.png create mode 100644 ddms/libs/ddmuilib/src/images/save.png create mode 100644 ddms/libs/ddmuilib/src/images/sort_down.png create mode 100644 ddms/libs/ddmuilib/src/images/sort_up.png create mode 100644 ddms/libs/ddmuilib/src/images/thread.png create mode 100644 ddms/libs/ddmuilib/src/images/tracing_start.png create mode 100644 ddms/libs/ddmuilib/src/images/tracing_stop.png create mode 100644 ddms/libs/ddmuilib/src/images/up.png create mode 100644 ddms/libs/ddmuilib/src/images/v.png create mode 100644 ddms/libs/ddmuilib/src/images/w.png create mode 100644 ddms/libs/ddmuilib/src/images/warning.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/add.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/android.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/backward.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/capture.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/clear.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/d.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/debug-attach.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/debug-error.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/debug-wait.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/delete.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/device.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/down.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/e.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/edit.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/empty.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/emulator.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/file.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/folder.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/forward.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/gc.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/halt.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/heap.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/hprof.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/i.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/importBug.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/load.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/pause.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/play.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/pull.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/push.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/save.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/sort_down.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/sort_up.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/thread.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/tracing_start.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/tracing_stop.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/up.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/v.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/w.png delete mode 100644 ddms/libs/ddmuilib/src/resources/images/warning.png create mode 100644 draw9patch/NOTICE delete mode 100644 draw9patch/src/Android.mk create mode 100644 draw9patch/src/images/checker.png create mode 100644 draw9patch/src/images/drop.png delete mode 100644 draw9patch/src/resources/images/checker.png delete mode 100644 draw9patch/src/resources/images/drop.png create mode 100644 dumpeventlog/NOTICE create mode 100644 eventanalyzer/NOTICE create mode 100644 hierarchyviewer2/app/NOTICE delete mode 100644 hierarchyviewer2/app/src/Android.mk create mode 100644 hierarchyviewer2/libs/hierarchyviewerlib/NOTICE create mode 100644 ide_common/NOTICE create mode 100644 layoutlib_api/NOTICE create mode 100644 layoutopt/NOTICE create mode 100644 ninepatch/NOTICE create mode 100644 screenshot/NOTICE create mode 100644 sdklauncher/NOTICE create mode 100644 sdkmanager/app/NOTICE delete mode 100644 sdkmanager/app/src/Android.mk create mode 100644 sdkmanager/libs/sdklib/NOTICE delete mode 100644 sdkmanager/libs/sdklib/src/Android.mk delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/BrokenPackageTest.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockAddonPackage.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockBrokenPackage.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockEmptySdkManager.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockMonitor.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockPlatformPackage.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockPlatformToolPackage.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockToolPackage.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/SdkAddonSourceTest.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/SdkRepoSourceTest.java delete mode 100644 sdkmanager/libs/sdklib/tests/com/android/sdklib/mock/MockLog.java delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/SdkRepositoryTest.java delete mode 100644 sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml delete mode 100644 sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-testapp.xml delete mode 100644 sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-testapp2.xml delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/addon_sample_1.xml delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/addons_list_sample_1.xml delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_1.xml delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_2.xml delete mode 100755 sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_3.xml delete mode 100644 sdkmanager/libs/sdklib/tests/com/android/sdklib/xml/AndroidManifestParserTest.java delete mode 100644 sdkmanager/libs/sdklib/tests/com/android/sdklib/xml/SupportsScreensTest.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/AddonsListFetcherTest.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/BrokenPackageTest.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockAddonPackage.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockBrokenPackage.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockEmptySdkManager.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformPackage.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformToolPackage.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockToolPackage.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkAddonSourceTest.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java create mode 100644 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/SdkRepositoryTest.java create mode 100644 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml create mode 100644 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp.xml create mode 100644 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp2.xml create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_1.xml create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_1.xml create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_1.xml create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_2.xml create mode 100755 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_3.xml create mode 100644 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/xml/AndroidManifestParserTest.java create mode 100644 sdkmanager/libs/sdklib/tests/src/com/android/sdklib/xml/SupportsScreensTest.java create mode 100644 sdkmanager/libs/sdkuilib/NOTICE delete mode 100644 sdkmanager/libs/sdkuilib/src/Android.mk create mode 100644 sdkstats/NOTICE create mode 100644 traceview/NOTICE diff --git a/androidprefs/Android.mk b/androidprefs/Android.mk index 363b085..08fd10d 100644 --- a/androidprefs/Android.mk +++ b/androidprefs/Android.mk @@ -13,5 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -JARUTILS_LOCAL_DIR := $(call my-dir) -include $(JARUTILS_LOCAL_DIR)/src/Android.mk +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_MODULE := androidprefs + +include $(BUILD_HOST_JAVA_LIBRARY) + diff --git a/androidprefs/NOTICE b/androidprefs/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/androidprefs/NOTICE @@ -0,0 +1,190 @@ + + 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/androidprefs/src/Android.mk b/androidprefs/src/Android.mk deleted file mode 100644 index ddc0aa6..0000000 --- a/androidprefs/src/Android.mk +++ /dev/null @@ -1,24 +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) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) - -LOCAL_MODULE := androidprefs - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/anttasks/Android.mk b/anttasks/Android.mk index 15ee903..e75a7cd 100644 --- a/anttasks/Android.mk +++ b/anttasks/Android.mk @@ -13,5 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -ANTTASKS_LOCAL_DIR := $(call my-dir) -include $(ANTTASKS_LOCAL_DIR)/src/Android.mk +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAR_MANIFEST := etc/manifest.txt + +LOCAL_JAVA_LIBRARIES := \ + sdklib \ + ant + +LOCAL_MODULE := anttasks + +include $(BUILD_HOST_JAVA_LIBRARY) + diff --git a/anttasks/NOTICE b/anttasks/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/anttasks/NOTICE @@ -0,0 +1,190 @@ + + 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/anttasks/src/Android.mk b/anttasks/src/Android.mk deleted file mode 100644 index 5cefb37..0000000 --- a/anttasks/src/Android.mk +++ /dev/null @@ -1,29 +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) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAR_MANIFEST := ../etc/manifest.txt - -LOCAL_JAVA_LIBRARIES := \ - sdklib \ - ant - -LOCAL_MODULE := anttasks - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/apkbuilder/NOTICE b/apkbuilder/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/apkbuilder/NOTICE @@ -0,0 +1,190 @@ + + 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/archquery/Android.mk b/archquery/Android.mk index 53cad46..8936178 100644 --- a/archquery/Android.mk +++ b/archquery/Android.mk @@ -13,5 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # -ARCHQUERY_LOCAL_DIR := $(call my-dir) -include $(ARCHQUERY_LOCAL_DIR)/src/Android.mk +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAR_MANIFEST := etc/manifest.txt + +LOCAL_JAVA_LIBRARIES := \ + +LOCAL_MODULE := archquery + +include $(BUILD_HOST_JAVA_LIBRARY) diff --git a/archquery/NOTICE b/archquery/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/archquery/NOTICE @@ -0,0 +1,190 @@ + + 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/archquery/src/Android.mk b/archquery/src/Android.mk deleted file mode 100644 index 980f002..0000000 --- a/archquery/src/Android.mk +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (C) 2009 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) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAR_MANIFEST := ../etc/manifest.txt -LOCAL_JAVA_LIBRARIES := \ - -LOCAL_MODULE := archquery - -include $(BUILD_HOST_JAVA_LIBRARY) diff --git a/common/NOTICE b/common/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/common/NOTICE @@ -0,0 +1,190 @@ + + 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/ddms/app/.classpath b/ddms/app/.classpath index 1040688..3f01de4 100644 --- a/ddms/app/.classpath +++ b/ddms/app/.classpath @@ -1,7 +1,6 @@ - - + diff --git a/ddms/app/Android.mk b/ddms/app/Android.mk index 3857706..6be32be 100644 --- a/ddms/app/Android.mk +++ b/ddms/app/Android.mk @@ -1,5 +1,29 @@ # Copyright 2007 The Android Open Source Project # -DDMSAPP_LOCAL_DIR := $(call my-dir) -include $(DDMSAPP_LOCAL_DIR)/etc/Android.mk -include $(DDMSAPP_LOCAL_DIR)/src/Android.mk +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAR_MANIFEST := etc/manifest.txt + +# If the dependency list is changed, etc/manifest.txt +# MUST be updated as well (Except for swt.jar which is dynamically +# added based on whether the VM is 32 or 64 bit) +LOCAL_JAVA_LIBRARIES := \ + androidprefs \ + sdkstats \ + ddmlib \ + ddmuilib \ + swt \ + org.eclipse.jface_3.4.2.M20090107-0800 \ + org.eclipse.equinox.common_3.4.0.v20080421-2006 \ + org.eclipse.core.commands_3.4.0.I20080509-2000 +LOCAL_MODULE := ddms + +include $(BUILD_HOST_JAVA_LIBRARY) + + +# Build all sub-directories +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/ddms/app/NOTICE b/ddms/app/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/ddms/app/NOTICE @@ -0,0 +1,190 @@ + + 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/ddms/app/src/Android.mk b/ddms/app/src/Android.mk deleted file mode 100644 index bac4030..0000000 --- a/ddms/app/src/Android.mk +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2007 The Android Open Source Project -# -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAVA_RESOURCE_DIRS := resources - -LOCAL_JAR_MANIFEST := ../etc/manifest.txt - -# If the dependency list is changed, etc/manifest.txt -# MUST be updated as well (Except for swt.jar which is dynamically -# added based on whether the VM is 32 or 64 bit) -LOCAL_JAVA_LIBRARIES := \ - androidprefs \ - sdkstats \ - ddmlib \ - ddmuilib \ - swt \ - org.eclipse.jface_3.4.2.M20090107-0800 \ - org.eclipse.equinox.common_3.4.0.v20080421-2006 \ - org.eclipse.core.commands_3.4.0.I20080509-2000 -LOCAL_MODULE := ddms - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/ddms/app/src/images/ddms-icon.png b/ddms/app/src/images/ddms-icon.png new file mode 100644 index 0000000..6390a2d Binary files /dev/null and b/ddms/app/src/images/ddms-icon.png differ diff --git a/ddms/app/src/images/ddms-logo.png b/ddms/app/src/images/ddms-logo.png new file mode 100644 index 0000000..6390a2d Binary files /dev/null and b/ddms/app/src/images/ddms-logo.png differ diff --git a/ddms/app/src/resources/images/ddms-icon.png b/ddms/app/src/resources/images/ddms-icon.png deleted file mode 100644 index 6390a2d..0000000 Binary files a/ddms/app/src/resources/images/ddms-icon.png and /dev/null differ diff --git a/ddms/app/src/resources/images/ddms-logo.png b/ddms/app/src/resources/images/ddms-logo.png deleted file mode 100644 index 6390a2d..0000000 Binary files a/ddms/app/src/resources/images/ddms-logo.png and /dev/null differ diff --git a/ddms/libs/ddmlib/Android.mk b/ddms/libs/ddmlib/Android.mk index 8e46edf..978ac19 100644 --- a/ddms/libs/ddmlib/Android.mk +++ b/ddms/libs/ddmlib/Android.mk @@ -18,6 +18,7 @@ include $(CLEAR_VARS) # Only compile source java files in this lib. LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src LOCAL_MODULE := ddmlib diff --git a/ddms/libs/ddmlib/NOTICE b/ddms/libs/ddmlib/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/ddms/libs/ddmlib/NOTICE @@ -0,0 +1,190 @@ + + 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/ddms/libs/ddmuilib/.classpath b/ddms/libs/ddmuilib/.classpath index 2cd368c..839e2be 100644 --- a/ddms/libs/ddmuilib/.classpath +++ b/ddms/libs/ddmuilib/.classpath @@ -1,7 +1,6 @@ - - + diff --git a/ddms/libs/ddmuilib/Android.mk b/ddms/libs/ddmuilib/Android.mk index 7059e5e..6b50f82 100644 --- a/ddms/libs/ddmuilib/Android.mk +++ b/ddms/libs/ddmuilib/Android.mk @@ -1,4 +1,28 @@ # Copyright 2007 The Android Open Source Project # -DDMUILIB_LOCAL_DIR := $(call my-dir) -include $(DDMUILIB_LOCAL_DIR)/src/Android.mk +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +# Only compile source java files in this lib. +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAR_MANIFEST := etc/manifest.txt + +# If the dependency list is changed, etc/manifest.txt +# MUST be updated as well (Except for swt.jar which is dynamically +# added based on whether the VM is 32 or 64 bit) +LOCAL_JAVA_LIBRARIES := \ + ddmlib \ + swt \ + org.eclipse.jface_3.4.2.M20090107-0800 \ + org.eclipse.equinox.common_3.4.0.v20080421-2006 \ + org.eclipse.core.commands_3.4.0.I20080509-2000 \ + jcommon-1.0.12 \ + jfreechart-1.0.9 \ + jfreechart-1.0.9-swt + +LOCAL_MODULE := ddmuilib + +include $(BUILD_HOST_JAVA_LIBRARY) + diff --git a/ddms/libs/ddmuilib/NOTICE b/ddms/libs/ddmuilib/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/ddms/libs/ddmuilib/NOTICE @@ -0,0 +1,190 @@ + + 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/ddms/libs/ddmuilib/src/Android.mk b/ddms/libs/ddmuilib/src/Android.mk deleted file mode 100644 index cfc1791..0000000 --- a/ddms/libs/ddmuilib/src/Android.mk +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2007 The Android Open Source Project -# -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAVA_RESOURCE_DIRS := resources - -LOCAL_JAR_MANIFEST := ../etc/manifest.txt - -# If the dependency list is changed, etc/manifest.txt -# MUST be updated as well (Except for swt.jar which is dynamically -# added based on whether the VM is 32 or 64 bit) -LOCAL_JAVA_LIBRARIES := \ - ddmlib \ - swt \ - org.eclipse.jface_3.4.2.M20090107-0800 \ - org.eclipse.equinox.common_3.4.0.v20080421-2006 \ - org.eclipse.core.commands_3.4.0.I20080509-2000 \ - jcommon-1.0.12 \ - jfreechart-1.0.9 \ - jfreechart-1.0.9-swt - -LOCAL_MODULE := ddmuilib - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/ddms/libs/ddmuilib/src/images/add.png b/ddms/libs/ddmuilib/src/images/add.png new file mode 100644 index 0000000..eefc2ca Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/add.png differ diff --git a/ddms/libs/ddmuilib/src/images/android.png b/ddms/libs/ddmuilib/src/images/android.png new file mode 100644 index 0000000..3779d4d Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/android.png differ diff --git a/ddms/libs/ddmuilib/src/images/backward.png b/ddms/libs/ddmuilib/src/images/backward.png new file mode 100644 index 0000000..90a9713 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/backward.png differ diff --git a/ddms/libs/ddmuilib/src/images/capture.png b/ddms/libs/ddmuilib/src/images/capture.png new file mode 100644 index 0000000..da5c10b Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/capture.png differ diff --git a/ddms/libs/ddmuilib/src/images/clear.png b/ddms/libs/ddmuilib/src/images/clear.png new file mode 100644 index 0000000..0009cf6 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/clear.png differ diff --git a/ddms/libs/ddmuilib/src/images/d.png b/ddms/libs/ddmuilib/src/images/d.png new file mode 100644 index 0000000..d45506e Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/d.png differ diff --git a/ddms/libs/ddmuilib/src/images/debug-attach.png b/ddms/libs/ddmuilib/src/images/debug-attach.png new file mode 100644 index 0000000..9b8a11c Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/debug-attach.png differ diff --git a/ddms/libs/ddmuilib/src/images/debug-error.png b/ddms/libs/ddmuilib/src/images/debug-error.png new file mode 100644 index 0000000..f22da1f Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/debug-error.png differ diff --git a/ddms/libs/ddmuilib/src/images/debug-wait.png b/ddms/libs/ddmuilib/src/images/debug-wait.png new file mode 100644 index 0000000..322be63 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/debug-wait.png differ diff --git a/ddms/libs/ddmuilib/src/images/delete.png b/ddms/libs/ddmuilib/src/images/delete.png new file mode 100644 index 0000000..db5fab8 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/delete.png differ diff --git a/ddms/libs/ddmuilib/src/images/device.png b/ddms/libs/ddmuilib/src/images/device.png new file mode 100644 index 0000000..7dbbbb6 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/device.png differ diff --git a/ddms/libs/ddmuilib/src/images/down.png b/ddms/libs/ddmuilib/src/images/down.png new file mode 100644 index 0000000..f9426cb Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/down.png differ diff --git a/ddms/libs/ddmuilib/src/images/e.png b/ddms/libs/ddmuilib/src/images/e.png new file mode 100644 index 0000000..dee7c97 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/e.png differ diff --git a/ddms/libs/ddmuilib/src/images/edit.png b/ddms/libs/ddmuilib/src/images/edit.png new file mode 100644 index 0000000..b8f65bc Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/edit.png differ diff --git a/ddms/libs/ddmuilib/src/images/empty.png b/ddms/libs/ddmuilib/src/images/empty.png new file mode 100644 index 0000000..f021542 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/empty.png differ diff --git a/ddms/libs/ddmuilib/src/images/emulator.png b/ddms/libs/ddmuilib/src/images/emulator.png new file mode 100644 index 0000000..a718042 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/emulator.png differ diff --git a/ddms/libs/ddmuilib/src/images/file.png b/ddms/libs/ddmuilib/src/images/file.png new file mode 100644 index 0000000..043a814 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/file.png differ diff --git a/ddms/libs/ddmuilib/src/images/folder.png b/ddms/libs/ddmuilib/src/images/folder.png new file mode 100644 index 0000000..7e29b1a Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/folder.png differ diff --git a/ddms/libs/ddmuilib/src/images/forward.png b/ddms/libs/ddmuilib/src/images/forward.png new file mode 100644 index 0000000..a97a605 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/forward.png differ diff --git a/ddms/libs/ddmuilib/src/images/gc.png b/ddms/libs/ddmuilib/src/images/gc.png new file mode 100644 index 0000000..5194806 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/gc.png differ diff --git a/ddms/libs/ddmuilib/src/images/halt.png b/ddms/libs/ddmuilib/src/images/halt.png new file mode 100644 index 0000000..10e3720 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/halt.png differ diff --git a/ddms/libs/ddmuilib/src/images/heap.png b/ddms/libs/ddmuilib/src/images/heap.png new file mode 100644 index 0000000..e3aa3f0 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/heap.png differ diff --git a/ddms/libs/ddmuilib/src/images/hprof.png b/ddms/libs/ddmuilib/src/images/hprof.png new file mode 100644 index 0000000..123d062 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/hprof.png differ diff --git a/ddms/libs/ddmuilib/src/images/i.png b/ddms/libs/ddmuilib/src/images/i.png new file mode 100644 index 0000000..98385c5 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/i.png differ diff --git a/ddms/libs/ddmuilib/src/images/importBug.png b/ddms/libs/ddmuilib/src/images/importBug.png new file mode 100644 index 0000000..f5da179 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/importBug.png differ diff --git a/ddms/libs/ddmuilib/src/images/load.png b/ddms/libs/ddmuilib/src/images/load.png new file mode 100644 index 0000000..9e7bf6e Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/load.png differ diff --git a/ddms/libs/ddmuilib/src/images/pause.png b/ddms/libs/ddmuilib/src/images/pause.png new file mode 100644 index 0000000..19d286d Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/pause.png differ diff --git a/ddms/libs/ddmuilib/src/images/play.png b/ddms/libs/ddmuilib/src/images/play.png new file mode 100644 index 0000000..d54f013 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/play.png differ diff --git a/ddms/libs/ddmuilib/src/images/pull.png b/ddms/libs/ddmuilib/src/images/pull.png new file mode 100644 index 0000000..f48f1b1 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/pull.png differ diff --git a/ddms/libs/ddmuilib/src/images/push.png b/ddms/libs/ddmuilib/src/images/push.png new file mode 100644 index 0000000..6222864 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/push.png differ diff --git a/ddms/libs/ddmuilib/src/images/save.png b/ddms/libs/ddmuilib/src/images/save.png new file mode 100644 index 0000000..040ebda Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/save.png differ diff --git a/ddms/libs/ddmuilib/src/images/sort_down.png b/ddms/libs/ddmuilib/src/images/sort_down.png new file mode 100644 index 0000000..2d4ccc1 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/sort_down.png differ diff --git a/ddms/libs/ddmuilib/src/images/sort_up.png b/ddms/libs/ddmuilib/src/images/sort_up.png new file mode 100644 index 0000000..3a0bc3c Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/sort_up.png differ diff --git a/ddms/libs/ddmuilib/src/images/thread.png b/ddms/libs/ddmuilib/src/images/thread.png new file mode 100644 index 0000000..ac839e8 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/thread.png differ diff --git a/ddms/libs/ddmuilib/src/images/tracing_start.png b/ddms/libs/ddmuilib/src/images/tracing_start.png new file mode 100644 index 0000000..88771cc Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/tracing_start.png differ diff --git a/ddms/libs/ddmuilib/src/images/tracing_stop.png b/ddms/libs/ddmuilib/src/images/tracing_stop.png new file mode 100644 index 0000000..71bd215 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/tracing_stop.png differ diff --git a/ddms/libs/ddmuilib/src/images/up.png b/ddms/libs/ddmuilib/src/images/up.png new file mode 100644 index 0000000..92edf5a Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/up.png differ diff --git a/ddms/libs/ddmuilib/src/images/v.png b/ddms/libs/ddmuilib/src/images/v.png new file mode 100644 index 0000000..8044051 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/v.png differ diff --git a/ddms/libs/ddmuilib/src/images/w.png b/ddms/libs/ddmuilib/src/images/w.png new file mode 100644 index 0000000..129d0f9 Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/w.png differ diff --git a/ddms/libs/ddmuilib/src/images/warning.png b/ddms/libs/ddmuilib/src/images/warning.png new file mode 100644 index 0000000..ca3b6ed Binary files /dev/null and b/ddms/libs/ddmuilib/src/images/warning.png differ diff --git a/ddms/libs/ddmuilib/src/resources/images/add.png b/ddms/libs/ddmuilib/src/resources/images/add.png deleted file mode 100644 index eefc2ca..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/add.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/android.png b/ddms/libs/ddmuilib/src/resources/images/android.png deleted file mode 100644 index 3779d4d..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/android.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/backward.png b/ddms/libs/ddmuilib/src/resources/images/backward.png deleted file mode 100644 index 90a9713..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/backward.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/capture.png b/ddms/libs/ddmuilib/src/resources/images/capture.png deleted file mode 100644 index da5c10b..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/capture.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/clear.png b/ddms/libs/ddmuilib/src/resources/images/clear.png deleted file mode 100644 index 0009cf6..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/clear.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/d.png b/ddms/libs/ddmuilib/src/resources/images/d.png deleted file mode 100644 index d45506e..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/d.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/debug-attach.png b/ddms/libs/ddmuilib/src/resources/images/debug-attach.png deleted file mode 100644 index 9b8a11c..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/debug-attach.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/debug-error.png b/ddms/libs/ddmuilib/src/resources/images/debug-error.png deleted file mode 100644 index f22da1f..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/debug-error.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/debug-wait.png b/ddms/libs/ddmuilib/src/resources/images/debug-wait.png deleted file mode 100644 index 322be63..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/debug-wait.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/delete.png b/ddms/libs/ddmuilib/src/resources/images/delete.png deleted file mode 100644 index db5fab8..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/delete.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/device.png b/ddms/libs/ddmuilib/src/resources/images/device.png deleted file mode 100644 index 7dbbbb6..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/device.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/down.png b/ddms/libs/ddmuilib/src/resources/images/down.png deleted file mode 100644 index f9426cb..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/down.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/e.png b/ddms/libs/ddmuilib/src/resources/images/e.png deleted file mode 100644 index dee7c97..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/e.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/edit.png b/ddms/libs/ddmuilib/src/resources/images/edit.png deleted file mode 100644 index b8f65bc..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/edit.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/empty.png b/ddms/libs/ddmuilib/src/resources/images/empty.png deleted file mode 100644 index f021542..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/empty.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/emulator.png b/ddms/libs/ddmuilib/src/resources/images/emulator.png deleted file mode 100644 index a718042..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/emulator.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/file.png b/ddms/libs/ddmuilib/src/resources/images/file.png deleted file mode 100644 index 043a814..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/file.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/folder.png b/ddms/libs/ddmuilib/src/resources/images/folder.png deleted file mode 100644 index 7e29b1a..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/folder.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/forward.png b/ddms/libs/ddmuilib/src/resources/images/forward.png deleted file mode 100644 index a97a605..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/forward.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/gc.png b/ddms/libs/ddmuilib/src/resources/images/gc.png deleted file mode 100644 index 5194806..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/gc.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/halt.png b/ddms/libs/ddmuilib/src/resources/images/halt.png deleted file mode 100644 index 10e3720..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/halt.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/heap.png b/ddms/libs/ddmuilib/src/resources/images/heap.png deleted file mode 100644 index e3aa3f0..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/heap.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/hprof.png b/ddms/libs/ddmuilib/src/resources/images/hprof.png deleted file mode 100644 index 123d062..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/hprof.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/i.png b/ddms/libs/ddmuilib/src/resources/images/i.png deleted file mode 100644 index 98385c5..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/i.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/importBug.png b/ddms/libs/ddmuilib/src/resources/images/importBug.png deleted file mode 100644 index f5da179..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/importBug.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/load.png b/ddms/libs/ddmuilib/src/resources/images/load.png deleted file mode 100644 index 9e7bf6e..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/load.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/pause.png b/ddms/libs/ddmuilib/src/resources/images/pause.png deleted file mode 100644 index 19d286d..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/pause.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/play.png b/ddms/libs/ddmuilib/src/resources/images/play.png deleted file mode 100644 index d54f013..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/play.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/pull.png b/ddms/libs/ddmuilib/src/resources/images/pull.png deleted file mode 100644 index f48f1b1..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/pull.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/push.png b/ddms/libs/ddmuilib/src/resources/images/push.png deleted file mode 100644 index 6222864..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/push.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/save.png b/ddms/libs/ddmuilib/src/resources/images/save.png deleted file mode 100644 index 040ebda..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/save.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/sort_down.png b/ddms/libs/ddmuilib/src/resources/images/sort_down.png deleted file mode 100644 index 2d4ccc1..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/sort_down.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/sort_up.png b/ddms/libs/ddmuilib/src/resources/images/sort_up.png deleted file mode 100644 index 3a0bc3c..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/sort_up.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/thread.png b/ddms/libs/ddmuilib/src/resources/images/thread.png deleted file mode 100644 index ac839e8..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/thread.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/tracing_start.png b/ddms/libs/ddmuilib/src/resources/images/tracing_start.png deleted file mode 100644 index 88771cc..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/tracing_start.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/tracing_stop.png b/ddms/libs/ddmuilib/src/resources/images/tracing_stop.png deleted file mode 100644 index 71bd215..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/tracing_stop.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/up.png b/ddms/libs/ddmuilib/src/resources/images/up.png deleted file mode 100644 index 92edf5a..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/up.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/v.png b/ddms/libs/ddmuilib/src/resources/images/v.png deleted file mode 100644 index 8044051..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/v.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/w.png b/ddms/libs/ddmuilib/src/resources/images/w.png deleted file mode 100644 index 129d0f9..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/w.png and /dev/null differ diff --git a/ddms/libs/ddmuilib/src/resources/images/warning.png b/ddms/libs/ddmuilib/src/resources/images/warning.png deleted file mode 100644 index ca3b6ed..0000000 Binary files a/ddms/libs/ddmuilib/src/resources/images/warning.png and /dev/null differ diff --git a/draw9patch/Android.mk b/draw9patch/Android.mk index 934495d..f8de8d6 100644 --- a/draw9patch/Android.mk +++ b/draw9patch/Android.mk @@ -12,6 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -DRAW9PATCH_LOCAL_DIR := $(call my-dir) -include $(DRAW9PATCH_LOCAL_DIR)/etc/Android.mk -include $(DRAW9PATCH_LOCAL_DIR)/src/Android.mk +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAR_MANIFEST := etc/manifest.txt + +LOCAL_JAVA_LIBRARIES := \ + swing-worker-1.1 + +LOCAL_MODULE := draw9patch + +include $(BUILD_HOST_JAVA_LIBRARY) + +# Build all sub-directories +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/draw9patch/NOTICE b/draw9patch/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/draw9patch/NOTICE @@ -0,0 +1,190 @@ + + 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/draw9patch/src/Android.mk b/draw9patch/src/Android.mk deleted file mode 100644 index 3dc9db4..0000000 --- a/draw9patch/src/Android.mk +++ /dev/null @@ -1,26 +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) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAVA_RESOURCE_DIRS := resources - -LOCAL_JAR_MANIFEST := ../etc/manifest.txt -LOCAL_JAVA_LIBRARIES := \ - swing-worker-1.1 -LOCAL_MODULE := draw9patch - -include $(BUILD_HOST_JAVA_LIBRARY) diff --git a/draw9patch/src/images/checker.png b/draw9patch/src/images/checker.png new file mode 100644 index 0000000..78908f4 Binary files /dev/null and b/draw9patch/src/images/checker.png differ diff --git a/draw9patch/src/images/drop.png b/draw9patch/src/images/drop.png new file mode 100644 index 0000000..7a7436a Binary files /dev/null and b/draw9patch/src/images/drop.png differ diff --git a/draw9patch/src/resources/images/checker.png b/draw9patch/src/resources/images/checker.png deleted file mode 100644 index 78908f4..0000000 Binary files a/draw9patch/src/resources/images/checker.png and /dev/null differ diff --git a/draw9patch/src/resources/images/drop.png b/draw9patch/src/resources/images/drop.png deleted file mode 100644 index 7a7436a..0000000 Binary files a/draw9patch/src/resources/images/drop.png and /dev/null differ diff --git a/dumpeventlog/NOTICE b/dumpeventlog/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/dumpeventlog/NOTICE @@ -0,0 +1,190 @@ + + 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/eventanalyzer/NOTICE b/eventanalyzer/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/eventanalyzer/NOTICE @@ -0,0 +1,190 @@ + + 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/hierarchyviewer2/app/Android.mk b/hierarchyviewer2/app/Android.mk index 2927f1d..d940403 100644 --- a/hierarchyviewer2/app/Android.mk +++ b/hierarchyviewer2/app/Android.mk @@ -12,6 +12,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -HIERARCHYVIEWERAPP_LOCAL_DIR := $(call my-dir) -include $(HIERARCHYVIEWERAPP_LOCAL_DIR)/etc/Android.mk -include $(HIERARCHYVIEWERAPP_LOCAL_DIR)/src/Android.mk +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAR_MANIFEST := etc/manifest.txt + +LOCAL_JAVA_LIBRARIES := \ + ddmlib \ + ddmuilib \ + hierarchyviewerlib \ + swt \ + org.eclipse.jface_3.4.2.M20090107-0800 \ + org.eclipse.core.commands_3.4.0.I20080509-2000 \ + sdklib + +LOCAL_MODULE := hierarchyviewer2 + +include $(BUILD_HOST_JAVA_LIBRARY) + +# Build all sub-directories +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/hierarchyviewer2/app/NOTICE b/hierarchyviewer2/app/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/hierarchyviewer2/app/NOTICE @@ -0,0 +1,190 @@ + + 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/hierarchyviewer2/app/src/Android.mk b/hierarchyviewer2/app/src/Android.mk deleted file mode 100644 index 1f15bee..0000000 --- a/hierarchyviewer2/app/src/Android.mk +++ /dev/null @@ -1,33 +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. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) - -LOCAL_JAR_MANIFEST := ../etc/manifest.txt -LOCAL_JAVA_LIBRARIES := \ - ddmlib \ - ddmuilib \ - hierarchyviewerlib \ - swt \ - org.eclipse.jface_3.4.2.M20090107-0800 \ - org.eclipse.core.commands_3.4.0.I20080509-2000 \ - sdklib - -LOCAL_MODULE := hierarchyviewer2 - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE b/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE @@ -0,0 +1,190 @@ + + 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/ide_common/NOTICE b/ide_common/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/ide_common/NOTICE @@ -0,0 +1,190 @@ + + 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/layoutlib_api/NOTICE b/layoutlib_api/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/layoutlib_api/NOTICE @@ -0,0 +1,190 @@ + + 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/layoutopt/NOTICE b/layoutopt/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/layoutopt/NOTICE @@ -0,0 +1,190 @@ + + 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/ninepatch/NOTICE b/ninepatch/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/ninepatch/NOTICE @@ -0,0 +1,190 @@ + + 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/screenshot/NOTICE b/screenshot/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/screenshot/NOTICE @@ -0,0 +1,190 @@ + + 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/sdklauncher/NOTICE b/sdklauncher/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/sdklauncher/NOTICE @@ -0,0 +1,190 @@ + + 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/Android.mk b/sdkmanager/app/Android.mk index 87e830d..d7b630e 100644 --- a/sdkmanager/app/Android.mk +++ b/sdkmanager/app/Android.mk @@ -1,6 +1,33 @@ # Copyright 2007 The Android Open Source Project # -SDKMANAGERAPP_LOCAL_DIR := $(call my-dir) +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +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 := \ + androidprefs \ + sdklib \ + sdkuilib \ + swt \ + org.eclipse.jface_3.4.2.M20090107-0800 \ + org.eclipse.equinox.common_3.4.0.v20080421-2006 \ + org.eclipse.core.commands_3.4.0.I20080509-2000 + +LOCAL_MODULE := sdkmanager + +include $(BUILD_HOST_JAVA_LIBRARY) # Build all sub-directories -include $(call all-makefiles-under,$(SDKMANAGERAPP_LOCAL_DIR)) +include $(call all-makefiles-under,$(LOCAL_PATH)) + diff --git a/sdkmanager/app/NOTICE b/sdkmanager/app/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/sdkmanager/app/NOTICE @@ -0,0 +1,190 @@ + + 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/src/Android.mk b/sdkmanager/app/src/Android.mk deleted file mode 100644 index b93d218..0000000 --- a/sdkmanager/app/src/Android.mk +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2007 The Android Open Source Project -# -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAVA_RESOURCE_DIRS := . - -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 := \ - androidprefs \ - sdklib \ - sdkuilib \ - swt \ - org.eclipse.jface_3.4.2.M20090107-0800 \ - org.eclipse.equinox.common_3.4.0.v20080421-2006 \ - org.eclipse.core.commands_3.4.0.I20080509-2000 - -LOCAL_MODULE := sdkmanager - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/sdkmanager/app/tests/Android.mk b/sdkmanager/app/tests/Android.mk index dda405a..4f67370 100644 --- a/sdkmanager/app/tests/Android.mk +++ b/sdkmanager/app/tests/Android.mk @@ -20,7 +20,7 @@ include $(CLEAR_VARS) # Only compile source java files in this lib. LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_MODULE := app-tests +LOCAL_MODULE := sdkmanager-tests LOCAL_MODULE_TAGS := optional LOCAL_JAVA_LIBRARIES := sdkmanager sdklib-tests junit diff --git a/sdkmanager/libs/sdklib/.classpath b/sdkmanager/libs/sdklib/.classpath index 0066c60..7cabaa0 100644 --- a/sdkmanager/libs/sdklib/.classpath +++ b/sdkmanager/libs/sdklib/.classpath @@ -1,7 +1,7 @@ - - + + diff --git a/sdkmanager/libs/sdklib/Android.mk b/sdkmanager/libs/sdklib/Android.mk index 99284bf..7ed009c 100644 --- a/sdkmanager/libs/sdklib/Android.mk +++ b/sdkmanager/libs/sdklib/Android.mk @@ -13,7 +13,27 @@ # See the License for the specific language governing permissions and # limitations under the License. # -SDKLIB_LOCAL_DIR := $(call my-dir) +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAR_MANIFEST := manifest.txt + +# IMPORTANT: if you add a new dependency here, please make sure +# to also check the following files: +# sdkmanager/sdklib/manifest.txt +# sdkmanager/app/etc/android.bat +LOCAL_JAVA_LIBRARIES := \ + androidprefs \ + common \ + commons-compress-1.0 + +LOCAL_MODULE := sdklib + +include $(BUILD_HOST_JAVA_LIBRARY) + # Build all sub-directories -include $(call all-makefiles-under,$(SDKLIB_LOCAL_DIR)) +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/sdkmanager/libs/sdklib/NOTICE b/sdkmanager/libs/sdklib/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/sdkmanager/libs/sdklib/NOTICE @@ -0,0 +1,190 @@ + + 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/src/Android.mk b/sdkmanager/libs/sdklib/src/Android.mk deleted file mode 100644 index 0f06328..0000000 --- a/sdkmanager/libs/sdklib/src/Android.mk +++ /dev/null @@ -1,35 +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) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAVA_RESOURCE_DIRS := . -LOCAL_JAR_MANIFEST := ../manifest.txt - -# IMPORTANT: if you add a new dependency here, please make sure -# to also check the following files: -# sdkmanager/sdklib/manifest.txt -# sdkmanager/app/etc/android.bat -LOCAL_JAVA_LIBRARIES := \ - androidprefs \ - common \ - commons-compress-1.0 - -LOCAL_MODULE := sdklib - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/sdkmanager/libs/sdklib/tests/Android.mk b/sdkmanager/libs/sdklib/tests/Android.mk index 3b1ddc7..0179dc1 100644 --- a/sdkmanager/libs/sdklib/tests/Android.mk +++ b/sdkmanager/libs/sdklib/tests/Android.mk @@ -17,9 +17,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Only compile source java files in this lib. -LOCAL_SRC_FILES := $(call all-subdir-java-files) - -LOCAL_JAVA_RESOURCE_DIRS := . +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src LOCAL_MODULE := sdklib-tests LOCAL_MODULE_TAGS := optional diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java deleted file mode 100755 index 3f2bb84..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.eclipse.org/org/documents/epl-v10.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.internal.repository; - -import com.android.sdklib.internal.repository.AddonsListFetcher.Site; -import com.android.sdklib.repository.SdkAddonsListConstants; - -import org.w3c.dom.Document; - -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -import junit.framework.TestCase; - -/** - * Tests for {@link AddonsListFetcher} - */ -public class AddonsListFetcherTest extends TestCase { - - /** - * An internal helper class to give us visibility to the protected members we want - * to test. - */ - private static class MockAddonsListFetcher extends AddonsListFetcher { - - public Site[] _parseAddonsList(Document doc, String nsUri, ITaskMonitor monitor) { - return super.parseAddonsList(doc, nsUri, monitor); - } - - public int _getXmlSchemaVersion(InputStream xml) { - return super.getXmlSchemaVersion(xml); - } - - public String _validateXml(InputStream xml, String url, int version, - String[] outError, Boolean[] validatorFound) { - return super.validateXml(xml, url, version, outError, validatorFound); - } - - public Document _getDocument(InputStream xml, ITaskMonitor monitor) { - return super.getDocument(xml, monitor); - } - - } - - private MockAddonsListFetcher mFetcher; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - mFetcher = new MockAddonsListFetcher(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - mFetcher = null; - } - - /** - * Validate we can still load a valid addon schema version 1 - */ - public void testLoadSample_1() throws Exception { - InputStream xmlStream = - getTestResource("/com/android/sdklib/testdata/addons_list_sample_1.xml"); - - // guess the version from the XML document - int version = mFetcher._getXmlSchemaVersion(xmlStream); - assertEquals(1, version); - - Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; - String[] validationError = new String[] { null }; - String url = "not-a-valid-url://addons_list.xml"; - - String uri = mFetcher._validateXml( - xmlStream, url, version, validationError, validatorFound); - assertEquals(Boolean.TRUE, validatorFound[0]); - assertEquals(null, validationError[0]); - assertEquals(SdkAddonsListConstants.getSchemaUri(1), uri); - - // Validation was successful, load the document - MockMonitor monitor = new MockMonitor(); - Document doc = mFetcher._getDocument(xmlStream, monitor); - assertNotNull(doc); - - // Get the sites - Site[] result = mFetcher._parseAddonsList(doc, uri, monitor); - - assertEquals("", monitor.getCapturedDescriptions()); - assertEquals("", monitor.getCapturedResults()); - - // check the sites we found... - assertEquals(3, result.length); - - assertEquals("My Example Add-ons.", result[0].getUiName()); - assertEquals("http://www.example.com/my_addons.xml", result[0].getUrl()); - - // The XML file is UTF-8 so we support character sets (but the Java source file is - // not, so we use the \\u notation to create the Unicode String) - assertEquals("\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002", - result[1].getUiName()); - assertEquals("http://www.example.co.jp/addons.xml", result[1].getUrl()); - - assertEquals("Example of directory URL.", result[2].getUiName()); - assertEquals("http://www.example.com/", result[2].getUrl()); - } - - /** - * Returns an SdkLib file resource as a {@link ByteArrayInputStream}, - * which has the advantage that we can use {@link InputStream#reset()} on it - * at any time to read it multiple times. - *

- * The default for getResourceAsStream() is to return a {@link FileInputStream} that - * does not support reset(), yet we need it in the tested code. - * - * @throws IOException if some I/O read fails - */ - private ByteArrayInputStream getTestResource(String filename) throws IOException { - InputStream xmlStream = this.getClass().getResourceAsStream(filename); - - try { - byte[] data = new byte[8192]; - int offset = 0; - int n; - - while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) { - offset += n; - - if (offset == data.length) { - byte[] newData = new byte[offset + 8192]; - System.arraycopy(data, 0, newData, 0, offset); - data = newData; - } - } - - return new ByteArrayInputStream(data, 0, offset); - } finally { - if (xmlStream != null) { - xmlStream.close(); - } - } - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/BrokenPackageTest.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/BrokenPackageTest.java deleted file mode 100755 index 3e9ba8d..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/BrokenPackageTest.java +++ /dev/null @@ -1,54 +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. - */ - -package com.android.sdklib.internal.repository; - -import junit.framework.TestCase; - -public class BrokenPackageTest extends TestCase { - - private BrokenPackage m; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - m = new BrokenPackage(null /*props*/, - "short description", - "long description", - 12, // min api level - 13, // exact api level - "os/path"); - - } - - public final void testGetShortDescription() { - assertEquals("short description", m.getShortDescription()); - } - - public final void testGetLongDescription() { - assertEquals("long description", m.getLongDescription()); - } - - public final void testGetMinApiLevel() { - assertEquals(12, m.getMinApiLevel()); - } - - public final void testGetExactApiLevel() { - assertEquals(13, m.getExactApiLevel()); - } - -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockAddonPackage.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockAddonPackage.java deleted file mode 100755 index 55ace17..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockAddonPackage.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.internal.repository; - -import com.android.sdklib.AndroidVersion; -import com.android.sdklib.IAndroidTarget; -import com.android.sdklib.SdkConstants; - -import java.util.Map; - -/** - * A mock {@link AddonPackage} for testing. - * - * By design, this package contains one and only one archive. - */ -public class MockAddonPackage extends AddonPackage { - - /** - * Creates a {@link MockAddonTarget} with the requested base platform and addon revision - * and then a {@link MockAddonPackage} wrapping it. - * - * By design, this package contains one and only one archive. - */ - public MockAddonPackage(MockPlatformPackage basePlatform, int revision) { - super(new MockAddonTarget(basePlatform.getTarget(), revision), null /*props*/); - } - - /** - * A mock AddonTarget. - * This reimplements the minimum needed from the interface for our limited testing needs. - */ - static class MockAddonTarget implements IAndroidTarget { - - private final IAndroidTarget mParentTarget; - private final int mRevision; - - public MockAddonTarget(IAndroidTarget parentTarget, int revision) { - mParentTarget = parentTarget; - mRevision = revision; - } - - public String getClasspathName() { - return null; - } - - public String getDefaultSkin() { - return null; - } - - public String getDescription() { - return "mock addon target"; - } - - public String getFullName() { - return "mock addon target"; - } - - public String[] getAbiList() { - return new String[] { SdkConstants.ABI_ARMEABI }; - } - - public String getImagePath(String abiType) { - return SdkConstants.OS_IMAGES_FOLDER; - } - - public String getLocation() { - return ""; - } - - public String getName() { - return "mock addon target"; - } - - public IOptionalLibrary[] getOptionalLibraries() { - return null; - } - - public IAndroidTarget getParent() { - return mParentTarget; - } - - public String getPath(int pathId) { - return null; - } - - public String[] getPlatformLibraries() { - return null; - } - - public String getProperty(String name) { - return null; - } - - public Integer getProperty(String name, Integer defaultValue) { - return defaultValue; - } - - public Boolean getProperty(String name, Boolean defaultValue) { - return defaultValue; - } - - public Map getProperties() { - return null; - } - - public int getRevision() { - return mRevision; - } - - public String[] getSkins() { - return null; - } - - public int getUsbVendorId() { - return 0; - } - - public String getVendor() { - return null; - } - - public AndroidVersion getVersion() { - return mParentTarget.getVersion(); - } - - public String getVersionName() { - return String.format("mock-addon-%1$d", getVersion().getApiLevel()); - } - - public String hashString() { - return getVersionName(); - } - - /** Returns false for an addon. */ - public boolean isPlatform() { - return false; - } - - public boolean canRunOn(IAndroidTarget target) { - throw new UnsupportedOperationException("Implement this as needed for tests"); - } - - public int compareTo(IAndroidTarget o) { - throw new UnsupportedOperationException("Implement this as needed for tests"); - } - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockBrokenPackage.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockBrokenPackage.java deleted file mode 100755 index 289305b..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockBrokenPackage.java +++ /dev/null @@ -1,43 +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. - */ - -package com.android.sdklib.internal.repository; - - -/** - * A mock {@link BrokenPackage} for testing. - *

- * By design, this package contains one and only one archive. - */ -public class MockBrokenPackage extends BrokenPackage { - - public MockBrokenPackage(int minApiLevel, int exactApiLevel) { - this(null, null, minApiLevel, exactApiLevel); - } - - public MockBrokenPackage( - String shortDescription, - String longDescription, - int minApiLevel, - int exactApiLevel) { - super(null /*props*/, - shortDescription, - longDescription, - minApiLevel, - exactApiLevel, - null /*osPath*/); - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockEmptySdkManager.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockEmptySdkManager.java deleted file mode 100755 index f66734b..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockEmptySdkManager.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.eclipse.org/org/documents/epl-v10.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.internal.repository; - -import com.android.sdklib.IAndroidTarget; -import com.android.sdklib.SdkManager; - -/** - * An invalid SDK Manager, just good enough to avoid passing a null reference. - */ -public class MockEmptySdkManager extends SdkManager { - public MockEmptySdkManager(String osSdkPath) { - super(osSdkPath); - setTargets(new IAndroidTarget[0]); - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockMonitor.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockMonitor.java deleted file mode 100755 index 56a7c6c..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockMonitor.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.eclipse.org/org/documents/epl-v10.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.internal.repository; - - -/** - * Mock implementation of {@link ITaskMonitor} that simply captures - * the output in local strings. Does not provide any UI and has no - * support for creating sub-monitors. - */ -public class MockMonitor implements ITaskMonitor { - - String mCapturedResults = ""; - String mCapturedDescriptions = ""; - - public String getCapturedResults() { - return mCapturedResults; - } - - public String getCapturedDescriptions() { - return mCapturedDescriptions; - } - - public void setResult(String resultFormat, Object... args) { - mCapturedResults += String.format(resultFormat, args) + "\n"; - } - - public void setProgressMax(int max) { - } - - public void setDescription(String descriptionFormat, Object... args) { - mCapturedDescriptions += String.format(descriptionFormat, args) + "\n"; - } - - public boolean isCancelRequested() { - return false; - } - - public void incProgress(int delta) { - } - - public int getProgress() { - return 0; - } - - public boolean displayPrompt(String title, String message) { - return false; - } - - public ITaskMonitor createSubMonitor(int tickCount) { - return null; - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockPlatformPackage.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockPlatformPackage.java deleted file mode 100755 index ad1ab16..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockPlatformPackage.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.internal.repository; - -import com.android.sdklib.AndroidVersion; -import com.android.sdklib.IAndroidTarget; -import com.android.sdklib.SdkConstants; - -import java.util.Map; -import java.util.Properties; - -/** - * A mock {@link PlatformPackage} for testing. - * - * By design, this package contains one and only one archive. - */ -public class MockPlatformPackage extends PlatformPackage { - - private final IAndroidTarget mTarget; - - /** - * Creates a {@link MockPlatformTarget} with the requested API and revision - * and then a {@link MockPlatformPackage} wrapping it. - * - * By design, this package contains one and only one archive. - */ - public MockPlatformPackage(int apiLevel, int revision) { - this(new MockPlatformTarget(apiLevel, revision), null /*props*/); - } - - /** - * Creates a {@link MockPlatformTarget} with the requested API and revision - * and then a {@link MockPlatformPackage} wrapping it. - * - * Also sets the min-tools-rev of the platform. - * - * By design, this package contains one and only one archive. - */ - public MockPlatformPackage(int apiLevel, int revision, int min_tools_rev) { - this(new MockPlatformTarget(apiLevel, revision), createProps(min_tools_rev)); - } - - /** A little trick to be able to capture the target new after passing it to the super. */ - private MockPlatformPackage(IAndroidTarget target, Properties props) { - super(target, props); - mTarget = target; - } - - private static Properties createProps(int min_tools_rev) { - Properties props = new Properties(); - props.setProperty(PlatformPackage.PROP_MIN_TOOLS_REV, Integer.toString((min_tools_rev))); - return props; - } - - public IAndroidTarget getTarget() { - return mTarget; - } - - /** - * A mock PlatformTarget. - * This reimplements the minimum needed from the interface for our limited testing needs. - */ - static class MockPlatformTarget implements IAndroidTarget { - - private final int mApiLevel; - private final int mRevision; - - public MockPlatformTarget(int apiLevel, int revision) { - mApiLevel = apiLevel; - mRevision = revision; - - } - - public String getClasspathName() { - return null; - } - - public String getDefaultSkin() { - return null; - } - - public String getDescription() { - return "mock platform target"; - } - - public String getFullName() { - return "mock platform target"; - } - - public String[] getAbiList() { - return new String[] { SdkConstants.ABI_ARMEABI }; - } - - public String getImagePath(String abiType) { - return SdkConstants.OS_IMAGES_FOLDER; - } - - public String getLocation() { - return ""; - } - - public String getName() { - return "mock platform target"; - } - - public IOptionalLibrary[] getOptionalLibraries() { - return null; - } - - public IAndroidTarget getParent() { - return null; - } - - public String getPath(int pathId) { - return null; - } - - public String[] getPlatformLibraries() { - return null; - } - - public String getProperty(String name) { - return null; - } - - public Integer getProperty(String name, Integer defaultValue) { - return defaultValue; - } - - public Boolean getProperty(String name, Boolean defaultValue) { - return defaultValue; - } - - public Map getProperties() { - return null; - } - - public int getRevision() { - return mRevision; - } - - public String[] getSkins() { - return null; - } - - public int getUsbVendorId() { - return 0; - } - - public String getVendor() { - return null; - } - - public AndroidVersion getVersion() { - return new AndroidVersion(mApiLevel, null /*codename*/); - } - - public String getVersionName() { - return String.format("android-%1$d", mApiLevel); - } - - public String hashString() { - return getVersionName(); - } - - /** Returns true for a platform. */ - public boolean isPlatform() { - return true; - } - - public boolean canRunOn(IAndroidTarget target) { - throw new UnsupportedOperationException("Implement this as needed for tests"); - } - - public int compareTo(IAndroidTarget o) { - throw new UnsupportedOperationException("Implement this as needed for tests"); - } - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockPlatformToolPackage.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockPlatformToolPackage.java deleted file mode 100755 index 0befa80..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockPlatformToolPackage.java +++ /dev/null @@ -1,49 +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.sdklib.internal.repository; - -import com.android.sdklib.internal.repository.Archive.Arch; -import com.android.sdklib.internal.repository.Archive.Os; - -/** - * A mock {@link PlatformToolPackage} for testing. - * - * By design, this package contains one and only one archive. - */ -public class MockPlatformToolPackage extends PlatformToolPackage { - - /** - * Creates a {@link MockPlatformToolPackage} with the given revision and hardcoded defaults - * for everything else. - *

- * By design, this creates a package with one and only one archive. - */ - public MockPlatformToolPackage(int revision) { - super( - null, // source, - null, // props, - revision, - null, // license, - "desc", // description, - "url", // descUrl, - Os.getCurrentOs(), // archiveOs, - Arch.getCurrentArch(), // archiveArch, - "foo" // archiveOsPath - ); - } -} - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockToolPackage.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockToolPackage.java deleted file mode 100755 index 8ce704c..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/MockToolPackage.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.internal.repository; - -import com.android.sdklib.internal.repository.Archive.Arch; -import com.android.sdklib.internal.repository.Archive.Os; - -import java.util.Properties; - -/** - * A mock {@link ToolPackage} for testing. - * - * By design, this package contains one and only one archive. - */ -public class MockToolPackage extends ToolPackage { - - /** - * Creates a {@link MockToolPackage} with the given revision and hardcoded defaults - * for everything else. - *

- * By design, this creates a package with one and only one archive. - */ - public MockToolPackage(int revision, int min_platform_tools_rev) { - super( - null, // source, - createProps(min_platform_tools_rev), // props, - revision, - null, // license, - "desc", // description, - "url", // descUrl, - Os.getCurrentOs(), // archiveOs, - Arch.getCurrentArch(), // archiveArch, - "foo" // archiveOsPath - ); - } - - private static Properties createProps(int min_platform_tools_rev) { - Properties props = new Properties(); - props.setProperty(ToolPackage.PROP_MIN_PLATFORM_TOOLS_REV, - Integer.toString((min_platform_tools_rev))); - return props; - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/SdkAddonSourceTest.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/SdkAddonSourceTest.java deleted file mode 100755 index ea6c4f6..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/SdkAddonSourceTest.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.eclipse.org/org/documents/epl-v10.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.internal.repository; - -import com.android.sdklib.SdkManager; -import com.android.sdklib.repository.SdkAddonConstants; - -import org.w3c.dom.Document; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; - -import junit.framework.TestCase; - -/** - * Tests for {@link SdkAddonSource} - */ -public class SdkAddonSourceTest extends TestCase { - - /** - * An internal helper class to give us visibility to the protected members we want - * to test. - */ - private static class MockSdkAddonSource extends SdkAddonSource { - public MockSdkAddonSource() { - super("fake-url", null /*uiName*/); - } - - public Document _findAlternateToolsXml(InputStream xml) { - return super.findAlternateToolsXml(xml); - } - - public boolean _parsePackages(Document doc, String nsUri, ITaskMonitor monitor) { - return super.parsePackages(doc, nsUri, monitor); - } - - public int _getXmlSchemaVersion(InputStream xml) { - return super.getXmlSchemaVersion(xml); - } - - public String _validateXml(InputStream xml, String url, int version, - String[] outError, Boolean[] validatorFound) { - return super.validateXml(xml, url, version, outError, validatorFound); - } - - public Document _getDocument(InputStream xml, ITaskMonitor monitor) { - return super.getDocument(xml, monitor); - } - - } - - private MockSdkAddonSource mSource; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - mSource = new MockSdkAddonSource(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - mSource = null; - } - - public void testFindAlternateToolsXml_Errors() throws Exception { - // Support null as input - Document result = mSource._findAlternateToolsXml(null); - assertNull(result); - - // Support an empty input - String str = ""; - ByteArrayInputStream input = new ByteArrayInputStream(str.getBytes()); - result = mSource._findAlternateToolsXml(input); - assertNull(result); - - // Support a random string as input - str = "Some random string, not even HTML nor XML"; - input = new ByteArrayInputStream(str.getBytes()); - result = mSource._findAlternateToolsXml(input); - assertNull(result); - - // Support an HTML input, e.g. a typical 404 document as returned by DL - str = " " + - " " + - "404 Not Found " + " " + " " + " " + - " " + - " " + - " " + - "
" + - "Google   " + - " 
Error
 
" + "

" + "

Not Found

" + - "The requested URL /404 was not found on this server." + " " + "

" + - "

" + - "
\"\"
" + - " "; - input = new ByteArrayInputStream(str.getBytes()); - result = mSource._findAlternateToolsXml(input); - assertNull(result); - - // Support some random XML document, totally unrelated to our sdk-repository schema - str = "" + - "" + - " " + - ""; - input = new ByteArrayInputStream(str.getBytes()); - result = mSource._findAlternateToolsXml(input); - assertNull(result); - } - - /** - * Validate that findAlternateToolsXml doesn't work for addon even - * when trying to load a valid addon xml. - */ - public void testFindAlternateToolsXml_1() throws Exception { - InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_1.xml"); - - Document result = mSource._findAlternateToolsXml(xmlStream); - assertNull(result); - } - - /** - * Validate we can still load a valid addon schema version 1 - */ - public void testLoadOldXml_1() throws Exception { - InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_1.xml"); - - // guess the version from the XML document - int version = mSource._getXmlSchemaVersion(xmlStream); - assertEquals(1, version); - - Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; - String[] validationError = new String[] { null }; - String url = "not-a-valid-url://" + SdkAddonConstants.URL_DEFAULT_FILENAME; - - String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound); - assertEquals(Boolean.TRUE, validatorFound[0]); - assertEquals(null, validationError[0]); - assertEquals(SdkAddonConstants.getSchemaUri(1), uri); - - // Validation was successful, load the document - MockMonitor monitor = new MockMonitor(); - Document doc = mSource._getDocument(xmlStream, monitor); - assertNotNull(doc); - - // Get the packages - assertTrue(mSource._parsePackages(doc, uri, monitor)); - - assertEquals("Found My First add-on by John Doe, Android API 1, revision 1\n" + - "Found My Second add-on by John Deer, Android API 2, revision 42\n" + - "Found This add-on has no libraries by Joe Bar, Android API 4, revision 3\n" + - "Found G USB Driver package, revision 43 (Obsolete)\n" + - "Found Android Vendor Extra API Dep package, revision 2 (Obsolete)\n" + - "Found Unkown Extra package, revision 2 (Obsolete)\n", - monitor.getCapturedDescriptions()); - assertEquals("", monitor.getCapturedResults()); - - // check the packages we found... we expected to find 11 packages with each at least - // one archive. - Package[] pkgs = mSource.getPackages(); - assertEquals(6, pkgs.length); - for (Package p : pkgs) { - assertTrue(p.getArchives().length >= 1); - } - - // Check the extra packages path, vendor, install folder - - final String osSdkPath = "SDK"; - final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath); - - ArrayList extraPaths = new ArrayList(); - ArrayList extraVendors = new ArrayList(); - ArrayList extraInstall = new ArrayList(); - for (Package p : pkgs) { - if (p instanceof ExtraPackage) { - extraPaths.add(((ExtraPackage) p).getPath()); - extraVendors.add(((ExtraPackage) p).getVendor()); - extraInstall.add(((ExtraPackage) p).getInstallFolder(osSdkPath, sdkManager)); - } - } - assertEquals( - "[usb_driver, extra_api_dep, extra0000005f]", - Arrays.toString(extraPaths.toArray())); - assertEquals( - "[g, android_vendor, vendor0000005f]", - Arrays.toString(extraVendors.toArray())); - assertEquals( - ("[SDK/extras/g/usb_driver, " + - "SDK/extras/android_vendor/extra_api_dep, " + - "SDK/extras/vendor0000005f/extra0000005f]").replace('/', File.separatorChar), - Arrays.toString(extraInstall.toArray())); - } - - /** - * Returns an SdkLib file resource as a {@link ByteArrayInputStream}, - * which has the advantage that we can use {@link InputStream#reset()} on it - * at any time to read it multiple times. - *

- * The default for getResourceAsStream() is to return a {@link FileInputStream} that - * does not support reset(), yet we need it in the tested code. - * - * @throws IOException if some I/O read fails - */ - private ByteArrayInputStream getTestResource(String filename) throws IOException { - InputStream xmlStream = this.getClass().getResourceAsStream(filename); - - try { - byte[] data = new byte[8192]; - int offset = 0; - int n; - - while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) { - offset += n; - - if (offset == data.length) { - byte[] newData = new byte[offset + 8192]; - System.arraycopy(data, 0, newData, 0, offset); - data = newData; - } - } - - return new ByteArrayInputStream(data, 0, offset); - } finally { - if (xmlStream != null) { - xmlStream.close(); - } - } - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/SdkRepoSourceTest.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/SdkRepoSourceTest.java deleted file mode 100755 index aee811f..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/SdkRepoSourceTest.java +++ /dev/null @@ -1,429 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.eclipse.org/org/documents/epl-v10.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.internal.repository; - -import com.android.sdklib.SdkManager; -import com.android.sdklib.repository.SdkRepoConstants; - -import org.w3c.dom.Document; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; - -import junit.framework.TestCase; - -/** - * Tests for {@link SdkRepoSource} - */ -public class SdkRepoSourceTest extends TestCase { - - /** - * An internal helper class to give us visibility to the protected members we want - * to test. - */ - private static class MockSdkRepoSource extends SdkRepoSource { - public MockSdkRepoSource() { - super("fake-url", null /*uiName*/); - } - - public Document _findAlternateToolsXml(InputStream xml) throws IOException { - return super.findAlternateToolsXml(xml); - } - - public boolean _parsePackages(Document doc, String nsUri, ITaskMonitor monitor) { - return super.parsePackages(doc, nsUri, monitor); - } - - public int _getXmlSchemaVersion(InputStream xml) { - return super.getXmlSchemaVersion(xml); - } - - public String _validateXml(InputStream xml, String url, int version, - String[] outError, Boolean[] validatorFound) { - return super.validateXml(xml, url, version, outError, validatorFound); - } - - public Document _getDocument(InputStream xml, ITaskMonitor monitor) { - return super.getDocument(xml, monitor); - } - - } - - private MockSdkRepoSource mSource; - - @Override - protected void setUp() throws Exception { - super.setUp(); - - mSource = new MockSdkRepoSource(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - mSource = null; - } - - public void testFindAlternateToolsXml_Errors() throws Exception { - // Support null as input - Document result = mSource._findAlternateToolsXml(null); - assertNull(result); - - // Support an empty input - String str = ""; - ByteArrayInputStream input = new ByteArrayInputStream(str.getBytes()); - result = mSource._findAlternateToolsXml(input); - assertNull(result); - - // Support a random string as input - str = "Some random string, not even HTML nor XML"; - input = new ByteArrayInputStream(str.getBytes()); - result = mSource._findAlternateToolsXml(input); - assertNull(result); - - // Support an HTML input, e.g. a typical 404 document as returned by DL - str = " " + - " " + - "404 Not Found " + " " + " " + " " + - " " + - " " + - " " + - "
" + - "Google   " + - " 
Error
 
" + "

" + "

Not Found

" + - "The requested URL /404 was not found on this server." + " " + "

" + - "

" + - "
\"\"
" + - " "; - input = new ByteArrayInputStream(str.getBytes()); - result = mSource._findAlternateToolsXml(input); - assertNull(result); - - // Support some random XML document, totally unrelated to our sdk-repository schema - str = "" + - "" + - " " + - ""; - input = new ByteArrayInputStream(str.getBytes()); - result = mSource._findAlternateToolsXml(input); - assertNull(result); - } - - /** - * Validate we can load a new schema version 3 using the "alternate future tool" mode. - */ - public void testFindAlternateToolsXml_3() throws Exception { - InputStream xmlStream = getTestResource( - "/com/android/sdklib/testdata/repository_sample_3.xml"); - - Document result = mSource._findAlternateToolsXml(xmlStream); - assertNotNull(result); - MockMonitor mon = new MockMonitor(); - assertTrue(mSource._parsePackages(result, SdkRepoConstants.NS_URI, mon)); - - assertEquals("Found Android SDK Tools, revision 1\n" + - "Found Android SDK Tools, revision 42\n" + - "Found Android SDK Platform-tools, revision 3\n", - mon.getCapturedDescriptions()); - assertEquals("", mon.getCapturedResults()); - - // check the packages we found... we expected to find 2 tool packages and 1 - // platform-tools package, with at least 1 archive each. - Package[] pkgs = mSource.getPackages(); - assertEquals(3, pkgs.length); - for (Package p : pkgs) { - assertTrue((p instanceof ToolPackage) || (p instanceof PlatformToolPackage)); - assertTrue(p.getArchives().length >= 1); - } - } - - /** - * Validate we can still load an old repository in schema version 1 - */ - public void testLoadOldXml_1() throws Exception { - InputStream xmlStream = getTestResource( - "/com/android/sdklib/testdata/repository_sample_1.xml"); - - // guess the version from the XML document - int version = mSource._getXmlSchemaVersion(xmlStream); - assertEquals(1, version); - - Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; - String[] validationError = new String[] { null }; - String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME; - - String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound); - assertEquals(Boolean.TRUE, validatorFound[0]); - assertEquals(null, validationError[0]); - assertEquals(SdkRepoConstants.getSchemaUri(1), uri); - - // Validation was successful, load the document - MockMonitor monitor = new MockMonitor(); - Document doc = mSource._getDocument(xmlStream, monitor); - assertNotNull(doc); - - // Get the packages - assertTrue(mSource._parsePackages(doc, uri, monitor)); - - assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" + - "Found Documentation for Android SDK, API 1, revision 1\n" + - "Found My First add-on by John Doe, Android API 1, revision 1\n" + - "Found SDK Platform Android 1.1, API 2, revision 12\n" + - "Found My Second add-on by John Deer, Android API 2, revision 42\n" + - "Found SDK Platform Android Pastry Preview, revision 3\n" + - "Found Android SDK Tools, revision 1\n" + - "Found Documentation for Android SDK, API 2, revision 42\n" + - "Found Android SDK Tools, revision 42\n" + - "Found This add-on has no libraries by Joe Bar, Android API 4, revision 3\n" + - "Found Usb Driver package, revision 43\n", - monitor.getCapturedDescriptions()); - assertEquals("", monitor.getCapturedResults()); - - // check the packages we found... we expected to find 11 packages with each at least - // one archive. - Package[] pkgs = mSource.getPackages(); - assertEquals(11, pkgs.length); - for (Package p : pkgs) { - assertTrue(p.getArchives().length >= 1); - } - - // Check the extra packages path, vendor, install folder - - final String osSdkPath = "SDK"; - final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath); - - ArrayList extraPaths = new ArrayList(); - ArrayList extraVendors = new ArrayList(); - ArrayList extraInstall = new ArrayList(); - for (Package p : pkgs) { - if (p instanceof ExtraPackage) { - extraPaths.add(((ExtraPackage) p).getPath()); - extraVendors.add(((ExtraPackage) p).getVendor()); - extraInstall.add(((ExtraPackage) p).getInstallFolder(osSdkPath, sdkManager)); - } - } - assertEquals( - "[usb_driver]", - Arrays.toString(extraPaths.toArray())); - assertEquals( - "[]", - Arrays.toString(extraVendors.toArray())); - assertEquals( - "[SDK/extras/usb_driver]".replace('/', File.separatorChar), - Arrays.toString(extraInstall.toArray())); - } - - /** - * Validate we can still load an old repository in schema version 2 - */ - public void testLoadOldXml_2() throws Exception { - InputStream xmlStream = getTestResource( - "/com/android/sdklib/testdata/repository_sample_2.xml"); - - // guess the version from the XML document - int version = mSource._getXmlSchemaVersion(xmlStream); - assertEquals(2, version); - - Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; - String[] validationError = new String[] { null }; - String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME; - - String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound); - assertEquals(Boolean.TRUE, validatorFound[0]); - assertEquals(null, validationError[0]); - assertEquals(SdkRepoConstants.getSchemaUri(2), uri); - - // Validation was successful, load the document - MockMonitor monitor = new MockMonitor(); - Document doc = mSource._getDocument(xmlStream, monitor); - assertNotNull(doc); - - // Get the packages - assertTrue(mSource._parsePackages(doc, uri, monitor)); - - assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" + - "Found Documentation for Android SDK, API 1, revision 1\n" + - "Found My First add-on by John Doe, Android API 1, revision 1\n" + - "Found SDK Platform Android 1.1, API 2, revision 12\n" + - "Found My Second add-on by John Deer, Android API 2, revision 42\n" + - "Found SDK Platform Android Pastry Preview, revision 3\n" + - "Found Android SDK Tools, revision 1\n" + - "Found Documentation for Android SDK, API 2, revision 42\n" + - "Found Android SDK Tools, revision 42\n" + - "Found This add-on has no libraries by Joe Bar, Android API 4, revision 3\n" + - "Found Usb Driver package, revision 43 (Obsolete)\n" + - "Found Extra API Dep package, revision 2 (Obsolete)\n" + - "Found Samples for SDK API 14, revision 24 (Obsolete)\n", - monitor.getCapturedDescriptions()); - assertEquals("", monitor.getCapturedResults()); - - // check the packages we found... we expected to find 13 packages with each at least - // one archive. - Package[] pkgs = mSource.getPackages(); - assertEquals(13, pkgs.length); - for (Package p : pkgs) { - assertTrue(p.getArchives().length >= 1); - } - - // Check the extra packages path, vendor, install folder - - final String osSdkPath = "SDK"; - final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath); - - ArrayList extraPaths = new ArrayList(); - ArrayList extraVendors = new ArrayList(); - ArrayList extraInstall = new ArrayList(); - for (Package p : pkgs) { - if (p instanceof ExtraPackage) { - extraPaths.add(((ExtraPackage) p).getPath()); - extraVendors.add(((ExtraPackage) p).getVendor()); - extraInstall.add(((ExtraPackage) p).getInstallFolder(osSdkPath, sdkManager)); - } - } - assertEquals( - "[usb_driver, extra_api_dep]", - Arrays.toString(extraPaths.toArray())); - assertEquals( - "[, ]", - Arrays.toString(extraVendors.toArray())); - assertEquals( - "[SDK/extras/usb_driver, SDK/extras/extra_api_dep]".replace('/', File.separatorChar), - Arrays.toString(extraInstall.toArray())); - } - - /** - * Validate what we can load from repository in schema version 3 - */ - public void testLoadXml_3() throws Exception { - InputStream xmlStream = getTestResource( - "/com/android/sdklib/testdata/repository_sample_3.xml"); - - // guess the version from the XML document - int version = mSource._getXmlSchemaVersion(xmlStream); - assertEquals(3, version); - - Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; - String[] validationError = new String[] { null }; - String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME; - - String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound); - assertEquals(Boolean.TRUE, validatorFound[0]); - assertEquals(null, validationError[0]); - assertEquals(SdkRepoConstants.getSchemaUri(3), uri); - - // Validation was successful, load the document - MockMonitor monitor = new MockMonitor(); - Document doc = mSource._getDocument(xmlStream, monitor); - assertNotNull(doc); - - // Get the packages - assertTrue(mSource._parsePackages(doc, uri, monitor)); - - assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" + - "Found Documentation for Android SDK, API 1, revision 1\n" + - "Found SDK Platform Android 1.1, API 2, revision 12\n" + - "Found SDK Platform Android Pastry Preview, revision 3\n" + - "Found Android SDK Tools, revision 1\n" + - "Found Documentation for Android SDK, API 2, revision 42\n" + - "Found Android SDK Tools, revision 42\n" + - "Found Android SDK Platform-tools, revision 3\n" + - "Found A USB Driver package, revision 43 (Obsolete)\n" + - "Found Android Vendor Extra API Dep package, revision 2 (Obsolete)\n" + - "Found Samples for SDK API 14, revision 24 (Obsolete)\n", - monitor.getCapturedDescriptions()); - assertEquals("", monitor.getCapturedResults()); - - // check the packages we found... we expected to find 13 packages with each at least - // one archive. - Package[] pkgs = mSource.getPackages(); - assertEquals(11, pkgs.length); - for (Package p : pkgs) { - assertTrue(p.getArchives().length >= 1); - } - - // Check the extra packages path, vendor, install folder - - final String osSdkPath = "SDK"; - final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath); - - ArrayList extraPaths = new ArrayList(); - ArrayList extraVendors = new ArrayList(); - ArrayList extraInstall = new ArrayList(); - for (Package p : pkgs) { - if (p instanceof ExtraPackage) { - extraPaths.add(((ExtraPackage) p).getPath()); - extraVendors.add(((ExtraPackage) p).getVendor()); - extraInstall.add(((ExtraPackage) p).getInstallFolder(osSdkPath, sdkManager)); - } - } - assertEquals( - "[usb_driver, extra_api_dep]", - Arrays.toString(extraPaths.toArray())); - assertEquals( - "[a, android_vendor]", - Arrays.toString(extraVendors.toArray())); - assertEquals( - "[SDK/extras/a/usb_driver, SDK/extras/android_vendor/extra_api_dep]" - .replace('/', File.separatorChar), - Arrays.toString(extraInstall.toArray())); - } - - /** - * Returns an SdkLib file resource as a {@link ByteArrayInputStream}, - * which has the advantage that we can use {@link InputStream#reset()} on it - * at any time to read it multiple times. - *

- * The default for getResourceAsStream() is to return a {@link FileInputStream} that - * does not support reset(), yet we need it in the tested code. - * - * @throws IOException if some I/O read fails - */ - private ByteArrayInputStream getTestResource(String filename) throws IOException { - InputStream xmlStream = this.getClass().getResourceAsStream(filename); - - try { - byte[] data = new byte[8192]; - int offset = 0; - int n; - - while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) { - offset += n; - - if (offset == data.length) { - byte[] newData = new byte[offset + 8192]; - System.arraycopy(data, 0, newData, 0, offset); - data = newData; - } - } - - return new ByteArrayInputStream(data, 0, offset); - } finally { - if (xmlStream != null) { - xmlStream.close(); - } - } - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/mock/MockLog.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/mock/MockLog.java deleted file mode 100644 index 3ef0140..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/mock/MockLog.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.mock; - -import com.android.sdklib.ISdkLog; - -import java.util.ArrayList; -import java.util.Formatter; - -/** - * An instance of {@link ISdkLog} that captures all messages to an internal list. - * Messages can be retrieved later using {@link #toString()}. - * Useful for unit-tests. - */ -public class MockLog implements ISdkLog { - private ArrayList mMessages = new ArrayList(); - - private void add(String code, String format, Object... args) { - mMessages.add(new Formatter().format(code + format, args).toString()); - } - - public void warning(String format, Object... args) { - add("W ", format, args); - } - - public void printf(String format, Object... args) { - add("P ", format, args); - } - - 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(); - } - - public void clear() { - mMessages.clear(); - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/SdkRepositoryTest.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/SdkRepositoryTest.java deleted file mode 100755 index 2bbc088..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/SdkRepositoryTest.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Eclipse Public License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.eclipse.org/org/documents/epl-v10.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.sdklib.repository; - -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -import java.io.InputStream; -import java.io.StringReader; - -import javax.xml.XMLConstants; -import javax.xml.transform.Source; -import javax.xml.transform.stream.StreamSource; -import javax.xml.validation.Schema; -import javax.xml.validation.SchemaFactory; -import javax.xml.validation.Validator; - -import junit.framework.TestCase; - -/** - * Tests local validation of an SDK Repository sample XMLs using an XML Schema validator. - * - * References: - * http://www.ibm.com/developerworks/xml/library/x-javaxmlvalidapi.html - */ -public class SdkRepositoryTest extends TestCase { - - @Override - protected void setUp() throws Exception { - super.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * A SAX error handler that captures the errors and warnings. - * This allows us to capture *all* errors and just not get an exception on the first one. - */ - private static class CaptureErrorHandler implements ErrorHandler { - - private String mWarnings = ""; - private String mErrors = ""; - - @SuppressWarnings("unused") - public String getErrors() { - return mErrors; - } - - @SuppressWarnings("unused") - public String getWarnings() { - return mWarnings; - } - - /** - * Verifies if the handler captures some errors or warnings. - * Prints them on stderr. - * Also fails the unit test if any error was generated. - */ - public void verify() { - if (mWarnings.length() > 0) { - System.err.println(mWarnings); - } - - if (mErrors.length() > 0) { - System.err.println(mErrors); - fail(mErrors); - } - } - - /** - * @throws SAXException - */ - public void error(SAXParseException ex) throws SAXException { - mErrors += "Error: " + ex.getMessage() + "\n"; - } - - /** - * @throws SAXException - */ - public void fatalError(SAXParseException ex) throws SAXException { - mErrors += "Fatal Error: " + ex.getMessage() + "\n"; - } - - /** - * @throws SAXException - */ - public void warning(SAXParseException ex) throws SAXException { - mWarnings += "Warning: " + ex.getMessage() + "\n"; - } - - } - - // --- Helpers ------------ - - /** Helper method that returns a validator for our XSD */ - private Validator getValidator(int version, CaptureErrorHandler handler) throws SAXException { - InputStream xsdStream = SdkRepoConstants.getXsdStream(version); - SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); - Schema schema = factory.newSchema(new StreamSource(xsdStream)); - Validator validator = schema.newValidator(); - if (handler != null) { - validator.setErrorHandler(handler); - } - - return validator; - } - - /** An helper that validates a string against an expected regexp. */ - private void assertRegex(String expectedRegexp, String actualString) { - assertNotNull(actualString); - assertTrue( - String.format("Regexp Assertion Failed:\nExpected: %s\nActual: %s\n", - expectedRegexp, actualString), - actualString.matches(expectedRegexp)); - } - - // --- Tests ------------ - - /** Validate a valid sample using namespace version 1 using an InputStream */ - public void testValidateLocalRepositoryFile1() throws Exception { - InputStream xmlStream = this.getClass().getResourceAsStream( - "/com/android/sdklib/testdata/repository_sample_1.xml"); - Source source = new StreamSource(xmlStream); - - CaptureErrorHandler handler = new CaptureErrorHandler(); - Validator validator = getValidator(1, handler); - validator.validate(source); - handler.verify(); - } - - /** Validate a valid sample using namespace version 2 using an InputStream */ - public void testValidateLocalRepositoryFile2() throws Exception { - InputStream xmlStream = this.getClass().getResourceAsStream( - "/com/android/sdklib/testdata/repository_sample_2.xml"); - Source source = new StreamSource(xmlStream); - - CaptureErrorHandler handler = new CaptureErrorHandler(); - Validator validator = getValidator(2, handler); - validator.validate(source); - handler.verify(); - } - - /** Validate a valid sample using namespace version 3 using an InputStream */ - public void testValidateLocalRepositoryFile3() throws Exception { - InputStream xmlStream = this.getClass().getResourceAsStream( - "/com/android/sdklib/testdata/repository_sample_3.xml"); - Source source = new StreamSource(xmlStream); - - CaptureErrorHandler handler = new CaptureErrorHandler(); - Validator validator = getValidator(3, handler); - validator.validate(source); - handler.verify(); - } - - /** A document should at least have a root to be valid */ - public void testEmptyXml() throws Exception { - String document = ""; - - Source source = new StreamSource(new StringReader(document)); - - CaptureErrorHandler handler = new CaptureErrorHandler(); - Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, handler); - - try { - validator.validate(source); - } catch (SAXParseException e) { - // We expect to get this specific exception message - assertRegex("Premature end of file.*", e.getMessage()); - return; - } - // We shouldn't get here - handler.verify(); - fail(); - } - - private static String OPEN_TAG = - ""; - - private static String CLOSE_TAG = ""; - - /** A document with a root element containing no platform, addon, etc., is valid. */ - public void testEmptyRootXml() throws Exception { - String document = "" + - OPEN_TAG + - CLOSE_TAG; - - Source source = new StreamSource(new StringReader(document)); - - CaptureErrorHandler handler = new CaptureErrorHandler(); - Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, handler); - validator.validate(source); - handler.verify(); - } - - /** A document with an unknown element. */ - public void testUnknownContentXml() throws Exception { - String document = "" + - OPEN_TAG + - "" + - CLOSE_TAG; - - Source source = new StreamSource(new StringReader(document)); - - // don't capture the validator errors, we want it to fail and catch the exception - Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); - try { - validator.validate(source); - } catch (SAXParseException e) { - // We expect a parse expression referring to this grammar rule - assertRegex("cvc-complex-type.2.4.a: Invalid content was found.*", e.getMessage()); - return; - } - // If we get here, the validator has not failed as we expected it to. - fail(); - } - - /** A document with an incomplete element. */ - public void testIncompleteContentXml() throws Exception { - String document = "" + - OPEN_TAG + - " 1 " + - CLOSE_TAG; - - Source source = new StreamSource(new StringReader(document)); - - // don't capture the validator errors, we want it to fail and catch the exception - Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); - try { - validator.validate(source); - } catch (SAXParseException e) { - // We expect a parse error referring to this grammar rule - assertRegex("cvc-complex-type.2.4.a: Invalid content was found.*", e.getMessage()); - return; - } - // If we get here, the validator has not failed as we expected it to. - fail(); - } - - /** A document with a wrong type element. */ - public void testWrongTypeContentXml() throws Exception { - String document = "" + - OPEN_TAG + - " NotAnInteger " + - CLOSE_TAG; - - Source source = new StreamSource(new StringReader(document)); - - // don't capture the validator errors, we want it to fail and catch the exception - Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); - try { - validator.validate(source); - } catch (SAXParseException e) { - // We expect a parse error referring to this grammar rule - assertRegex("cvc-datatype-valid.1.2.1: 'NotAnInteger' is not a valid value.*", - e.getMessage()); - return; - } - // If we get here, the validator has not failed as we expected it to. - fail(); - } - - /** A document with an unknown license id. */ - public void testLicenseIdNotFound() throws Exception { - // we define a license named "lic1" and then reference "lic2" instead - String document = "" + - OPEN_TAG + - " some license " + - " 1 " + - "1 " + - " 1 2822ae37115ebf13412bbef91339ee0d9454525e " + - "url " + - CLOSE_TAG; - - Source source = new StreamSource(new StringReader(document)); - - // don't capture the validator errors, we want it to fail and catch the exception - Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); - try { - validator.validate(source); - } catch (SAXParseException e) { - // We expect a parse error referring to this grammar rule - assertRegex("cvc-id.1: There is no ID/IDREF binding for IDREF 'lic2'.*", - e.getMessage()); - return; - } - // If we get here, the validator has not failed as we expected it to. - fail(); - } - - /** A document a slash in an extra path. */ - public void testExtraPathWithSlash() throws Exception { - // we define a license named "lic1" and then reference "lic2" instead - String document = "" + - OPEN_TAG + - " 1 path/cannot\\contain\\segments " + - " 1 2822ae37115ebf13412bbef91339ee0d9454525e " + - "url " + - CLOSE_TAG; - - Source source = new StreamSource(new StringReader(document)); - - // don't capture the validator errors, we want it to fail and catch the exception - Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); - try { - validator.validate(source); - } catch (SAXParseException e) { - // We expect a parse error referring to this grammar rule - assertRegex("cvc-pattern-valid: Value 'path/cannot\\\\contain\\\\segments' is not facet-valid with respect to pattern.*", - e.getMessage()); - return; - } - // If we get here, the validator has not failed as we expected it to. - fail(); - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml b/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml deleted file mode 100644 index f1dce67..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-testapp.xml b/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-testapp.xml deleted file mode 100644 index f55b4e0..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-testapp.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-testapp2.xml b/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-testapp2.xml deleted file mode 100644 index d5bcac7..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/AndroidManifest-testapp2.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/addon_sample_1.xml b/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/addon_sample_1.xml deleted file mode 100755 index d761d73..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/addon_sample_1.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - This is the license - for this platform. - - - - Licenses are only of type 'text' right now, so this is implied. - - - - - - My First add-on - 1 - John Doe - 1 - - Some optional description - http://www.example.com/myfirstaddon - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/add-ons/first.zip - - - - - - android.blah.somelib - The description for this library. - - - - com.android.mymaps - - - - - - My Second add-on - 2 - John Deer - 42 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/second-42-win.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/second-42-linux.tar.bz2 - - - - - android.blah.somelib - The description for this library. - - - com.android.mymaps - - - - - - - - This add-on has no libraries - 4 - Joe Bar - 3 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/imnotanarchiveimadoctorjim.zip - - - - - - - - g - usb_driver - - 43 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/extraduff.zip - - - An Extra package for the USB driver, it will install in $SDK/usb_driver - http://www.example.com/extra.html - 3 - - - - - android_vendor - extra_api_dep - - 2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/extra_mega_duff.zip - - - Some extra package that has a min-api-level of 42 - http://www.example.com/extra.html - 3 - 42 - - - - - ____ - ____ - - 2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/extra_mega_duff.zip - - - Some extra package that has a min-api-level of 42 - http://www.example.com/extra.html - 3 - 42 - - - - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/addons_list_sample_1.xml b/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/addons_list_sample_1.xml deleted file mode 100755 index bda69d4..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/addons_list_sample_1.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - http://www.example.com/my_addons.xml - - My Example Add-ons. - - - - - http://www.example.co.jp/addons.xml - - ありがとうございます。 - - - - http://www.example.com/ - Example of directory URL. - - - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_1.xml b/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_1.xml deleted file mode 100755 index aa209d3..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_1.xml +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - - - This is the license - for this platform. - - - - Licenses are only of type 'text' right now, so this is implied. - - - - - - 1.0 - 1 - 3 - - Some optional description - http://www.example.com/platform1.html - This is an optional release note - for this package. It's a free multi-line text. - - http://some/url/for/the/release/note.html - 2 - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/plat1.zip - - - - - - 1 - 1 - - Some optional description - http://www.example.com/docs.html - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/docs/docs1.zip - - - - - - My First add-on - 1 - John Doe - 1 - - Some optional description - http://www.example.com/myfirstaddon - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/add-ons/first.zip - - - - - - android.blah.somelib - The description for this library. - - - - com.android.mymaps - - - - - - 1.1 - 2 - 12 - - - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-win.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-mac.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-mac.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-linux.tar.bz2 - - - - - - My Second add-on - 2 - John Deer - 42 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/second-42-win.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/second-42-linux.tar.bz2 - - - - - android.blah.somelib - The description for this library. - - - com.android.mymaps - - - - - - - Pastry - 5 - Pastry - 3 - - Preview version for Pastry - http://www.example.com/platform1.html - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/plat1.zip - - - - - - 1 - Some optional description - http://www.example.com/tools.html - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/tools1.zip - - - - - - 2 - 42 - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs/2.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs2-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs2-mac.tar.bz2 - - - - - - 42 - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools/2.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools2-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools2-mac.tar.bz2 - - - - - - - This add-on has no libraries - 4 - Joe Bar - 3 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/imnotanarchiveimadoctorjim.zip - - - - - - - - usb_driver - - 43 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/extraduff.zip - - - An Extra package for the USB driver, it will install in $SDK/usb_driver - http://www.example.com/extra.html - 3 - - - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_2.xml b/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_2.xml deleted file mode 100755 index 4b8e329..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_2.xml +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - - - This is the license - for this platform. - - - - Licenses are only of type 'text' right now, so this is implied. - - - - - - 1.0 - 1 - 3 - - Some optional description - http://www.example.com/platform1.html - This is an optional release note - for this package. It's a free multi-line text. - - http://some/url/for/the/release/note.html - 2 - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/plat1.zip - - - - - - 1 - 1 - - Some optional description - http://www.example.com/docs.html - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/docs/docs1.zip - - - - - - My First add-on - 1 - John Doe - 1 - - Some optional description - http://www.example.com/myfirstaddon - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/add-ons/first.zip - - - - - - android.blah.somelib - The description for this library. - - - - com.android.mymaps - - - - - - 1.1 - 2 - 12 - - - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-win.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-mac.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-mac.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-linux.tar.bz2 - - - - - - My Second add-on - 2 - John Deer - 42 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/second-42-win.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/second-42-linux.tar.bz2 - - - - - android.blah.somelib - The description for this library. - - - com.android.mymaps - - - - - - - Pastry - 5 - Pastry - 3 - - Preview version for Pastry - http://www.example.com/platform1.html - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/plat1.zip - - - - - - 1 - Some optional description - http://www.example.com/tools.html - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/tools1.zip - - - - - - 2 - 42 - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs/2.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs2-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs2-mac.tar.bz2 - - - - - - 42 - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools/2.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools2-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools2-mac.tar.bz2 - - - - - - - This add-on has no libraries - 4 - Joe Bar - 3 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/imnotanarchiveimadoctorjim.zip - - - - - - - - usb_driver - - 43 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/extraduff.zip - - - An Extra package for the USB driver, it will install in $SDK/usb_driver - http://www.example.com/extra.html - 3 - - - - - extra_api_dep - - 2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/extra_mega_duff.zip - - - Some extra package that has a min-api-level of 42 - http://www.example.com/extra.html - 3 - 42 - - - - - 14 - 24 - - - 65537 - 3822ae37115ebf13412bbef91339ee0d9454525e - distrib/sample_duff.zip - - - Some sample package - http://www.example.com/sample.html - 5 - This is obsolete - - - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_3.xml b/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_3.xml deleted file mode 100755 index 05a9c79..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample_3.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - This is the license - for this platform. - - - - Licenses are only of type 'text' right now, so this is implied. - - - - - - 1.0 - 1 - 3 - - Some optional description - http://www.example.com/platform1.html - This is an optional release note - for this package. It's a free multi-line text. - - http://some/url/for/the/release/note.html - 2 - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/plat1.zip - - - - - - 1 - 1 - - Some optional description - http://www.example.com/docs.html - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/docs/docs1.zip - - - - - - 1.1 - 2 - 12 - - - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-win.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-mac.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-mac.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-2-12-linux.tar.bz2 - - - - - - Pastry - 5 - Pastry - 3 - - Preview version for Pastry - http://www.example.com/platform1.html - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/plat1.zip - - - - - - 1 - Some optional description - http://www.example.com/tools.html - - 4 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - http://www.example.com/files/tools1.zip - - - - - - 2 - 42 - - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs/2.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs2-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/docs2-mac.tar.bz2 - - - - - - 42 - - 3 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools/2.zip - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools2-linux.tar.bz2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/tools2-mac.tar.bz2 - - - - - - 3 - - - - 65536 - 3822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-tools/2.zip - - - 65536 - 3822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-tools2-linux.tar.bz2 - - - 65536 - 3822ae37115ebf13412bbef91339ee0d9454525e - distrib/platform-tools2-mac.tar.bz2 - - - - - - a - usb_driver - - 43 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/extraduff.zip - - - An Extra package for the USB driver, it will install in $SDK/usb_driver - http://www.example.com/extra.html - 3 - - - - - android_vendor - extra_api_dep - - 2 - - - 65536 - 2822ae37115ebf13412bbef91339ee0d9454525e - distrib/extra_mega_duff.zip - - - Some extra package that has a min-api-level of 42 - http://www.example.com/extra.html - 3 - 42 - - - - - 14 - 24 - - - 65537 - 3822ae37115ebf13412bbef91339ee0d9454525e - distrib/sample_duff.zip - - - Some sample package - http://www.example.com/sample.html - 5 - This is obsolete - - - diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/xml/AndroidManifestParserTest.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/xml/AndroidManifestParserTest.java deleted file mode 100644 index 02725f4..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/xml/AndroidManifestParserTest.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (C) 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. - */ - -package com.android.sdklib.xml; - -import com.android.resources.Keyboard; -import com.android.resources.Navigation; -import com.android.resources.TouchScreen; -import com.android.sdklib.xml.ManifestData.UsesFeature; -import com.android.sdklib.xml.ManifestData.UsesLibrary; - -import java.io.InputStream; - -import junit.framework.TestCase; - -/** - * Tests for {@link AndroidManifestParser} - */ -public class AndroidManifestParserTest extends TestCase { - private ManifestData mManifestTestApp; - private ManifestData mManifestInstrumentation; - - private static final String TESTDATA_PATH = - "/com/android/sdklib/testdata/"; //$NON-NLS-1$ - private static final String INSTRUMENTATION_XML = TESTDATA_PATH + - "AndroidManifest-instrumentation.xml"; //$NON-NLS-1$ - private static final String TESTAPP_XML = TESTDATA_PATH + - "AndroidManifest-testapp.xml"; //$NON-NLS-1$ - private static final String PACKAGE_NAME = "com.android.testapp"; //$NON-NLS-1$ - private static final Integer VERSION_CODE = 42; - private static final String ACTIVITY_NAME = "com.android.testapp.MainActivity"; //$NON-NLS-1$ - private static final String LIBRARY_NAME = "android.test.runner"; //$NON-NLS-1$ - private static final String LIBRARY_NAME2 = "android.test.runner2"; //$NON-NLS-1$ - private static final String FEATURE_NAME = "com.foo.feature"; //$NON-NLS-1$ - private static final String INSTRUMENTATION_NAME = "android.test.InstrumentationTestRunner"; //$NON-NLS-1$ - private static final String INSTRUMENTATION_TARGET = "com.android.AndroidProject"; //$NON-NLS-1$ - - @Override - protected void setUp() throws Exception { - super.setUp(); - - InputStream manifestStream = this.getClass().getResourceAsStream(TESTAPP_XML); - - mManifestTestApp = AndroidManifestParser.parse(manifestStream); - assertNotNull(mManifestTestApp); - - manifestStream = this.getClass().getResourceAsStream(INSTRUMENTATION_XML); - mManifestInstrumentation = AndroidManifestParser.parse(manifestStream); - assertNotNull(mManifestInstrumentation); - } - - public void testGetInstrumentationInformation() { - assertEquals(1, mManifestInstrumentation.getInstrumentations().length); - assertEquals(INSTRUMENTATION_NAME, - mManifestInstrumentation.getInstrumentations()[0].getName()); - assertEquals(INSTRUMENTATION_TARGET, - mManifestInstrumentation.getInstrumentations()[0].getTargetPackage()); - } - - public void testGetPackage() { - assertEquals(PACKAGE_NAME, mManifestTestApp.getPackage()); - } - - public void testGetVersionCode() { - assertEquals(VERSION_CODE, mManifestTestApp.getVersionCode()); - assertEquals(null, mManifestInstrumentation.getVersionCode()); - } - - public void testMinSdkVersion() { - assertEquals(7, mManifestTestApp.getMinSdkVersion()); - assertEquals(8, mManifestTestApp.getTargetSdkVersion()); - - assertEquals("foo", mManifestInstrumentation.getMinSdkVersionString()); - assertEquals(ManifestData.MIN_SDK_CODENAME, mManifestInstrumentation.getMinSdkVersion()); - } - - public void testGetActivities() { - assertEquals(1, mManifestTestApp.getActivities().length); - ManifestData.Activity activity = mManifestTestApp.getActivities()[0]; - assertEquals(ACTIVITY_NAME, activity.getName()); - assertTrue(activity.hasAction()); - assertTrue(activity.isHomeActivity()); - assertTrue(activity.hasAction()); - assertEquals(activity, mManifestTestApp.getActivities()[0]); - } - - public void testGetLauncherActivity() { - ManifestData.Activity activity = mManifestTestApp.getLauncherActivity(); - assertEquals(ACTIVITY_NAME, activity.getName()); - assertTrue(activity.hasAction()); - assertTrue(activity.isHomeActivity()); - } - - public void testSupportsScreen() { - ManifestData.SupportsScreens supportsScreens = - mManifestTestApp.getSupportsScreensFromManifest(); - - assertNotNull(supportsScreens); - assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity()); - assertEquals(Boolean.TRUE, supportsScreens.getResizeable()); - assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens()); - assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens()); - assertEquals(Boolean.TRUE, supportsScreens.getLargeScreens()); - } - - public void testUsesConfiguration() { - ManifestData.UsesConfiguration usesConfig = mManifestTestApp.getUsesConfiguration(); - - assertNotNull(usesConfig); - assertEquals(Boolean.TRUE, usesConfig.getReqFiveWayNav()); - assertEquals(Navigation.NONAV, usesConfig.getReqNavigation()); - assertEquals(Boolean.TRUE, usesConfig.getReqHardKeyboard()); - assertEquals(Keyboard.TWELVEKEY, usesConfig.getReqKeyboardType()); - assertEquals(TouchScreen.FINGER, usesConfig.getReqTouchScreen()); - } - - private void assertEquals(ManifestData.Activity lhs, ManifestData.Activity rhs) { - assertTrue(lhs == rhs || (lhs != null && rhs != null)); - if (lhs != null && rhs != null) { - assertEquals(lhs.getName(), rhs.getName()); - assertEquals(lhs.isExported(), rhs.isExported()); - assertEquals(lhs.hasAction(), rhs.hasAction()); - assertEquals(lhs.isHomeActivity(), rhs.isHomeActivity()); - } - } - - public void testGetUsesLibraries() { - UsesLibrary[] libraries = mManifestTestApp.getUsesLibraries(); - - assertEquals(2, libraries.length); - assertEquals(LIBRARY_NAME, libraries[0].getName()); - assertEquals(Boolean.FALSE, libraries[0].getRequired()); - assertEquals(LIBRARY_NAME2, libraries[1].getName()); - assertEquals(Boolean.TRUE, libraries[1].getRequired()); - } - - public void testGetUsesFeatures() { - UsesFeature[] features = mManifestTestApp.getUsesFeatures(); - - assertEquals(2, features.length); - assertEquals(0x00020001, features[0].mGlEsVersion); - assertEquals(Boolean.TRUE, features[0].getRequired()); - assertEquals(FEATURE_NAME, features[1].getName()); - assertEquals(Boolean.TRUE, features[1].getRequired()); - } - - public void testGetPackageName() { - assertEquals(PACKAGE_NAME, mManifestTestApp.getPackage()); - } -} diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/xml/SupportsScreensTest.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/xml/SupportsScreensTest.java deleted file mode 100644 index baf13b1..0000000 --- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/xml/SupportsScreensTest.java +++ /dev/null @@ -1,146 +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.sdklib.xml; - -import com.android.sdklib.xml.ManifestData.SupportsScreens; - -import java.io.InputStream; - -import junit.framework.TestCase; - -public class SupportsScreensTest extends TestCase { - - private static final String TESTDATA_PATH = - "/com/android/sdklib/testdata/"; //$NON-NLS-1$ - private static final String TESTAPP2_XML = TESTDATA_PATH + - "AndroidManifest-testapp2.xml"; //$NON-NLS-1$ - - public void testDefaultValuesApi3() { - SupportsScreens supportsScreens = SupportsScreens.getDefaultValues(3); - - assertNotNull(supportsScreens); - assertEquals(Boolean.FALSE, supportsScreens.getAnyDensity()); - assertEquals(Boolean.FALSE, supportsScreens.getResizeable()); - assertEquals(Boolean.FALSE, supportsScreens.getSmallScreens()); - assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens()); - assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens()); - } - - public void testDefaultValuesApi4() { - SupportsScreens supportsScreens = SupportsScreens.getDefaultValues(4); - - assertNotNull(supportsScreens); - assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity()); - assertEquals(Boolean.TRUE, supportsScreens.getResizeable()); - assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens()); - assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens()); - assertEquals(Boolean.TRUE, supportsScreens.getLargeScreens()); - } - - public void testManifestParsing() throws Exception { - InputStream manifestStream = this.getClass().getResourceAsStream(TESTAPP2_XML); - - ManifestData data = AndroidManifestParser.parse(manifestStream); - assertNotNull(data); - - SupportsScreens supportsScreens = data.getSupportsScreensFromManifest(); - assertNotNull(supportsScreens); - assertEquals(null, supportsScreens.getAnyDensity()); - assertEquals(null, supportsScreens.getResizeable()); - assertEquals(null, supportsScreens.getSmallScreens()); - assertEquals(null, supportsScreens.getNormalScreens()); - assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens()); - - supportsScreens = data.getSupportsScreensValues(); - assertNotNull(supportsScreens); - assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity()); - assertEquals(Boolean.TRUE, supportsScreens.getResizeable()); - assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens()); - assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens()); - assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens()); - } - - public void testOverlapWith() { - SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false"); - SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true"); - - assertTrue(supportsN.overlapWith(supportsSL)); - assertTrue(supportsSL.overlapWith(supportsN)); - } - - public void testCompareScreenSizesWith() { - // set instance that support all combo of the three sizes. - SupportsScreens supportsS = new SupportsScreens("false|false|true|false|false"); - SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false"); - SupportsScreens supportsL = new SupportsScreens("false|false|false|false|true"); - SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true"); - - assertEquals(-1, supportsS.compareScreenSizesWith(supportsN)); - assertEquals( 1, supportsN.compareScreenSizesWith(supportsS)); - assertEquals(-1, supportsN.compareScreenSizesWith(supportsL)); - assertEquals(-1, supportsS.compareScreenSizesWith(supportsL)); - - // test thrown exception for overlapWith == true - try { - supportsSL.compareScreenSizesWith(supportsN); - fail("Should have thrown IllegalArgumentException"); - } catch (IllegalArgumentException e) { - // success! - } - - // test thrown exception for hasStrictlyDifferentScreenSupportAs == false - try { - supportsSL.compareScreenSizesWith(supportsS); - fail("Should have thrown IllegalArgumentException"); - } catch (IllegalArgumentException e) { - // success! - } - - } - - public void testHasStrictlyDifferentScreenSupportAs() { - SupportsScreens supportsS = new SupportsScreens("false|false|true|false|false"); - SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false"); - SupportsScreens supportsL = new SupportsScreens("false|false|false|false|true"); - - SupportsScreens supportsSN = new SupportsScreens("false|false|true|true|false"); - SupportsScreens supportsNL = new SupportsScreens("false|false|false|true|true"); - SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true"); - SupportsScreens supportsSNL = new SupportsScreens("false|false|true|true|true"); - - assertTrue(supportsS.hasStrictlyDifferentScreenSupportAs(supportsN)); - assertTrue(supportsS.hasStrictlyDifferentScreenSupportAs(supportsL)); - assertTrue(supportsN.hasStrictlyDifferentScreenSupportAs(supportsS)); - assertTrue(supportsN.hasStrictlyDifferentScreenSupportAs(supportsL)); - assertTrue(supportsL.hasStrictlyDifferentScreenSupportAs(supportsS)); - assertTrue(supportsL.hasStrictlyDifferentScreenSupportAs(supportsN)); - - - assertFalse(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsS)); - assertFalse(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsN)); - assertTrue(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsL)); - assertFalse(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsS)); - assertTrue(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsN)); - assertFalse(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsL)); - assertTrue(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsS)); - assertFalse(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsN)); - assertFalse(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsL)); - assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsS)); - assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsN)); - assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsL)); - } -} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/AddonsListFetcherTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/AddonsListFetcherTest.java new file mode 100755 index 0000000..3f2bb84 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/AddonsListFetcherTest.java @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Eclipse Public License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.eclipse.org/org/documents/epl-v10.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.internal.repository; + +import com.android.sdklib.internal.repository.AddonsListFetcher.Site; +import com.android.sdklib.repository.SdkAddonsListConstants; + +import org.w3c.dom.Document; + +import java.io.ByteArrayInputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; + +import junit.framework.TestCase; + +/** + * Tests for {@link AddonsListFetcher} + */ +public class AddonsListFetcherTest extends TestCase { + + /** + * An internal helper class to give us visibility to the protected members we want + * to test. + */ + private static class MockAddonsListFetcher extends AddonsListFetcher { + + public Site[] _parseAddonsList(Document doc, String nsUri, ITaskMonitor monitor) { + return super.parseAddonsList(doc, nsUri, monitor); + } + + public int _getXmlSchemaVersion(InputStream xml) { + return super.getXmlSchemaVersion(xml); + } + + public String _validateXml(InputStream xml, String url, int version, + String[] outError, Boolean[] validatorFound) { + return super.validateXml(xml, url, version, outError, validatorFound); + } + + public Document _getDocument(InputStream xml, ITaskMonitor monitor) { + return super.getDocument(xml, monitor); + } + + } + + private MockAddonsListFetcher mFetcher; + + @Override + protected void setUp() throws Exception { + super.setUp(); + + mFetcher = new MockAddonsListFetcher(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + + mFetcher = null; + } + + /** + * Validate we can still load a valid addon schema version 1 + */ + public void testLoadSample_1() throws Exception { + InputStream xmlStream = + getTestResource("/com/android/sdklib/testdata/addons_list_sample_1.xml"); + + // guess the version from the XML document + int version = mFetcher._getXmlSchemaVersion(xmlStream); + assertEquals(1, version); + + Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; + String[] validationError = new String[] { null }; + String url = "not-a-valid-url://addons_list.xml"; + + String uri = mFetcher._validateXml( + xmlStream, url, version, validationError, validatorFound); + assertEquals(Boolean.TRUE, validatorFound[0]); + assertEquals(null, validationError[0]); + assertEquals(SdkAddonsListConstants.getSchemaUri(1), uri); + + // Validation was successful, load the document + MockMonitor monitor = new MockMonitor(); + Document doc = mFetcher._getDocument(xmlStream, monitor); + assertNotNull(doc); + + // Get the sites + Site[] result = mFetcher._parseAddonsList(doc, uri, monitor); + + assertEquals("", monitor.getCapturedDescriptions()); + assertEquals("", monitor.getCapturedResults()); + + // check the sites we found... + assertEquals(3, result.length); + + assertEquals("My Example Add-ons.", result[0].getUiName()); + assertEquals("http://www.example.com/my_addons.xml", result[0].getUrl()); + + // The XML file is UTF-8 so we support character sets (but the Java source file is + // not, so we use the \\u notation to create the Unicode String) + assertEquals("\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002", + result[1].getUiName()); + assertEquals("http://www.example.co.jp/addons.xml", result[1].getUrl()); + + assertEquals("Example of directory URL.", result[2].getUiName()); + assertEquals("http://www.example.com/", result[2].getUrl()); + } + + /** + * Returns an SdkLib file resource as a {@link ByteArrayInputStream}, + * which has the advantage that we can use {@link InputStream#reset()} on it + * at any time to read it multiple times. + *

+ * The default for getResourceAsStream() is to return a {@link FileInputStream} that + * does not support reset(), yet we need it in the tested code. + * + * @throws IOException if some I/O read fails + */ + private ByteArrayInputStream getTestResource(String filename) throws IOException { + InputStream xmlStream = this.getClass().getResourceAsStream(filename); + + try { + byte[] data = new byte[8192]; + int offset = 0; + int n; + + while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) { + offset += n; + + if (offset == data.length) { + byte[] newData = new byte[offset + 8192]; + System.arraycopy(data, 0, newData, 0, offset); + data = newData; + } + } + + return new ByteArrayInputStream(data, 0, offset); + } finally { + if (xmlStream != null) { + xmlStream.close(); + } + } + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/BrokenPackageTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/BrokenPackageTest.java new file mode 100755 index 0000000..3e9ba8d --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/BrokenPackageTest.java @@ -0,0 +1,54 @@ +/* + * 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. + */ + +package com.android.sdklib.internal.repository; + +import junit.framework.TestCase; + +public class BrokenPackageTest extends TestCase { + + private BrokenPackage m; + + @Override + protected void setUp() throws Exception { + super.setUp(); + + m = new BrokenPackage(null /*props*/, + "short description", + "long description", + 12, // min api level + 13, // exact api level + "os/path"); + + } + + public final void testGetShortDescription() { + assertEquals("short description", m.getShortDescription()); + } + + public final void testGetLongDescription() { + assertEquals("long description", m.getLongDescription()); + } + + public final void testGetMinApiLevel() { + assertEquals(12, m.getMinApiLevel()); + } + + public final void testGetExactApiLevel() { + assertEquals(13, m.getExactApiLevel()); + } + +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockAddonPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockAddonPackage.java new file mode 100755 index 0000000..55ace17 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockAddonPackage.java @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.internal.repository; + +import com.android.sdklib.AndroidVersion; +import com.android.sdklib.IAndroidTarget; +import com.android.sdklib.SdkConstants; + +import java.util.Map; + +/** + * A mock {@link AddonPackage} for testing. + * + * By design, this package contains one and only one archive. + */ +public class MockAddonPackage extends AddonPackage { + + /** + * Creates a {@link MockAddonTarget} with the requested base platform and addon revision + * and then a {@link MockAddonPackage} wrapping it. + * + * By design, this package contains one and only one archive. + */ + public MockAddonPackage(MockPlatformPackage basePlatform, int revision) { + super(new MockAddonTarget(basePlatform.getTarget(), revision), null /*props*/); + } + + /** + * A mock AddonTarget. + * This reimplements the minimum needed from the interface for our limited testing needs. + */ + static class MockAddonTarget implements IAndroidTarget { + + private final IAndroidTarget mParentTarget; + private final int mRevision; + + public MockAddonTarget(IAndroidTarget parentTarget, int revision) { + mParentTarget = parentTarget; + mRevision = revision; + } + + public String getClasspathName() { + return null; + } + + public String getDefaultSkin() { + return null; + } + + public String getDescription() { + return "mock addon target"; + } + + public String getFullName() { + return "mock addon target"; + } + + public String[] getAbiList() { + return new String[] { SdkConstants.ABI_ARMEABI }; + } + + public String getImagePath(String abiType) { + return SdkConstants.OS_IMAGES_FOLDER; + } + + public String getLocation() { + return ""; + } + + public String getName() { + return "mock addon target"; + } + + public IOptionalLibrary[] getOptionalLibraries() { + return null; + } + + public IAndroidTarget getParent() { + return mParentTarget; + } + + public String getPath(int pathId) { + return null; + } + + public String[] getPlatformLibraries() { + return null; + } + + public String getProperty(String name) { + return null; + } + + public Integer getProperty(String name, Integer defaultValue) { + return defaultValue; + } + + public Boolean getProperty(String name, Boolean defaultValue) { + return defaultValue; + } + + public Map getProperties() { + return null; + } + + public int getRevision() { + return mRevision; + } + + public String[] getSkins() { + return null; + } + + public int getUsbVendorId() { + return 0; + } + + public String getVendor() { + return null; + } + + public AndroidVersion getVersion() { + return mParentTarget.getVersion(); + } + + public String getVersionName() { + return String.format("mock-addon-%1$d", getVersion().getApiLevel()); + } + + public String hashString() { + return getVersionName(); + } + + /** Returns false for an addon. */ + public boolean isPlatform() { + return false; + } + + public boolean canRunOn(IAndroidTarget target) { + throw new UnsupportedOperationException("Implement this as needed for tests"); + } + + public int compareTo(IAndroidTarget o) { + throw new UnsupportedOperationException("Implement this as needed for tests"); + } + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockBrokenPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockBrokenPackage.java new file mode 100755 index 0000000..289305b --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockBrokenPackage.java @@ -0,0 +1,43 @@ +/* + * 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. + */ + +package com.android.sdklib.internal.repository; + + +/** + * A mock {@link BrokenPackage} for testing. + *

+ * By design, this package contains one and only one archive. + */ +public class MockBrokenPackage extends BrokenPackage { + + public MockBrokenPackage(int minApiLevel, int exactApiLevel) { + this(null, null, minApiLevel, exactApiLevel); + } + + public MockBrokenPackage( + String shortDescription, + String longDescription, + int minApiLevel, + int exactApiLevel) { + super(null /*props*/, + shortDescription, + longDescription, + minApiLevel, + exactApiLevel, + null /*osPath*/); + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockEmptySdkManager.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockEmptySdkManager.java new file mode 100755 index 0000000..f66734b --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockEmptySdkManager.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Eclipse Public License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.eclipse.org/org/documents/epl-v10.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.internal.repository; + +import com.android.sdklib.IAndroidTarget; +import com.android.sdklib.SdkManager; + +/** + * An invalid SDK Manager, just good enough to avoid passing a null reference. + */ +public class MockEmptySdkManager extends SdkManager { + public MockEmptySdkManager(String osSdkPath) { + super(osSdkPath); + setTargets(new IAndroidTarget[0]); + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java new file mode 100755 index 0000000..56a7c6c --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Eclipse Public License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.eclipse.org/org/documents/epl-v10.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.internal.repository; + + +/** + * Mock implementation of {@link ITaskMonitor} that simply captures + * the output in local strings. Does not provide any UI and has no + * support for creating sub-monitors. + */ +public class MockMonitor implements ITaskMonitor { + + String mCapturedResults = ""; + String mCapturedDescriptions = ""; + + public String getCapturedResults() { + return mCapturedResults; + } + + public String getCapturedDescriptions() { + return mCapturedDescriptions; + } + + public void setResult(String resultFormat, Object... args) { + mCapturedResults += String.format(resultFormat, args) + "\n"; + } + + public void setProgressMax(int max) { + } + + public void setDescription(String descriptionFormat, Object... args) { + mCapturedDescriptions += String.format(descriptionFormat, args) + "\n"; + } + + public boolean isCancelRequested() { + return false; + } + + public void incProgress(int delta) { + } + + public int getProgress() { + return 0; + } + + public boolean displayPrompt(String title, String message) { + return false; + } + + public ITaskMonitor createSubMonitor(int tickCount) { + return null; + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformPackage.java new file mode 100755 index 0000000..ad1ab16 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformPackage.java @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.internal.repository; + +import com.android.sdklib.AndroidVersion; +import com.android.sdklib.IAndroidTarget; +import com.android.sdklib.SdkConstants; + +import java.util.Map; +import java.util.Properties; + +/** + * A mock {@link PlatformPackage} for testing. + * + * By design, this package contains one and only one archive. + */ +public class MockPlatformPackage extends PlatformPackage { + + private final IAndroidTarget mTarget; + + /** + * Creates a {@link MockPlatformTarget} with the requested API and revision + * and then a {@link MockPlatformPackage} wrapping it. + * + * By design, this package contains one and only one archive. + */ + public MockPlatformPackage(int apiLevel, int revision) { + this(new MockPlatformTarget(apiLevel, revision), null /*props*/); + } + + /** + * Creates a {@link MockPlatformTarget} with the requested API and revision + * and then a {@link MockPlatformPackage} wrapping it. + * + * Also sets the min-tools-rev of the platform. + * + * By design, this package contains one and only one archive. + */ + public MockPlatformPackage(int apiLevel, int revision, int min_tools_rev) { + this(new MockPlatformTarget(apiLevel, revision), createProps(min_tools_rev)); + } + + /** A little trick to be able to capture the target new after passing it to the super. */ + private MockPlatformPackage(IAndroidTarget target, Properties props) { + super(target, props); + mTarget = target; + } + + private static Properties createProps(int min_tools_rev) { + Properties props = new Properties(); + props.setProperty(PlatformPackage.PROP_MIN_TOOLS_REV, Integer.toString((min_tools_rev))); + return props; + } + + public IAndroidTarget getTarget() { + return mTarget; + } + + /** + * A mock PlatformTarget. + * This reimplements the minimum needed from the interface for our limited testing needs. + */ + static class MockPlatformTarget implements IAndroidTarget { + + private final int mApiLevel; + private final int mRevision; + + public MockPlatformTarget(int apiLevel, int revision) { + mApiLevel = apiLevel; + mRevision = revision; + + } + + public String getClasspathName() { + return null; + } + + public String getDefaultSkin() { + return null; + } + + public String getDescription() { + return "mock platform target"; + } + + public String getFullName() { + return "mock platform target"; + } + + public String[] getAbiList() { + return new String[] { SdkConstants.ABI_ARMEABI }; + } + + public String getImagePath(String abiType) { + return SdkConstants.OS_IMAGES_FOLDER; + } + + public String getLocation() { + return ""; + } + + public String getName() { + return "mock platform target"; + } + + public IOptionalLibrary[] getOptionalLibraries() { + return null; + } + + public IAndroidTarget getParent() { + return null; + } + + public String getPath(int pathId) { + return null; + } + + public String[] getPlatformLibraries() { + return null; + } + + public String getProperty(String name) { + return null; + } + + public Integer getProperty(String name, Integer defaultValue) { + return defaultValue; + } + + public Boolean getProperty(String name, Boolean defaultValue) { + return defaultValue; + } + + public Map getProperties() { + return null; + } + + public int getRevision() { + return mRevision; + } + + public String[] getSkins() { + return null; + } + + public int getUsbVendorId() { + return 0; + } + + public String getVendor() { + return null; + } + + public AndroidVersion getVersion() { + return new AndroidVersion(mApiLevel, null /*codename*/); + } + + public String getVersionName() { + return String.format("android-%1$d", mApiLevel); + } + + public String hashString() { + return getVersionName(); + } + + /** Returns true for a platform. */ + public boolean isPlatform() { + return true; + } + + public boolean canRunOn(IAndroidTarget target) { + throw new UnsupportedOperationException("Implement this as needed for tests"); + } + + public int compareTo(IAndroidTarget o) { + throw new UnsupportedOperationException("Implement this as needed for tests"); + } + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformToolPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformToolPackage.java new file mode 100755 index 0000000..0befa80 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformToolPackage.java @@ -0,0 +1,49 @@ +/* + * 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.sdklib.internal.repository; + +import com.android.sdklib.internal.repository.Archive.Arch; +import com.android.sdklib.internal.repository.Archive.Os; + +/** + * A mock {@link PlatformToolPackage} for testing. + * + * By design, this package contains one and only one archive. + */ +public class MockPlatformToolPackage extends PlatformToolPackage { + + /** + * Creates a {@link MockPlatformToolPackage} with the given revision and hardcoded defaults + * for everything else. + *

+ * By design, this creates a package with one and only one archive. + */ + public MockPlatformToolPackage(int revision) { + super( + null, // source, + null, // props, + revision, + null, // license, + "desc", // description, + "url", // descUrl, + Os.getCurrentOs(), // archiveOs, + Arch.getCurrentArch(), // archiveArch, + "foo" // archiveOsPath + ); + } +} + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockToolPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockToolPackage.java new file mode 100755 index 0000000..8ce704c --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockToolPackage.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.internal.repository; + +import com.android.sdklib.internal.repository.Archive.Arch; +import com.android.sdklib.internal.repository.Archive.Os; + +import java.util.Properties; + +/** + * A mock {@link ToolPackage} for testing. + * + * By design, this package contains one and only one archive. + */ +public class MockToolPackage extends ToolPackage { + + /** + * Creates a {@link MockToolPackage} with the given revision and hardcoded defaults + * for everything else. + *

+ * By design, this creates a package with one and only one archive. + */ + public MockToolPackage(int revision, int min_platform_tools_rev) { + super( + null, // source, + createProps(min_platform_tools_rev), // props, + revision, + null, // license, + "desc", // description, + "url", // descUrl, + Os.getCurrentOs(), // archiveOs, + Arch.getCurrentArch(), // archiveArch, + "foo" // archiveOsPath + ); + } + + private static Properties createProps(int min_platform_tools_rev) { + Properties props = new Properties(); + props.setProperty(ToolPackage.PROP_MIN_PLATFORM_TOOLS_REV, + Integer.toString((min_platform_tools_rev))); + return props; + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkAddonSourceTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkAddonSourceTest.java new file mode 100755 index 0000000..ea6c4f6 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkAddonSourceTest.java @@ -0,0 +1,253 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Eclipse Public License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.eclipse.org/org/documents/epl-v10.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.internal.repository; + +import com.android.sdklib.SdkManager; +import com.android.sdklib.repository.SdkAddonConstants; + +import org.w3c.dom.Document; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; + +import junit.framework.TestCase; + +/** + * Tests for {@link SdkAddonSource} + */ +public class SdkAddonSourceTest extends TestCase { + + /** + * An internal helper class to give us visibility to the protected members we want + * to test. + */ + private static class MockSdkAddonSource extends SdkAddonSource { + public MockSdkAddonSource() { + super("fake-url", null /*uiName*/); + } + + public Document _findAlternateToolsXml(InputStream xml) { + return super.findAlternateToolsXml(xml); + } + + public boolean _parsePackages(Document doc, String nsUri, ITaskMonitor monitor) { + return super.parsePackages(doc, nsUri, monitor); + } + + public int _getXmlSchemaVersion(InputStream xml) { + return super.getXmlSchemaVersion(xml); + } + + public String _validateXml(InputStream xml, String url, int version, + String[] outError, Boolean[] validatorFound) { + return super.validateXml(xml, url, version, outError, validatorFound); + } + + public Document _getDocument(InputStream xml, ITaskMonitor monitor) { + return super.getDocument(xml, monitor); + } + + } + + private MockSdkAddonSource mSource; + + @Override + protected void setUp() throws Exception { + super.setUp(); + + mSource = new MockSdkAddonSource(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + + mSource = null; + } + + public void testFindAlternateToolsXml_Errors() throws Exception { + // Support null as input + Document result = mSource._findAlternateToolsXml(null); + assertNull(result); + + // Support an empty input + String str = ""; + ByteArrayInputStream input = new ByteArrayInputStream(str.getBytes()); + result = mSource._findAlternateToolsXml(input); + assertNull(result); + + // Support a random string as input + str = "Some random string, not even HTML nor XML"; + input = new ByteArrayInputStream(str.getBytes()); + result = mSource._findAlternateToolsXml(input); + assertNull(result); + + // Support an HTML input, e.g. a typical 404 document as returned by DL + str = " " + + " " + + "404 Not Found " + " " + " " + " " + + " " + + " " + + " " + + "
" + + "Google   " + + " 
Error
 
" + "

" + "

Not Found

" + + "The requested URL /404 was not found on this server." + " " + "

" + + "

" + + "
\"\"
" + + " "; + input = new ByteArrayInputStream(str.getBytes()); + result = mSource._findAlternateToolsXml(input); + assertNull(result); + + // Support some random XML document, totally unrelated to our sdk-repository schema + str = "" + + "" + + " " + + ""; + input = new ByteArrayInputStream(str.getBytes()); + result = mSource._findAlternateToolsXml(input); + assertNull(result); + } + + /** + * Validate that findAlternateToolsXml doesn't work for addon even + * when trying to load a valid addon xml. + */ + public void testFindAlternateToolsXml_1() throws Exception { + InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_1.xml"); + + Document result = mSource._findAlternateToolsXml(xmlStream); + assertNull(result); + } + + /** + * Validate we can still load a valid addon schema version 1 + */ + public void testLoadOldXml_1() throws Exception { + InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_1.xml"); + + // guess the version from the XML document + int version = mSource._getXmlSchemaVersion(xmlStream); + assertEquals(1, version); + + Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; + String[] validationError = new String[] { null }; + String url = "not-a-valid-url://" + SdkAddonConstants.URL_DEFAULT_FILENAME; + + String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound); + assertEquals(Boolean.TRUE, validatorFound[0]); + assertEquals(null, validationError[0]); + assertEquals(SdkAddonConstants.getSchemaUri(1), uri); + + // Validation was successful, load the document + MockMonitor monitor = new MockMonitor(); + Document doc = mSource._getDocument(xmlStream, monitor); + assertNotNull(doc); + + // Get the packages + assertTrue(mSource._parsePackages(doc, uri, monitor)); + + assertEquals("Found My First add-on by John Doe, Android API 1, revision 1\n" + + "Found My Second add-on by John Deer, Android API 2, revision 42\n" + + "Found This add-on has no libraries by Joe Bar, Android API 4, revision 3\n" + + "Found G USB Driver package, revision 43 (Obsolete)\n" + + "Found Android Vendor Extra API Dep package, revision 2 (Obsolete)\n" + + "Found Unkown Extra package, revision 2 (Obsolete)\n", + monitor.getCapturedDescriptions()); + assertEquals("", monitor.getCapturedResults()); + + // check the packages we found... we expected to find 11 packages with each at least + // one archive. + Package[] pkgs = mSource.getPackages(); + assertEquals(6, pkgs.length); + for (Package p : pkgs) { + assertTrue(p.getArchives().length >= 1); + } + + // Check the extra packages path, vendor, install folder + + final String osSdkPath = "SDK"; + final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath); + + ArrayList extraPaths = new ArrayList(); + ArrayList extraVendors = new ArrayList(); + ArrayList extraInstall = new ArrayList(); + for (Package p : pkgs) { + if (p instanceof ExtraPackage) { + extraPaths.add(((ExtraPackage) p).getPath()); + extraVendors.add(((ExtraPackage) p).getVendor()); + extraInstall.add(((ExtraPackage) p).getInstallFolder(osSdkPath, sdkManager)); + } + } + assertEquals( + "[usb_driver, extra_api_dep, extra0000005f]", + Arrays.toString(extraPaths.toArray())); + assertEquals( + "[g, android_vendor, vendor0000005f]", + Arrays.toString(extraVendors.toArray())); + assertEquals( + ("[SDK/extras/g/usb_driver, " + + "SDK/extras/android_vendor/extra_api_dep, " + + "SDK/extras/vendor0000005f/extra0000005f]").replace('/', File.separatorChar), + Arrays.toString(extraInstall.toArray())); + } + + /** + * Returns an SdkLib file resource as a {@link ByteArrayInputStream}, + * which has the advantage that we can use {@link InputStream#reset()} on it + * at any time to read it multiple times. + *

+ * The default for getResourceAsStream() is to return a {@link FileInputStream} that + * does not support reset(), yet we need it in the tested code. + * + * @throws IOException if some I/O read fails + */ + private ByteArrayInputStream getTestResource(String filename) throws IOException { + InputStream xmlStream = this.getClass().getResourceAsStream(filename); + + try { + byte[] data = new byte[8192]; + int offset = 0; + int n; + + while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) { + offset += n; + + if (offset == data.length) { + byte[] newData = new byte[offset + 8192]; + System.arraycopy(data, 0, newData, 0, offset); + data = newData; + } + } + + return new ByteArrayInputStream(data, 0, offset); + } finally { + if (xmlStream != null) { + xmlStream.close(); + } + } + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java new file mode 100755 index 0000000..aee811f --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java @@ -0,0 +1,429 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Eclipse Public License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.eclipse.org/org/documents/epl-v10.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.internal.repository; + +import com.android.sdklib.SdkManager; +import com.android.sdklib.repository.SdkRepoConstants; + +import org.w3c.dom.Document; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; + +import junit.framework.TestCase; + +/** + * Tests for {@link SdkRepoSource} + */ +public class SdkRepoSourceTest extends TestCase { + + /** + * An internal helper class to give us visibility to the protected members we want + * to test. + */ + private static class MockSdkRepoSource extends SdkRepoSource { + public MockSdkRepoSource() { + super("fake-url", null /*uiName*/); + } + + public Document _findAlternateToolsXml(InputStream xml) throws IOException { + return super.findAlternateToolsXml(xml); + } + + public boolean _parsePackages(Document doc, String nsUri, ITaskMonitor monitor) { + return super.parsePackages(doc, nsUri, monitor); + } + + public int _getXmlSchemaVersion(InputStream xml) { + return super.getXmlSchemaVersion(xml); + } + + public String _validateXml(InputStream xml, String url, int version, + String[] outError, Boolean[] validatorFound) { + return super.validateXml(xml, url, version, outError, validatorFound); + } + + public Document _getDocument(InputStream xml, ITaskMonitor monitor) { + return super.getDocument(xml, monitor); + } + + } + + private MockSdkRepoSource mSource; + + @Override + protected void setUp() throws Exception { + super.setUp(); + + mSource = new MockSdkRepoSource(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + + mSource = null; + } + + public void testFindAlternateToolsXml_Errors() throws Exception { + // Support null as input + Document result = mSource._findAlternateToolsXml(null); + assertNull(result); + + // Support an empty input + String str = ""; + ByteArrayInputStream input = new ByteArrayInputStream(str.getBytes()); + result = mSource._findAlternateToolsXml(input); + assertNull(result); + + // Support a random string as input + str = "Some random string, not even HTML nor XML"; + input = new ByteArrayInputStream(str.getBytes()); + result = mSource._findAlternateToolsXml(input); + assertNull(result); + + // Support an HTML input, e.g. a typical 404 document as returned by DL + str = " " + + " " + + "404 Not Found " + " " + " " + " " + + " " + + " " + + " " + + "
" + + "Google   " + + " 
Error
 
" + "

" + "

Not Found

" + + "The requested URL /404 was not found on this server." + " " + "

" + + "

" + + "
\"\"
" + + " "; + input = new ByteArrayInputStream(str.getBytes()); + result = mSource._findAlternateToolsXml(input); + assertNull(result); + + // Support some random XML document, totally unrelated to our sdk-repository schema + str = "" + + "" + + " " + + ""; + input = new ByteArrayInputStream(str.getBytes()); + result = mSource._findAlternateToolsXml(input); + assertNull(result); + } + + /** + * Validate we can load a new schema version 3 using the "alternate future tool" mode. + */ + public void testFindAlternateToolsXml_3() throws Exception { + InputStream xmlStream = getTestResource( + "/com/android/sdklib/testdata/repository_sample_3.xml"); + + Document result = mSource._findAlternateToolsXml(xmlStream); + assertNotNull(result); + MockMonitor mon = new MockMonitor(); + assertTrue(mSource._parsePackages(result, SdkRepoConstants.NS_URI, mon)); + + assertEquals("Found Android SDK Tools, revision 1\n" + + "Found Android SDK Tools, revision 42\n" + + "Found Android SDK Platform-tools, revision 3\n", + mon.getCapturedDescriptions()); + assertEquals("", mon.getCapturedResults()); + + // check the packages we found... we expected to find 2 tool packages and 1 + // platform-tools package, with at least 1 archive each. + Package[] pkgs = mSource.getPackages(); + assertEquals(3, pkgs.length); + for (Package p : pkgs) { + assertTrue((p instanceof ToolPackage) || (p instanceof PlatformToolPackage)); + assertTrue(p.getArchives().length >= 1); + } + } + + /** + * Validate we can still load an old repository in schema version 1 + */ + public void testLoadOldXml_1() throws Exception { + InputStream xmlStream = getTestResource( + "/com/android/sdklib/testdata/repository_sample_1.xml"); + + // guess the version from the XML document + int version = mSource._getXmlSchemaVersion(xmlStream); + assertEquals(1, version); + + Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; + String[] validationError = new String[] { null }; + String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME; + + String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound); + assertEquals(Boolean.TRUE, validatorFound[0]); + assertEquals(null, validationError[0]); + assertEquals(SdkRepoConstants.getSchemaUri(1), uri); + + // Validation was successful, load the document + MockMonitor monitor = new MockMonitor(); + Document doc = mSource._getDocument(xmlStream, monitor); + assertNotNull(doc); + + // Get the packages + assertTrue(mSource._parsePackages(doc, uri, monitor)); + + assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" + + "Found Documentation for Android SDK, API 1, revision 1\n" + + "Found My First add-on by John Doe, Android API 1, revision 1\n" + + "Found SDK Platform Android 1.1, API 2, revision 12\n" + + "Found My Second add-on by John Deer, Android API 2, revision 42\n" + + "Found SDK Platform Android Pastry Preview, revision 3\n" + + "Found Android SDK Tools, revision 1\n" + + "Found Documentation for Android SDK, API 2, revision 42\n" + + "Found Android SDK Tools, revision 42\n" + + "Found This add-on has no libraries by Joe Bar, Android API 4, revision 3\n" + + "Found Usb Driver package, revision 43\n", + monitor.getCapturedDescriptions()); + assertEquals("", monitor.getCapturedResults()); + + // check the packages we found... we expected to find 11 packages with each at least + // one archive. + Package[] pkgs = mSource.getPackages(); + assertEquals(11, pkgs.length); + for (Package p : pkgs) { + assertTrue(p.getArchives().length >= 1); + } + + // Check the extra packages path, vendor, install folder + + final String osSdkPath = "SDK"; + final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath); + + ArrayList extraPaths = new ArrayList(); + ArrayList extraVendors = new ArrayList(); + ArrayList extraInstall = new ArrayList(); + for (Package p : pkgs) { + if (p instanceof ExtraPackage) { + extraPaths.add(((ExtraPackage) p).getPath()); + extraVendors.add(((ExtraPackage) p).getVendor()); + extraInstall.add(((ExtraPackage) p).getInstallFolder(osSdkPath, sdkManager)); + } + } + assertEquals( + "[usb_driver]", + Arrays.toString(extraPaths.toArray())); + assertEquals( + "[]", + Arrays.toString(extraVendors.toArray())); + assertEquals( + "[SDK/extras/usb_driver]".replace('/', File.separatorChar), + Arrays.toString(extraInstall.toArray())); + } + + /** + * Validate we can still load an old repository in schema version 2 + */ + public void testLoadOldXml_2() throws Exception { + InputStream xmlStream = getTestResource( + "/com/android/sdklib/testdata/repository_sample_2.xml"); + + // guess the version from the XML document + int version = mSource._getXmlSchemaVersion(xmlStream); + assertEquals(2, version); + + Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; + String[] validationError = new String[] { null }; + String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME; + + String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound); + assertEquals(Boolean.TRUE, validatorFound[0]); + assertEquals(null, validationError[0]); + assertEquals(SdkRepoConstants.getSchemaUri(2), uri); + + // Validation was successful, load the document + MockMonitor monitor = new MockMonitor(); + Document doc = mSource._getDocument(xmlStream, monitor); + assertNotNull(doc); + + // Get the packages + assertTrue(mSource._parsePackages(doc, uri, monitor)); + + assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" + + "Found Documentation for Android SDK, API 1, revision 1\n" + + "Found My First add-on by John Doe, Android API 1, revision 1\n" + + "Found SDK Platform Android 1.1, API 2, revision 12\n" + + "Found My Second add-on by John Deer, Android API 2, revision 42\n" + + "Found SDK Platform Android Pastry Preview, revision 3\n" + + "Found Android SDK Tools, revision 1\n" + + "Found Documentation for Android SDK, API 2, revision 42\n" + + "Found Android SDK Tools, revision 42\n" + + "Found This add-on has no libraries by Joe Bar, Android API 4, revision 3\n" + + "Found Usb Driver package, revision 43 (Obsolete)\n" + + "Found Extra API Dep package, revision 2 (Obsolete)\n" + + "Found Samples for SDK API 14, revision 24 (Obsolete)\n", + monitor.getCapturedDescriptions()); + assertEquals("", monitor.getCapturedResults()); + + // check the packages we found... we expected to find 13 packages with each at least + // one archive. + Package[] pkgs = mSource.getPackages(); + assertEquals(13, pkgs.length); + for (Package p : pkgs) { + assertTrue(p.getArchives().length >= 1); + } + + // Check the extra packages path, vendor, install folder + + final String osSdkPath = "SDK"; + final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath); + + ArrayList extraPaths = new ArrayList(); + ArrayList extraVendors = new ArrayList(); + ArrayList extraInstall = new ArrayList(); + for (Package p : pkgs) { + if (p instanceof ExtraPackage) { + extraPaths.add(((ExtraPackage) p).getPath()); + extraVendors.add(((ExtraPackage) p).getVendor()); + extraInstall.add(((ExtraPackage) p).getInstallFolder(osSdkPath, sdkManager)); + } + } + assertEquals( + "[usb_driver, extra_api_dep]", + Arrays.toString(extraPaths.toArray())); + assertEquals( + "[, ]", + Arrays.toString(extraVendors.toArray())); + assertEquals( + "[SDK/extras/usb_driver, SDK/extras/extra_api_dep]".replace('/', File.separatorChar), + Arrays.toString(extraInstall.toArray())); + } + + /** + * Validate what we can load from repository in schema version 3 + */ + public void testLoadXml_3() throws Exception { + InputStream xmlStream = getTestResource( + "/com/android/sdklib/testdata/repository_sample_3.xml"); + + // guess the version from the XML document + int version = mSource._getXmlSchemaVersion(xmlStream); + assertEquals(3, version); + + Boolean[] validatorFound = new Boolean[] { Boolean.FALSE }; + String[] validationError = new String[] { null }; + String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME; + + String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound); + assertEquals(Boolean.TRUE, validatorFound[0]); + assertEquals(null, validationError[0]); + assertEquals(SdkRepoConstants.getSchemaUri(3), uri); + + // Validation was successful, load the document + MockMonitor monitor = new MockMonitor(); + Document doc = mSource._getDocument(xmlStream, monitor); + assertNotNull(doc); + + // Get the packages + assertTrue(mSource._parsePackages(doc, uri, monitor)); + + assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" + + "Found Documentation for Android SDK, API 1, revision 1\n" + + "Found SDK Platform Android 1.1, API 2, revision 12\n" + + "Found SDK Platform Android Pastry Preview, revision 3\n" + + "Found Android SDK Tools, revision 1\n" + + "Found Documentation for Android SDK, API 2, revision 42\n" + + "Found Android SDK Tools, revision 42\n" + + "Found Android SDK Platform-tools, revision 3\n" + + "Found A USB Driver package, revision 43 (Obsolete)\n" + + "Found Android Vendor Extra API Dep package, revision 2 (Obsolete)\n" + + "Found Samples for SDK API 14, revision 24 (Obsolete)\n", + monitor.getCapturedDescriptions()); + assertEquals("", monitor.getCapturedResults()); + + // check the packages we found... we expected to find 13 packages with each at least + // one archive. + Package[] pkgs = mSource.getPackages(); + assertEquals(11, pkgs.length); + for (Package p : pkgs) { + assertTrue(p.getArchives().length >= 1); + } + + // Check the extra packages path, vendor, install folder + + final String osSdkPath = "SDK"; + final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath); + + ArrayList extraPaths = new ArrayList(); + ArrayList extraVendors = new ArrayList(); + ArrayList extraInstall = new ArrayList(); + for (Package p : pkgs) { + if (p instanceof ExtraPackage) { + extraPaths.add(((ExtraPackage) p).getPath()); + extraVendors.add(((ExtraPackage) p).getVendor()); + extraInstall.add(((ExtraPackage) p).getInstallFolder(osSdkPath, sdkManager)); + } + } + assertEquals( + "[usb_driver, extra_api_dep]", + Arrays.toString(extraPaths.toArray())); + assertEquals( + "[a, android_vendor]", + Arrays.toString(extraVendors.toArray())); + assertEquals( + "[SDK/extras/a/usb_driver, SDK/extras/android_vendor/extra_api_dep]" + .replace('/', File.separatorChar), + Arrays.toString(extraInstall.toArray())); + } + + /** + * Returns an SdkLib file resource as a {@link ByteArrayInputStream}, + * which has the advantage that we can use {@link InputStream#reset()} on it + * at any time to read it multiple times. + *

+ * The default for getResourceAsStream() is to return a {@link FileInputStream} that + * does not support reset(), yet we need it in the tested code. + * + * @throws IOException if some I/O read fails + */ + private ByteArrayInputStream getTestResource(String filename) throws IOException { + InputStream xmlStream = this.getClass().getResourceAsStream(filename); + + try { + byte[] data = new byte[8192]; + int offset = 0; + int n; + + while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) { + offset += n; + + if (offset == data.length) { + byte[] newData = new byte[offset + 8192]; + System.arraycopy(data, 0, newData, 0, offset); + data = newData; + } + } + + return new ByteArrayInputStream(data, 0, offset); + } finally { + if (xmlStream != null) { + xmlStream.close(); + } + } + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java new file mode 100644 index 0000000..3ef0140 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.mock; + +import com.android.sdklib.ISdkLog; + +import java.util.ArrayList; +import java.util.Formatter; + +/** + * An instance of {@link ISdkLog} that captures all messages to an internal list. + * Messages can be retrieved later using {@link #toString()}. + * Useful for unit-tests. + */ +public class MockLog implements ISdkLog { + private ArrayList mMessages = new ArrayList(); + + private void add(String code, String format, Object... args) { + mMessages.add(new Formatter().format(code + format, args).toString()); + } + + public void warning(String format, Object... args) { + add("W ", format, args); + } + + public void printf(String format, Object... args) { + add("P ", format, args); + } + + 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(); + } + + public void clear() { + mMessages.clear(); + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/SdkRepositoryTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/SdkRepositoryTest.java new file mode 100755 index 0000000..2bbc088 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/SdkRepositoryTest.java @@ -0,0 +1,335 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Eclipse Public License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.eclipse.org/org/documents/epl-v10.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.sdklib.repository; + +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +import java.io.InputStream; +import java.io.StringReader; + +import javax.xml.XMLConstants; +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; + +import junit.framework.TestCase; + +/** + * Tests local validation of an SDK Repository sample XMLs using an XML Schema validator. + * + * References: + * http://www.ibm.com/developerworks/xml/library/x-javaxmlvalidapi.html + */ +public class SdkRepositoryTest extends TestCase { + + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + } + + /** + * A SAX error handler that captures the errors and warnings. + * This allows us to capture *all* errors and just not get an exception on the first one. + */ + private static class CaptureErrorHandler implements ErrorHandler { + + private String mWarnings = ""; + private String mErrors = ""; + + @SuppressWarnings("unused") + public String getErrors() { + return mErrors; + } + + @SuppressWarnings("unused") + public String getWarnings() { + return mWarnings; + } + + /** + * Verifies if the handler captures some errors or warnings. + * Prints them on stderr. + * Also fails the unit test if any error was generated. + */ + public void verify() { + if (mWarnings.length() > 0) { + System.err.println(mWarnings); + } + + if (mErrors.length() > 0) { + System.err.println(mErrors); + fail(mErrors); + } + } + + /** + * @throws SAXException + */ + public void error(SAXParseException ex) throws SAXException { + mErrors += "Error: " + ex.getMessage() + "\n"; + } + + /** + * @throws SAXException + */ + public void fatalError(SAXParseException ex) throws SAXException { + mErrors += "Fatal Error: " + ex.getMessage() + "\n"; + } + + /** + * @throws SAXException + */ + public void warning(SAXParseException ex) throws SAXException { + mWarnings += "Warning: " + ex.getMessage() + "\n"; + } + + } + + // --- Helpers ------------ + + /** Helper method that returns a validator for our XSD */ + private Validator getValidator(int version, CaptureErrorHandler handler) throws SAXException { + InputStream xsdStream = SdkRepoConstants.getXsdStream(version); + SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = factory.newSchema(new StreamSource(xsdStream)); + Validator validator = schema.newValidator(); + if (handler != null) { + validator.setErrorHandler(handler); + } + + return validator; + } + + /** An helper that validates a string against an expected regexp. */ + private void assertRegex(String expectedRegexp, String actualString) { + assertNotNull(actualString); + assertTrue( + String.format("Regexp Assertion Failed:\nExpected: %s\nActual: %s\n", + expectedRegexp, actualString), + actualString.matches(expectedRegexp)); + } + + // --- Tests ------------ + + /** Validate a valid sample using namespace version 1 using an InputStream */ + public void testValidateLocalRepositoryFile1() throws Exception { + InputStream xmlStream = this.getClass().getResourceAsStream( + "/com/android/sdklib/testdata/repository_sample_1.xml"); + Source source = new StreamSource(xmlStream); + + CaptureErrorHandler handler = new CaptureErrorHandler(); + Validator validator = getValidator(1, handler); + validator.validate(source); + handler.verify(); + } + + /** Validate a valid sample using namespace version 2 using an InputStream */ + public void testValidateLocalRepositoryFile2() throws Exception { + InputStream xmlStream = this.getClass().getResourceAsStream( + "/com/android/sdklib/testdata/repository_sample_2.xml"); + Source source = new StreamSource(xmlStream); + + CaptureErrorHandler handler = new CaptureErrorHandler(); + Validator validator = getValidator(2, handler); + validator.validate(source); + handler.verify(); + } + + /** Validate a valid sample using namespace version 3 using an InputStream */ + public void testValidateLocalRepositoryFile3() throws Exception { + InputStream xmlStream = this.getClass().getResourceAsStream( + "/com/android/sdklib/testdata/repository_sample_3.xml"); + Source source = new StreamSource(xmlStream); + + CaptureErrorHandler handler = new CaptureErrorHandler(); + Validator validator = getValidator(3, handler); + validator.validate(source); + handler.verify(); + } + + /** A document should at least have a root to be valid */ + public void testEmptyXml() throws Exception { + String document = ""; + + Source source = new StreamSource(new StringReader(document)); + + CaptureErrorHandler handler = new CaptureErrorHandler(); + Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, handler); + + try { + validator.validate(source); + } catch (SAXParseException e) { + // We expect to get this specific exception message + assertRegex("Premature end of file.*", e.getMessage()); + return; + } + // We shouldn't get here + handler.verify(); + fail(); + } + + private static String OPEN_TAG = + ""; + + private static String CLOSE_TAG = ""; + + /** A document with a root element containing no platform, addon, etc., is valid. */ + public void testEmptyRootXml() throws Exception { + String document = "" + + OPEN_TAG + + CLOSE_TAG; + + Source source = new StreamSource(new StringReader(document)); + + CaptureErrorHandler handler = new CaptureErrorHandler(); + Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, handler); + validator.validate(source); + handler.verify(); + } + + /** A document with an unknown element. */ + public void testUnknownContentXml() throws Exception { + String document = "" + + OPEN_TAG + + "" + + CLOSE_TAG; + + Source source = new StreamSource(new StringReader(document)); + + // don't capture the validator errors, we want it to fail and catch the exception + Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); + try { + validator.validate(source); + } catch (SAXParseException e) { + // We expect a parse expression referring to this grammar rule + assertRegex("cvc-complex-type.2.4.a: Invalid content was found.*", e.getMessage()); + return; + } + // If we get here, the validator has not failed as we expected it to. + fail(); + } + + /** A document with an incomplete element. */ + public void testIncompleteContentXml() throws Exception { + String document = "" + + OPEN_TAG + + " 1 " + + CLOSE_TAG; + + Source source = new StreamSource(new StringReader(document)); + + // don't capture the validator errors, we want it to fail and catch the exception + Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); + try { + validator.validate(source); + } catch (SAXParseException e) { + // We expect a parse error referring to this grammar rule + assertRegex("cvc-complex-type.2.4.a: Invalid content was found.*", e.getMessage()); + return; + } + // If we get here, the validator has not failed as we expected it to. + fail(); + } + + /** A document with a wrong type element. */ + public void testWrongTypeContentXml() throws Exception { + String document = "" + + OPEN_TAG + + " NotAnInteger " + + CLOSE_TAG; + + Source source = new StreamSource(new StringReader(document)); + + // don't capture the validator errors, we want it to fail and catch the exception + Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); + try { + validator.validate(source); + } catch (SAXParseException e) { + // We expect a parse error referring to this grammar rule + assertRegex("cvc-datatype-valid.1.2.1: 'NotAnInteger' is not a valid value.*", + e.getMessage()); + return; + } + // If we get here, the validator has not failed as we expected it to. + fail(); + } + + /** A document with an unknown license id. */ + public void testLicenseIdNotFound() throws Exception { + // we define a license named "lic1" and then reference "lic2" instead + String document = "" + + OPEN_TAG + + " some license " + + " 1 " + + "1 " + + " 1 2822ae37115ebf13412bbef91339ee0d9454525e " + + "url " + + CLOSE_TAG; + + Source source = new StreamSource(new StringReader(document)); + + // don't capture the validator errors, we want it to fail and catch the exception + Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); + try { + validator.validate(source); + } catch (SAXParseException e) { + // We expect a parse error referring to this grammar rule + assertRegex("cvc-id.1: There is no ID/IDREF binding for IDREF 'lic2'.*", + e.getMessage()); + return; + } + // If we get here, the validator has not failed as we expected it to. + fail(); + } + + /** A document a slash in an extra path. */ + public void testExtraPathWithSlash() throws Exception { + // we define a license named "lic1" and then reference "lic2" instead + String document = "" + + OPEN_TAG + + " 1 path/cannot\\contain\\segments " + + " 1 2822ae37115ebf13412bbef91339ee0d9454525e " + + "url " + + CLOSE_TAG; + + Source source = new StreamSource(new StringReader(document)); + + // don't capture the validator errors, we want it to fail and catch the exception + Validator validator = getValidator(SdkRepoConstants.NS_LATEST_VERSION, null); + try { + validator.validate(source); + } catch (SAXParseException e) { + // We expect a parse error referring to this grammar rule + assertRegex("cvc-pattern-valid: Value 'path/cannot\\\\contain\\\\segments' is not facet-valid with respect to pattern.*", + e.getMessage()); + return; + } + // If we get here, the validator has not failed as we expected it to. + fail(); + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml new file mode 100644 index 0000000..f1dce67 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp.xml new file mode 100644 index 0000000..f55b4e0 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp2.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp2.xml new file mode 100644 index 0000000..d5bcac7 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp2.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_1.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_1.xml new file mode 100755 index 0000000..d761d73 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_1.xml @@ -0,0 +1,164 @@ + + + + + + + + This is the license + for this platform. + + + + Licenses are only of type 'text' right now, so this is implied. + + + + + + My First add-on + 1 + John Doe + 1 + + Some optional description + http://www.example.com/myfirstaddon + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/add-ons/first.zip + + + + + + android.blah.somelib + The description for this library. + + + + com.android.mymaps + + + + + + My Second add-on + 2 + John Deer + 42 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/second-42-win.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/second-42-linux.tar.bz2 + + + + + android.blah.somelib + The description for this library. + + + com.android.mymaps + + + + + + + + This add-on has no libraries + 4 + Joe Bar + 3 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/imnotanarchiveimadoctorjim.zip + + + + + + + + g + usb_driver + + 43 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/extraduff.zip + + + An Extra package for the USB driver, it will install in $SDK/usb_driver + http://www.example.com/extra.html + 3 + + + + + android_vendor + extra_api_dep + + 2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/extra_mega_duff.zip + + + Some extra package that has a min-api-level of 42 + http://www.example.com/extra.html + 3 + 42 + + + + + ____ + ____ + + 2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/extra_mega_duff.zip + + + Some extra package that has a min-api-level of 42 + http://www.example.com/extra.html + 3 + 42 + + + + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_1.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_1.xml new file mode 100755 index 0000000..bda69d4 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_1.xml @@ -0,0 +1,38 @@ + + + + + + http://www.example.com/my_addons.xml + + My Example Add-ons. + + + + + http://www.example.co.jp/addons.xml + + ありがとうございます。 + + + + http://www.example.com/ + Example of directory URL. + + + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_1.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_1.xml new file mode 100755 index 0000000..aa209d3 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_1.xml @@ -0,0 +1,274 @@ + + + + + + + + This is the license + for this platform. + + + + Licenses are only of type 'text' right now, so this is implied. + + + + + + 1.0 + 1 + 3 + + Some optional description + http://www.example.com/platform1.html + This is an optional release note + for this package. It's a free multi-line text. + + http://some/url/for/the/release/note.html + 2 + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/plat1.zip + + + + + + 1 + 1 + + Some optional description + http://www.example.com/docs.html + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/docs/docs1.zip + + + + + + My First add-on + 1 + John Doe + 1 + + Some optional description + http://www.example.com/myfirstaddon + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/add-ons/first.zip + + + + + + android.blah.somelib + The description for this library. + + + + com.android.mymaps + + + + + + 1.1 + 2 + 12 + + + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-win.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-mac.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-mac.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-linux.tar.bz2 + + + + + + My Second add-on + 2 + John Deer + 42 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/second-42-win.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/second-42-linux.tar.bz2 + + + + + android.blah.somelib + The description for this library. + + + com.android.mymaps + + + + + + + Pastry + 5 + Pastry + 3 + + Preview version for Pastry + http://www.example.com/platform1.html + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/plat1.zip + + + + + + 1 + Some optional description + http://www.example.com/tools.html + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/tools1.zip + + + + + + 2 + 42 + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs/2.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs2-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs2-mac.tar.bz2 + + + + + + 42 + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools/2.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools2-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools2-mac.tar.bz2 + + + + + + + This add-on has no libraries + 4 + Joe Bar + 3 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/imnotanarchiveimadoctorjim.zip + + + + + + + + usb_driver + + 43 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/extraduff.zip + + + An Extra package for the USB driver, it will install in $SDK/usb_driver + http://www.example.com/extra.html + 3 + + + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_2.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_2.xml new file mode 100755 index 0000000..4b8e329 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_2.xml @@ -0,0 +1,309 @@ + + + + + + + + This is the license + for this platform. + + + + Licenses are only of type 'text' right now, so this is implied. + + + + + + 1.0 + 1 + 3 + + Some optional description + http://www.example.com/platform1.html + This is an optional release note + for this package. It's a free multi-line text. + + http://some/url/for/the/release/note.html + 2 + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/plat1.zip + + + + + + 1 + 1 + + Some optional description + http://www.example.com/docs.html + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/docs/docs1.zip + + + + + + My First add-on + 1 + John Doe + 1 + + Some optional description + http://www.example.com/myfirstaddon + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/add-ons/first.zip + + + + + + android.blah.somelib + The description for this library. + + + + com.android.mymaps + + + + + + 1.1 + 2 + 12 + + + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-win.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-mac.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-mac.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-linux.tar.bz2 + + + + + + My Second add-on + 2 + John Deer + 42 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/second-42-win.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/second-42-linux.tar.bz2 + + + + + android.blah.somelib + The description for this library. + + + com.android.mymaps + + + + + + + Pastry + 5 + Pastry + 3 + + Preview version for Pastry + http://www.example.com/platform1.html + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/plat1.zip + + + + + + 1 + Some optional description + http://www.example.com/tools.html + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/tools1.zip + + + + + + 2 + 42 + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs/2.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs2-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs2-mac.tar.bz2 + + + + + + 42 + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools/2.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools2-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools2-mac.tar.bz2 + + + + + + + This add-on has no libraries + 4 + Joe Bar + 3 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/imnotanarchiveimadoctorjim.zip + + + + + + + + usb_driver + + 43 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/extraduff.zip + + + An Extra package for the USB driver, it will install in $SDK/usb_driver + http://www.example.com/extra.html + 3 + + + + + extra_api_dep + + 2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/extra_mega_duff.zip + + + Some extra package that has a min-api-level of 42 + http://www.example.com/extra.html + 3 + 42 + + + + + 14 + 24 + + + 65537 + 3822ae37115ebf13412bbef91339ee0d9454525e + distrib/sample_duff.zip + + + Some sample package + http://www.example.com/sample.html + 5 + This is obsolete + + + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_3.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_3.xml new file mode 100755 index 0000000..05a9c79 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_3.xml @@ -0,0 +1,261 @@ + + + + + + + + This is the license + for this platform. + + + + Licenses are only of type 'text' right now, so this is implied. + + + + + + 1.0 + 1 + 3 + + Some optional description + http://www.example.com/platform1.html + This is an optional release note + for this package. It's a free multi-line text. + + http://some/url/for/the/release/note.html + 2 + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/plat1.zip + + + + + + 1 + 1 + + Some optional description + http://www.example.com/docs.html + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/docs/docs1.zip + + + + + + 1.1 + 2 + 12 + + + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-win.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-mac.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-mac.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-2-12-linux.tar.bz2 + + + + + + Pastry + 5 + Pastry + 3 + + Preview version for Pastry + http://www.example.com/platform1.html + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/plat1.zip + + + + + + 1 + Some optional description + http://www.example.com/tools.html + + 4 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + http://www.example.com/files/tools1.zip + + + + + + 2 + 42 + + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs/2.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs2-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/docs2-mac.tar.bz2 + + + + + + 42 + + 3 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools/2.zip + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools2-linux.tar.bz2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/tools2-mac.tar.bz2 + + + + + + 3 + + + + 65536 + 3822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-tools/2.zip + + + 65536 + 3822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-tools2-linux.tar.bz2 + + + 65536 + 3822ae37115ebf13412bbef91339ee0d9454525e + distrib/platform-tools2-mac.tar.bz2 + + + + + + a + usb_driver + + 43 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/extraduff.zip + + + An Extra package for the USB driver, it will install in $SDK/usb_driver + http://www.example.com/extra.html + 3 + + + + + android_vendor + extra_api_dep + + 2 + + + 65536 + 2822ae37115ebf13412bbef91339ee0d9454525e + distrib/extra_mega_duff.zip + + + Some extra package that has a min-api-level of 42 + http://www.example.com/extra.html + 3 + 42 + + + + + 14 + 24 + + + 65537 + 3822ae37115ebf13412bbef91339ee0d9454525e + distrib/sample_duff.zip + + + Some sample package + http://www.example.com/sample.html + 5 + This is obsolete + + + diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/xml/AndroidManifestParserTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/xml/AndroidManifestParserTest.java new file mode 100644 index 0000000..02725f4 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/xml/AndroidManifestParserTest.java @@ -0,0 +1,163 @@ +/* + * Copyright (C) 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. + */ + +package com.android.sdklib.xml; + +import com.android.resources.Keyboard; +import com.android.resources.Navigation; +import com.android.resources.TouchScreen; +import com.android.sdklib.xml.ManifestData.UsesFeature; +import com.android.sdklib.xml.ManifestData.UsesLibrary; + +import java.io.InputStream; + +import junit.framework.TestCase; + +/** + * Tests for {@link AndroidManifestParser} + */ +public class AndroidManifestParserTest extends TestCase { + private ManifestData mManifestTestApp; + private ManifestData mManifestInstrumentation; + + private static final String TESTDATA_PATH = + "/com/android/sdklib/testdata/"; //$NON-NLS-1$ + private static final String INSTRUMENTATION_XML = TESTDATA_PATH + + "AndroidManifest-instrumentation.xml"; //$NON-NLS-1$ + private static final String TESTAPP_XML = TESTDATA_PATH + + "AndroidManifest-testapp.xml"; //$NON-NLS-1$ + private static final String PACKAGE_NAME = "com.android.testapp"; //$NON-NLS-1$ + private static final Integer VERSION_CODE = 42; + private static final String ACTIVITY_NAME = "com.android.testapp.MainActivity"; //$NON-NLS-1$ + private static final String LIBRARY_NAME = "android.test.runner"; //$NON-NLS-1$ + private static final String LIBRARY_NAME2 = "android.test.runner2"; //$NON-NLS-1$ + private static final String FEATURE_NAME = "com.foo.feature"; //$NON-NLS-1$ + private static final String INSTRUMENTATION_NAME = "android.test.InstrumentationTestRunner"; //$NON-NLS-1$ + private static final String INSTRUMENTATION_TARGET = "com.android.AndroidProject"; //$NON-NLS-1$ + + @Override + protected void setUp() throws Exception { + super.setUp(); + + InputStream manifestStream = this.getClass().getResourceAsStream(TESTAPP_XML); + + mManifestTestApp = AndroidManifestParser.parse(manifestStream); + assertNotNull(mManifestTestApp); + + manifestStream = this.getClass().getResourceAsStream(INSTRUMENTATION_XML); + mManifestInstrumentation = AndroidManifestParser.parse(manifestStream); + assertNotNull(mManifestInstrumentation); + } + + public void testGetInstrumentationInformation() { + assertEquals(1, mManifestInstrumentation.getInstrumentations().length); + assertEquals(INSTRUMENTATION_NAME, + mManifestInstrumentation.getInstrumentations()[0].getName()); + assertEquals(INSTRUMENTATION_TARGET, + mManifestInstrumentation.getInstrumentations()[0].getTargetPackage()); + } + + public void testGetPackage() { + assertEquals(PACKAGE_NAME, mManifestTestApp.getPackage()); + } + + public void testGetVersionCode() { + assertEquals(VERSION_CODE, mManifestTestApp.getVersionCode()); + assertEquals(null, mManifestInstrumentation.getVersionCode()); + } + + public void testMinSdkVersion() { + assertEquals(7, mManifestTestApp.getMinSdkVersion()); + assertEquals(8, mManifestTestApp.getTargetSdkVersion()); + + assertEquals("foo", mManifestInstrumentation.getMinSdkVersionString()); + assertEquals(ManifestData.MIN_SDK_CODENAME, mManifestInstrumentation.getMinSdkVersion()); + } + + public void testGetActivities() { + assertEquals(1, mManifestTestApp.getActivities().length); + ManifestData.Activity activity = mManifestTestApp.getActivities()[0]; + assertEquals(ACTIVITY_NAME, activity.getName()); + assertTrue(activity.hasAction()); + assertTrue(activity.isHomeActivity()); + assertTrue(activity.hasAction()); + assertEquals(activity, mManifestTestApp.getActivities()[0]); + } + + public void testGetLauncherActivity() { + ManifestData.Activity activity = mManifestTestApp.getLauncherActivity(); + assertEquals(ACTIVITY_NAME, activity.getName()); + assertTrue(activity.hasAction()); + assertTrue(activity.isHomeActivity()); + } + + public void testSupportsScreen() { + ManifestData.SupportsScreens supportsScreens = + mManifestTestApp.getSupportsScreensFromManifest(); + + assertNotNull(supportsScreens); + assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity()); + assertEquals(Boolean.TRUE, supportsScreens.getResizeable()); + assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens()); + assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens()); + assertEquals(Boolean.TRUE, supportsScreens.getLargeScreens()); + } + + public void testUsesConfiguration() { + ManifestData.UsesConfiguration usesConfig = mManifestTestApp.getUsesConfiguration(); + + assertNotNull(usesConfig); + assertEquals(Boolean.TRUE, usesConfig.getReqFiveWayNav()); + assertEquals(Navigation.NONAV, usesConfig.getReqNavigation()); + assertEquals(Boolean.TRUE, usesConfig.getReqHardKeyboard()); + assertEquals(Keyboard.TWELVEKEY, usesConfig.getReqKeyboardType()); + assertEquals(TouchScreen.FINGER, usesConfig.getReqTouchScreen()); + } + + private void assertEquals(ManifestData.Activity lhs, ManifestData.Activity rhs) { + assertTrue(lhs == rhs || (lhs != null && rhs != null)); + if (lhs != null && rhs != null) { + assertEquals(lhs.getName(), rhs.getName()); + assertEquals(lhs.isExported(), rhs.isExported()); + assertEquals(lhs.hasAction(), rhs.hasAction()); + assertEquals(lhs.isHomeActivity(), rhs.isHomeActivity()); + } + } + + public void testGetUsesLibraries() { + UsesLibrary[] libraries = mManifestTestApp.getUsesLibraries(); + + assertEquals(2, libraries.length); + assertEquals(LIBRARY_NAME, libraries[0].getName()); + assertEquals(Boolean.FALSE, libraries[0].getRequired()); + assertEquals(LIBRARY_NAME2, libraries[1].getName()); + assertEquals(Boolean.TRUE, libraries[1].getRequired()); + } + + public void testGetUsesFeatures() { + UsesFeature[] features = mManifestTestApp.getUsesFeatures(); + + assertEquals(2, features.length); + assertEquals(0x00020001, features[0].mGlEsVersion); + assertEquals(Boolean.TRUE, features[0].getRequired()); + assertEquals(FEATURE_NAME, features[1].getName()); + assertEquals(Boolean.TRUE, features[1].getRequired()); + } + + public void testGetPackageName() { + assertEquals(PACKAGE_NAME, mManifestTestApp.getPackage()); + } +} diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/xml/SupportsScreensTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/xml/SupportsScreensTest.java new file mode 100644 index 0000000..baf13b1 --- /dev/null +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/xml/SupportsScreensTest.java @@ -0,0 +1,146 @@ +/* + * 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.sdklib.xml; + +import com.android.sdklib.xml.ManifestData.SupportsScreens; + +import java.io.InputStream; + +import junit.framework.TestCase; + +public class SupportsScreensTest extends TestCase { + + private static final String TESTDATA_PATH = + "/com/android/sdklib/testdata/"; //$NON-NLS-1$ + private static final String TESTAPP2_XML = TESTDATA_PATH + + "AndroidManifest-testapp2.xml"; //$NON-NLS-1$ + + public void testDefaultValuesApi3() { + SupportsScreens supportsScreens = SupportsScreens.getDefaultValues(3); + + assertNotNull(supportsScreens); + assertEquals(Boolean.FALSE, supportsScreens.getAnyDensity()); + assertEquals(Boolean.FALSE, supportsScreens.getResizeable()); + assertEquals(Boolean.FALSE, supportsScreens.getSmallScreens()); + assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens()); + assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens()); + } + + public void testDefaultValuesApi4() { + SupportsScreens supportsScreens = SupportsScreens.getDefaultValues(4); + + assertNotNull(supportsScreens); + assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity()); + assertEquals(Boolean.TRUE, supportsScreens.getResizeable()); + assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens()); + assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens()); + assertEquals(Boolean.TRUE, supportsScreens.getLargeScreens()); + } + + public void testManifestParsing() throws Exception { + InputStream manifestStream = this.getClass().getResourceAsStream(TESTAPP2_XML); + + ManifestData data = AndroidManifestParser.parse(manifestStream); + assertNotNull(data); + + SupportsScreens supportsScreens = data.getSupportsScreensFromManifest(); + assertNotNull(supportsScreens); + assertEquals(null, supportsScreens.getAnyDensity()); + assertEquals(null, supportsScreens.getResizeable()); + assertEquals(null, supportsScreens.getSmallScreens()); + assertEquals(null, supportsScreens.getNormalScreens()); + assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens()); + + supportsScreens = data.getSupportsScreensValues(); + assertNotNull(supportsScreens); + assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity()); + assertEquals(Boolean.TRUE, supportsScreens.getResizeable()); + assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens()); + assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens()); + assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens()); + } + + public void testOverlapWith() { + SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false"); + SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true"); + + assertTrue(supportsN.overlapWith(supportsSL)); + assertTrue(supportsSL.overlapWith(supportsN)); + } + + public void testCompareScreenSizesWith() { + // set instance that support all combo of the three sizes. + SupportsScreens supportsS = new SupportsScreens("false|false|true|false|false"); + SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false"); + SupportsScreens supportsL = new SupportsScreens("false|false|false|false|true"); + SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true"); + + assertEquals(-1, supportsS.compareScreenSizesWith(supportsN)); + assertEquals( 1, supportsN.compareScreenSizesWith(supportsS)); + assertEquals(-1, supportsN.compareScreenSizesWith(supportsL)); + assertEquals(-1, supportsS.compareScreenSizesWith(supportsL)); + + // test thrown exception for overlapWith == true + try { + supportsSL.compareScreenSizesWith(supportsN); + fail("Should have thrown IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // success! + } + + // test thrown exception for hasStrictlyDifferentScreenSupportAs == false + try { + supportsSL.compareScreenSizesWith(supportsS); + fail("Should have thrown IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // success! + } + + } + + public void testHasStrictlyDifferentScreenSupportAs() { + SupportsScreens supportsS = new SupportsScreens("false|false|true|false|false"); + SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false"); + SupportsScreens supportsL = new SupportsScreens("false|false|false|false|true"); + + SupportsScreens supportsSN = new SupportsScreens("false|false|true|true|false"); + SupportsScreens supportsNL = new SupportsScreens("false|false|false|true|true"); + SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true"); + SupportsScreens supportsSNL = new SupportsScreens("false|false|true|true|true"); + + assertTrue(supportsS.hasStrictlyDifferentScreenSupportAs(supportsN)); + assertTrue(supportsS.hasStrictlyDifferentScreenSupportAs(supportsL)); + assertTrue(supportsN.hasStrictlyDifferentScreenSupportAs(supportsS)); + assertTrue(supportsN.hasStrictlyDifferentScreenSupportAs(supportsL)); + assertTrue(supportsL.hasStrictlyDifferentScreenSupportAs(supportsS)); + assertTrue(supportsL.hasStrictlyDifferentScreenSupportAs(supportsN)); + + + assertFalse(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsS)); + assertFalse(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsN)); + assertTrue(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsL)); + assertFalse(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsS)); + assertTrue(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsN)); + assertFalse(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsL)); + assertTrue(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsS)); + assertFalse(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsN)); + assertFalse(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsL)); + assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsS)); + assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsN)); + assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsL)); + } +} diff --git a/sdkmanager/libs/sdkuilib/Android.mk b/sdkmanager/libs/sdkuilib/Android.mk index 33f8a9d..671fc95 100644 --- a/sdkmanager/libs/sdkuilib/Android.mk +++ b/sdkmanager/libs/sdkuilib/Android.mk @@ -13,7 +13,30 @@ # See the License for the specific language governing permissions and # limitations under the License. # -SDKUILIB_LOCAL_DIR := $(call my-dir) +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_JAVA_RESOURCE_DIRS := src + +# IMPORTANT: if you add a new dependency here, please make sure +# to also check the following file: +# sdkmanager/app/etc/android.bat +# (Note: there is no manifest.txt for sdkuilib.) +LOCAL_JAVA_LIBRARIES := \ + sdklib \ + common \ + androidprefs \ + swt \ + org.eclipse.jface_3.4.2.M20090107-0800 \ + org.eclipse.equinox.common_3.4.0.v20080421-2006 \ + org.eclipse.core.commands_3.4.0.I20080509-2000 + +LOCAL_MODULE := sdkuilib + +include $(BUILD_HOST_JAVA_LIBRARY) + + # Build all sub-directories -include $(call all-makefiles-under,$(SDKUILIB_LOCAL_DIR)) +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/sdkmanager/libs/sdkuilib/NOTICE b/sdkmanager/libs/sdkuilib/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/sdkmanager/libs/sdkuilib/NOTICE @@ -0,0 +1,190 @@ + + 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/src/Android.mk b/sdkmanager/libs/sdkuilib/src/Android.mk deleted file mode 100644 index aa4f9aa..0000000 --- a/sdkmanager/libs/sdkuilib/src/Android.mk +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2008 The Android Open Source Project -# -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-subdir-java-files) -LOCAL_JAVA_RESOURCE_DIRS := . - -# IMPORTANT: if you add a new dependency here, please make sure -# to also check the following file: -# sdkmanager/app/etc/android.bat -# (Note: there is no manifest.txt for sdkuilib.) -LOCAL_JAVA_LIBRARIES := \ - sdklib \ - common \ - androidprefs \ - swt \ - org.eclipse.jface_3.4.2.M20090107-0800 \ - org.eclipse.equinox.common_3.4.0.v20080421-2006 \ - org.eclipse.core.commands_3.4.0.I20080509-2000 - -LOCAL_MODULE := sdkuilib - -include $(BUILD_HOST_JAVA_LIBRARY) - diff --git a/sdkstats/NOTICE b/sdkstats/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/sdkstats/NOTICE @@ -0,0 +1,190 @@ + + 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/traceview/NOTICE b/traceview/NOTICE new file mode 100644 index 0000000..c5b1efa --- /dev/null +++ b/traceview/NOTICE @@ -0,0 +1,190 @@ + + 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 + -- cgit v1.1