blob: 9ee42a7c2443fe4547edf3dd3d286d26d58a0af9 [file] [log] [blame] [view]
Chris Warrington1847cb02017-06-28 05:32:37 -07001# Checkout and build the source code
2
3Like the Android operating system, Android Studio is open source and free of charge to all.
4Android releases source code to the Android Open Source Project (AOSP) after each stable release,
5described in detail here.
6
7As of Android Studio 1.4, Android Studio is aligned to the same model of releasing source code
8after each stable release. For those who contribute to Android Studio,
9the code contribution process is the same as the Android platform.
10
11Please continue to submit patches to the Android Studio AOSP branch.
12
13We will do code-reviews and merge changes into subsequent versions of Android Studio.
14We're incredibly grateful to all of you in the community for your collaboration and hard work on
15Android Studio.
16
17## Doing a checkout
18
19[Download an install the `repo` tool](https://source.android.com/source/downloading.html)
20to checkout the source of Android Studio.
21
22Check out the latest published source code using the following commands in a shell:
23```
24$ mkdir studio-master-dev
25$ cd studio-master-dev
26$ repo init -u https://android.googlesource.com/platform/manifest -b studio-master-dev
Chris Warrington7c4a3342017-08-24 14:20:49 +010027$ repo sync -c -j4 -q
Chris Warrington1847cb02017-06-28 05:32:37 -070028```
29You can call the top level directory whatever you want.
30Those of us who check out multiple branches prefer to name the directories after the branches.
31
32During the `repo init` command, it will ask you for your name and e-mail address which
33will be used by git if you commit changes and will be shown if you upload them for review.
34
Chris Warrington7c4a3342017-08-24 14:20:49 +010035To fetch the latest changes re-run the `repo sync -c -j4 -q` command.
36
37* `-j`, The number of parallel sync threads to start.
38
39 For your first sync, during which your client will be pulling down everything,
40 we recommend a low value such as `-j4`.
41 For incremental syncs you can increase it as
42 most fetch operations will be no-ops.
43 However, specifying too high a number may decrease performance on machines with slow disks
44 or slow internet connections.
45
46* `-c`, Syncs only the current branch to reduce sync time and disk space.
47
48 This means you will not be able to cherry-pick changes from branches you didn't sync.
49
50* `-q`, Quiet. The normal output is fairly verbose.
51
52
53See https://source.android.com/source/using-repo for more information about how to use repo.
54
Chris Warrington1847cb02017-06-28 05:32:37 -070055## Building
56
Chris Warringtonabbd2e22017-10-04 11:36:27 +010057To build Android Studio, see [Building Android Studio](studio.md)
Chris Warrington1847cb02017-06-28 05:32:37 -070058
59To build the Android Gradle plugin, see
60[Building the Android Gradle Plugin](build-system/README.md).
61
62The parts of the SDK that can be built with the `studio-*` branches are only the IDE components and
63the SDK Tools.
64Each component is built differently due to varying build systems.
65
66None of them use the make-based build system of the platform.
67
68Historically, building the Android tools required building the full Android SDK as well.
69However, we've been gradually migrating the tools source code over to a more independent setup,
70and you can now build the Android Studio IDE without a full Android checkout and without a C
71compiler etc.
72
73## Check out a specific release
74
75Releases since Android Studio 2.4 are tagged in git. This means you can use the tag to get the source code for a
76specific version. The tags are of this form:
77
78 * Gradle: gradle_x.y.z
79 * Studio: studio-x.y
80
81You can see all available tags here: https://android.googlesource.com/platform/manifest/+refs
82
83For instance you can do a checkout of version 2.3.0 of the Gradle plugin with the following command:
84```
85$ repo init -u https://android.googlesource.com/platform/manifest -b gradle_2.3.0
86$ repo sync
87```
88
89Releases before studio-1.4 were developed in AOSP in the following branches
90
91| development branch | release branch | IntelliJ | Notes |
92|--------------------|--------------------|----------------|----------------------------------|
93|studio-1.0-dev | studio-1.0-release | idea13-dev | This was the branch for 1.0 work |
94|studio-1.1-dev | studio-1.1-release | idea13-1.1-dev | This was the branch for 1.1 work |
95|studio-1.2-dev | studio-1.2-release | idea14-1.2-dev | This was the branch for 1.2 work |
96|studio-1.3-dev | studio-1.3-release | idea14-1.3-dev | This was the branch for 1.3 work |
97
98Android Studio does not use the `master` branch.
99The branches `ub-tools-idea133` and `ub-tools-master` are deprecated.