SDK: README explaining build steps wrt the move to tools/base+swt.
Change-Id: If816e7b51cbea013732cda940a1875278f58458f
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..6625ea5
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,112 @@
+Some of the SDK tools sources have moved out of the sdk.git project.
+They are no longer found here.
+
+Instead they can be found in the tools/base.git and the tools/swt.git projects.
+If you need to view/change the source and lack these folders, you can bring
+them by using a repo init command such as:
+
+$ repo init -u https://android.googlesource.com/platform/manifest -g all,-notdefault,tools
+$ repo sync [-j N]
+
+The libraries that are sourced in tools/base and tools/swt are converted to
+prebuilts which are located in prebuilts/devtools. These prebuilts are the
+ones being used when doing a "make sdk".
+
+
+----------
+1- I don't build full SDKs but I want to change tool X:
+----------
+
+Let's say as an example you want to change lint.
+It's now located in tools/base/lint.
+
+To build it from the command-line, you'd use "gradle" as such:
+
+$ cd tools/base
+$ ./gradlew lint:build
+
+Output is located in $TOP/out/host/gradle/tools/base/lint/libs/
+
+Some comments/tips:
+- Gradle is a build system, a bit like make or ant.
+ If you want to know more, visit http://www.gradle.org/
+
+- On Windows with the CMD shell, use ./gradlew.bat.
+ For Cygwin, Linux or Mac, use ./gradlew.
+
+- Gradle targets are in the form "project-name:task-name".
+ To get a list of possible tasks, try this: $ ./gradlew lint:tasks
+
+- Generally there are only 2 task names to remember:
+ $ ./gradlew lint:assemble ==> builds but do not run tests.
+ $ ./gradlew lint:check ==> runs tests and checks such as findbugs.
+
+- To find the list of project-names you can use with gradle:
+ $ ./gradlew projects
+
+The new moved projects are unsurprisingly named like their former "make"
+counterparts. They are split between 2 repos:
+- tools/swt contains all SWT-dependent projects.
+- tools/base contains all other non-SWT projects.
+
+However that means that when you want to modify a project using both repos,
+you need an extra step.
+
+For example, the SDK Manager UI is located in /tools/swt/sdkmanager.
+However it does depend on /tools/base/sdklib. Let's say you want to
+make a change in both sdklib and sdkuilib. Here are the steps:
+
+$ # Edit tools/base/sdklib files.
+$ cd tools/base ; ./gradlew sdklib:publishLocal
+ => this builds sdklib and "publishes" an sdklib.JAR into a local maven
+ repo located in the out/gradle folder. Note that this is just a
+ temporary build artifact and is NOT used by "make sdk".
+
+$ # Edit tools/swt/sdkmanager/sdkuilib files to use the changes from sdklib.
+$ cd ../../tools/swt ; ./gradlew sdkuilib:assemble
+ => this builds sdkuilib by using the local JAR of sdklib that is
+ located in the out/gradlew folder.
+
+
+
+----------
+2- How do I change some tools sources and build a new SDK using these?
+----------
+
+Let's say you changed something in tools/base/lint and run "make sdk" from
+the top dir. Your changes will NOT be included in the resulting SDK.
+
+That's because the SDK has been changed to only rely on the prebuilts located
+in /prebuilts/devtools. There are pros and cons with this approach and we're
+not going to discuss them here. Instead we'll focus on what you need to do.
+
+It's fairly simple. Go back to the top dir on your Android tree and run:
+
+$ prebuilts/devtools/update_jars.sh -f
+$ make sdk
+
+Now your changes are included in the generated SDK.
+
+What you should know about the update_jars.sh script:
+- Without argument, it prints what it would do but does nothing.
+ Use the "-f" argument to make it build/copy stuff.
+
+- It builds indiscriminiately. It just builds ALL the libs from
+ tools/base and tools/swt and updates all the JARs under prebuilts/devtools.
+ That should only take 20-30 seconds though. Eventually we'll work on
+ making it smarter because obviously we don't want anyone to just try
+ to submit 30 JARs just because their timestamp changed.
+
+- It generates a git merge msg in prebuilts/devtools that has the sha1
+ of the corresponding tools/base and tools/swt projects.
+ Use option -m to prevent this.
+
+
+------
+
+Need a place to discuss all this?
+http://groups.google.com/group/adt-dev is the right place.
+
+--- RM 20130409
+
+
diff --git a/docs/howto_build_SDK.txt b/docs/howto_build_SDK.txt
index dbe51d9..3e56569 100644
--- a/docs/howto_build_SDK.txt
+++ b/docs/howto_build_SDK.txt
@@ -15,7 +15,7 @@
Subject: How to build an Android SDK & ADT Eclipse plugin.
Date: 2009/03/27
-Updated: 2010/03/30
+Updated: 2013/04/09
Table of content:
@@ -74,7 +74,7 @@
$ mkdir ~/my-android-git
$ cd ~/my-android-git
- $ repo init -u https://android.googlesource.com/platform/manifest -b master
+ $ repo init -u https://android.googlesource.com/platform/manifest -b master -g all,-notdefault,tools
$ repo sync
Then once you have all the source, simply build the SDK using:
@@ -110,15 +110,16 @@
3- Building an SDK for Windows
------------------------------
-Full Windows SDK builds are now only supported on Linux -- most of the framework is
-not designed to be built on Windows so technically the Windows SDK is build on top
-of a Linux SDK where a few binaries are replaced. So it cannot be built on Windows,
-and it cannot be built on Mac, only on Linux.
+Full Windows SDK builds are now only supported on Linux -- most of the
+framework is not designed to be built on Windows so technically the Windows
+SDK is build on top of a Linux SDK where a few binaries are replaced. So it
+cannot be built on Windows, and it cannot be built on Mac, only on Linux.
I'll repeat this again because it's important:
To build the Android SDK for Windows, you need to use a *Linux* box.
+
A- Pre-requisites
-----------------
@@ -126,7 +127,7 @@
perform the steps from section "2- Building an SDK for MacOS and Linux" above:
setup and build a regular Linux SDK. Once this working, please continue here.
-Under Ubuntu, you will need the following extra packages:
+Under Ubuntu, you will need the following extra packages:
$ sudo apt-get install mingw32 tofrodos
@@ -142,7 +143,8 @@
$ lunch sdk-eng
$ make win_sdk
-Note that this will build both a Linux SDK then a Windows SDK. The result is located at
+Note that this will build both a Linux SDK then a Windows SDK.
+The result is located at
out/host/windows/sdk/android-sdk_eng.${USER}_windows/
@@ -156,7 +158,7 @@
aapt.exe, and it's just more convenient to do it on the same platform where
you can actually test it. This is what this section explains.
-
+
A- Cygwin pre-requisite & code checkout
---------------------------------------
@@ -219,7 +221,7 @@
setup like described above to build an SDK.
Then to build an isolated Windows binary, you'd do something like this:
-
+
$ cd ~/my-android-git
$ . build/envsetup.sh
$ lunch sdk-eng
@@ -235,80 +237,21 @@
4- Building an ADT plugin for Eclipse
-------------------------------------
-Requirements:
-- You can currently only build an ADT plugin for Eclipse under Linux.
-- You must have a working version of Eclipse 3.6 "helios" RCP installed.
-- You need X11 to run Eclipse at least once.
-- You need a lot of patience. The trick is to do the initial setup correctly
- once, after it's a piece of cake.
+We've simplified the steps here.
+It used to be that you'd have to download a specific version of
+Eclipse and install it at a special location. That's not needed
+anymore.
-
-
-A- Pre-requisites
------------------
-
-Note for Ubuntu or Debian users: your apt repository probably only has Eclipse
-3.2 available and it's probably not suitable to build plugins in the first
-place. Forget that and install a working 3.6 manually as described below.
-
-- Visit http://www.eclipse.org/downloads/ to grab the
- "Eclipse for RCP/Plug-in Developers (176 MB)" download for Linux.
- 32-bit and 64-bit versions are available, depending on your Linux installation.
-
- Note: Eclipse comes in various editions. Do yourself a favor and just stick
- to the RCP for building this plugin. For example the J2EE contains too many
- useless features that will get in the way, and the "Java" version lacks some
- plugins you need to build other plugins. Please just use the RCP one.
-
- Note: You will need the CDT plugin but don't take a "CDT" flavor build as it
- will lack the RCP tools. Instead take an RCP and then add CDT.
-
-- Unpack "eclipse-rcp-*-linux-gtk.tar.gz" in the directory of
- your choice, e.g.:
-
- $ mkdir ~/eclipse-3.6
- $ cd ~/eclipse-3.6
- $ tar xvzf eclipse-rcp-????-linux-gtk.tar.gz
-
- This will create an "eclipse" directory in the current directory.
-
-- Set ECLIPSE_HOME to that "eclipse" directory:
-
- $ export ECLIPSE_HOME=~/eclipse-3.6/eclipse
-
- Note: it is important you set ECLIPSE_HOME before starting the build.
- Otherwise the build process will try to download and install its own Eclipse
- installation in /buildroot, which is probably limited to root.
-
-- Now, before you can build anything, it is important that you start Eclipse
- *manually* once using the same user that you will use to build later. That's
- because your Eclipse installation is not finished: Eclipse must be run at
- least once to create some files in ~/.eclipse/. So run Eclipse now:
-
- $ ~/eclipse-3.6/eclipse/eclipse &
-
-- Since you have Eclipse loaded, now is a perfect time to pick up the
- CDT plugin. (Another alternative is is to fetch the CDT from its archives
- and manually dump all the *.jar in eclipse/plugins.)
-
- That's it. You won't need to run it manually again.
-
-
-
-B- Building ADT
----------------
-
-Finally, you have Eclipse, it's installed and it created its own config files,
-so now you can build your ADT plugin. To do that you'll change directories to
-your git repository and invoke the build script by giving it a destination
-directory and an optional build number:
+Instead you just change directories to your git repository and invoke the
+build script by giving it a destination directory and an optional build number:
$ mkdir ~/mysdk
$ cd ~/my-android-git # <-- this is where you did your "repo sync"
$ sdk/eclipse/scripts/build_server.sh ~/mysdk $USER
+
The first argument is the destination directory. It must be absolute. Do not
-give a relative destination directory such as "../mysdk". This will make the
+give a relative destination directory such as "../mysdk" -- this would make the
Eclipse build fail with a cryptic message:
BUILD SUCCESSFUL
diff --git a/hierarchyviewer/Android.mk b/hierarchyviewer/Android.mk
deleted file mode 100644
index 0940457..0000000
--- a/hierarchyviewer/Android.mk
+++ /dev/null
@@ -1,17 +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.
-
-#HIERARCHYVIEWER_LOCAL_DIR := $(call my-dir)
-#include $(HIERARCHYVIEWER_LOCAL_DIR)/etc/Android.mk
-#include $(HIERARCHYVIEWER_LOCAL_DIR)/src/Android.mk
diff --git a/hierarchyviewer/README.txt b/hierarchyviewer/README.txt
new file mode 100644
index 0000000..81fae95
--- /dev/null
+++ b/hierarchyviewer/README.txt
@@ -0,0 +1,8 @@
+This version of HierarchyViewer is deprecated and obsolete.
+The sources are left here just for reference. Please do not change them.
+
+HierarchyViewer2 is located in /tools/swt/hierarchyviewer2.
+This is the version that ships in the SDK.
+
+--- RM 20130409
+