quickstart-ide-lite-sourcecode-acquire.md 2.3 KB
Newer Older
E
ester.zhou 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Obtaining Source Code


In the Ubuntu environment, perform the following steps to obtain the OpenHarmony source code:


## Preparations

1. Register your account with Gitee.

2. Register an SSH public key for access to Gitee.

3. Install the git client and git-lfs.

     Update the software source:
     
   ```
   sudo apt-get update
   ```

     Run the following command to install the tools:
E
ester.zhou 已提交
22
   
E
ester.zhou 已提交
23 24 25 26 27
   ```
   sudo apt-get install git git-lfs
   ```

4. Configure user information.
E
ester.zhou 已提交
28
   
E
ester.zhou 已提交
29 30 31 32 33 34 35
   ```
   git config --global user.name "yourname"
   git config --global user.email "your-email-address"
   git config --global credential.helper store
   ```

5. Run the following commands to install the **repo** tool:
E
ester.zhou 已提交
36
   
E
ester.zhou 已提交
37 38 39 40 41 42 43
   ```
   curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo  # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
   chmod a+x /usr/local/bin/repo
   pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
   ```


E
ester.zhou 已提交
44
## Procedure
E
ester.zhou 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities.

- **Obtaining OpenHarmony master code**

    Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
    
  ```
  repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
  repo sync -c
  repo forall -c 'git lfs pull'
  ```

  Method 2: Use the **repo** tool to download the source code over HTTPS.

E
ester.zhou 已提交
61
  
E
ester.zhou 已提交
62 63 64 65 66 67 68 69 70 71 72 73 74
  ```
  repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
  repo sync -c
  repo forall -c 'git lfs pull'
  ```

- **Obtaining OpenHarmony release code**

  For details about how to obtain the source code of an OpenHarmony release, see the [Release-Notes](../../release-notes/Readme.md).


## Running prebuilts

E
ester.zhou 已提交
75 76
Go to the root directory of the source code and run the following script to install the compiler and binary tool:

E
ester.zhou 已提交
77 78 79
```
bash build/prebuilts_download.sh
```