Skip to content

Commit

Permalink
Merge branch 'develop' into 2020.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dsvoronin authored Feb 19, 2020
2 parents 23ce63b + 2f46233 commit df87818
Show file tree
Hide file tree
Showing 76 changed files with 645 additions and 334 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ local.properties
public/
.DS_Store
outputs/
gh-pages-generated/
7 changes: 4 additions & 3 deletions _main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -e

source $(dirname $0)/ci/_environment.sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

source "$DIR"/ci/_environment.sh

# shellcheck disable=SC2086
USER_ID=$(id -u ${USER})
Expand Down Expand Up @@ -41,8 +43,7 @@ GIT_COMMANDS="git config --global core.sshCommand 'ssh -o UserKnownHostsFile=/de
git config --global user.name 'builder';
git config --global user.email '[email protected]';"

GRADLE_ARGS="--info --stacktrace \\
-PartifactoryUrl=$ARTIFACTORY_URL \\
GRADLE_ARGS="-PartifactoryUrl=$ARTIFACTORY_URL \\
-Pci=true \\
-PteamcityUrl \\
-PteamcityBuildType \\
Expand Down
26 changes: 21 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
val r8Version: String by project

repositories {
maven { setUrl("http://storage.googleapis.com/r8-releases/raw") }
}
dependencies {
classpath("com.android.tools:r8:$r8Version")
}
Expand Down Expand Up @@ -54,7 +50,27 @@ subprojects {

repositories {
jcenter()
google()
exclusiveContent {
forRepository {
google()
}
filter {
includeModuleByRegex("com\\.android.*", "(?!r8).*")
includeModuleByRegex("com\\.google\\.android.*", ".*")
includeGroupByRegex("androidx\\..*")
}
}
exclusiveContent {
forRepository {
maven {
name = "R8 releases"
setUrl("http://storage.googleapis.com/r8-releases/raw")
}
}
filter {
includeModule("com.android.tools", "r8")
}
}
}

group = "com.avito.android"
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -e
source $(dirname $0)/_main.sh
TEMP_PROJECT_VERSION="temp-version"

runInBuilder "./gradlew build publishToMavenLocal ${GRADLE_ARGS} -PprojectVersion=${TEMP_PROJECT_VERSION};
# `tasks` triggers full tasks graph resolving, checking for possible misconfigurations
runInBuilder "./gradlew tasks build publishToMavenLocal ${GRADLE_ARGS} -PprojectVersion=${TEMP_PROJECT_VERSION};
./gradlew :subprojects:android-test:test-app:instrumentationUi ${GRADLE_ARGS} -PinfraVersion=${TEMP_PROJECT_VERSION}"

docs/check.sh
Expand Down
5 changes: 2 additions & 3 deletions docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ googleAnalytics = "UA-157613383-1"

baseURL = "https://avito-tech.github.io/avito-android"
title = "Avito Android"
# TODO: use english as default
languageCode = "ru-ru"
DefaultContentLanguage = "ru"
languageCode = "en-us"
DefaultContentLanguage = "en"
theme = "book"
# WARNING: publishDir outside the project breaks i18n
publishDir = "public"
Expand Down
22 changes: 18 additions & 4 deletions docs/content/Infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,12 @@ Shared modules between android-test and gradle.

[Bintray project](https://bintray.com/avito-tech/maven/avito-android), mirroring to jcenter

1. Make sure integration tests passed via `CI integration tests against avito`
1. Make sure new project version specified in develop head
1. Manually run [Teamcity configuration (internal)](http://links.k.avito.ru/releaseAvitoTools)
1. Use new version in `avito`
1. Create PR with new `infraVersion`
1. Create release on [releases page](https://github.com/avito-tech/avito-android/releases)

### Local integration tests against avito

Expand All @@ -151,8 +155,18 @@ Shared modules between android-test and gradle.

### CI integration tests against avito

1. Run [Teamcity configuration (internal)](http://links.k.avito.ru/fastCheckIntegration). You can also change build branch if you need to test unmerged code.
1. Pull request checks of avito would run against generated version of tools project.
1. Run [Teamcity configuration (internal)](http://links.k.avito.ru/fastCheck) to check pull request builds.
1. And/or [This one](http://links.k.avito.ru/fullCheck) to check full set of checks.
1. You don't need to be bothered about versions here, checks of avito would run against generated version of tools project.

{{< hint info>}}
You can also change build branch if you need to test unmerged code.
But be careful, Teamcity is tricky about this one:

- By default build will use develop from github agains develop from avito
- If you pick a different branch of avito, it will run against develop on github
- If you pick a different branch of github, it will run against develop on avito
- (UNTESTED) To build both projects of special branch, they should have the same name

{{< /hint >}}

To re-check these changes locally you need to find android tools version in build parameters. Look for `integrationVersion`.\
Also, to resolve this version you have to provide `artifactoryUrl` gradle property.
2 changes: 1 addition & 1 deletion docs/content/KnownIssues.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ type: docs

## New Gradle Sync is not supported due to containing Kotlin modules

Disable _Settings | Experimental | Only sync the active variant_
Disable **Settings > Experimental > Only sync the active variant**

https://stackoverflow.com/questions/54201216/android-studio-3-3-new-gradle-sync-is-not-supported-due-to-containing-kotlin-mo/
2 changes: 1 addition & 1 deletion docs/content/architecture/Dagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ DaggerSettingsComponent.factory()

Компонент отображается красным, как будто его нет.

- Проверь что файлы kapt не добавлены в исключения: _Preferences > Editor > File Types > Ignore Files and Folders_
- Проверь что файлы kapt не добавлены в исключения: **Preferences > Editor > File Types > Ignore Files and Folders**

### Dagger: error.NonExistentClass cannot be provided / converted

Expand Down
2 changes: 1 addition & 1 deletion docs/content/assemble/Mirakle.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Here's Mirakle ...
- Проверь **кастомные системные параметры сборки** в `~/.gradle/gradle.properties`
Они не переносятся на удаленную машину. Выбираем один из вариантов:
- Добавь в аналогичный файл на android-builder
- Добавь аргументами `-Pname=value` в _Preferences | Build, Execution, Deployment | Compiler | Command-line Options_
- Добавь аргументами `-Pname=value` в **Preferences > Build, Execution, Deployment > Compiler > Command-line Options**
NB: про такие настройки легко забыть, по возможности избегай их.

В следующие разы нужно только включать `./mirakle.py --enable`
Expand Down
8 changes: 4 additions & 4 deletions docs/content/assemble/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ type: docs
- Проверь версию IDE и Kotlin плагина.
Возможно они слишком старые или наоборот, alpha/beta версии.
- Добавь `--stacktrace` чтобы увидеть детали ошибки:\
_Settings > Build, Execution, Deployment > Compiler > Command-line Options:_
**Settings > Build, Execution, Deployment > Compiler > Command-line Options:**_
- Проверь что не включен offline mode на вкладке Gradle
- Возможно ошибка в .iml, .idea/ файлах:
- `./clean.py --all` или _File > Re-Import Gradle project_
- _File > Invalidate Caches / Restart_
- Посмотри логи _Help > Show log in Finder_
- `./clean.py --all` или **File > Re-Import Gradle project**
- **File > Invalidate Caches / Restart**
- Посмотри логи **Help > Show log in Finder**

### Если причина в Mirakle

Expand Down
14 changes: 5 additions & 9 deletions docs/content/checks/AndroidLint.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Android Lint
type: docs
---

# Lint
# Android Lint

https://developer.android.com/studio/write/lint

Expand All @@ -28,15 +28,11 @@ https://developer.android.com/studio/write/lint
- Приложения (android application)
- Всего репозитория. Отключит проверку во всех модулях.

## Кастомные проверки
## Custom lint checks

Все кастомные проверки лежат в модуле `lint-checks`.
All customs android lint checks are in `lint-checks` (internal) module.

### Как написать свою проверку?
### Writing a custom lint check

- KotlinConf 2017 - Kotlin Static Analysis with Android Lint by Tor Norbye:
[video](https://youtu.be/p8yX5-lPS6o),
[presentation](https://docs.google.com/presentation/d/1Sr-6E3Tk1lBguUob0GigqSEsfN-04qS56Whj0UEr0AE/edit#slide=id.g29100eff00_2_156)
- [Static Analysis with Android Lint by Tor Norbye (mDevCamp 2019)](https://slideslive.com/38916502)
- [Sample project](https://github.com/googlesamples/android-custom-lint-rules)

Отлично покрываются тестами, но если нужна отладка, то используем общий подход - [debugging]({{< ref "/ci/CustomGradlePlugins.md#debugging" >}})
4 changes: 2 additions & 2 deletions docs/content/ci/CustomGradlePlugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type: docs
1. Предпочтительно использовать IntelliJ IDEA
1. Import project
1. Согласись использовать gradle wrapper
1. Settings > Build, Execution, Deployment > Build Tools > Gradle > Runner
1. **Settings > Build, Execution, Deployment > Build Tools > Gradle > Runner**
1. Delegate IDE build/run actions to gradle (check)
1. Run tests using : Gradle Test Runner

Expand Down Expand Up @@ -85,7 +85,7 @@ open class MyPlugin : Plugin<Project> {
Часто нужно править плагин совместно с ./ci/

Чтобы работать одновременно со всем этим кодом, к уже открытому проекту
добавь модуль ci: File > New > Module from existing sources > путь до папки ci > ok > ok
добавь модуль ci: **File > New > Module from existing sources > путь до папки ci > ok > ok**

## Интеграция плагина в CI

Expand Down
2 changes: 1 addition & 1 deletion docs/content/contributing/CodeStyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type: docs
За настройку code style отвечает [editor config](https://editorconfig.org/).
А точнее [плагин для IDE](https://plugins.jetbrains.com/plugin/7294-editorconfig/).

Нужно убедиться, что плагин установлен и включен (Preferences > Plugins > Installed > search: EditorConfig)
Нужно убедиться, что плагин установлен и включен (**Preferences > Plugins > Installed > search: EditorConfig**)

После этого все настройки авто-формата должны применяться по порядку:
1. EditorConfig настройка на уровне папки
Expand Down
71 changes: 40 additions & 31 deletions docs/content/contributing/Docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Extra materials about technical writing:

- [Jetbrains - Как писать полезные технические тексты](https://youtu.be/8SPq-9kS69M)
- [Microsoft Writing Style Guide](https://docs.microsoft.com/en-us/style-guide/welcome/)
- [GitLab documentaion styleguide](https://docs.gitlab.com/ee/development/documentation/styleguide.html)
- [GitLab documentation styleguide](https://docs.gitlab.com/ee/development/documentation/styleguide.html)
- [What nobody tells you about documentation](https://www.divio.com/blog/documentation/)


Expand Down Expand Up @@ -69,16 +69,21 @@ Naming:

---

- Ориентация на обучение.
- Полезно для новых пользователей.
- Дает практическое понимание вместо теоретического знания. Показывает скорее _как_, а не _что_.
- Assist newcomers to get started
- Is learning-oriented
- Shows _how_ to do in form of a lesson

Приводит к конкретной цели через серию шагов:
The tutorial declares a goal in the beginning.
After it guides by a series of steps. Each step is:

- Простые и понятные
- Повторяемые и надежные, всегда работают
- Дают регулярную позитивную обратную связь
- Минимум теории и объяснений, не грузят лишним
- Easy to follow
- Robust and reliable
- Gives a positive feedback by an immediate result
- Has as minimum theory as possible

Examples:

- [Creating Web Applications with Flask](https://www.jetbrains.com/help/pycharm/creating-web-application-with-flask.html)

<--->

Expand Down Expand Up @@ -168,17 +173,13 @@ Anchor: `{{</* ref "/Name.md#header" */>}}`.

Чтобы посмотреть статистику по ссылке, добавь к ней `+`.

### Shortcuts

Кастомные сниппеты для отображения того, что не поддерживает markdown.\
Их несложно создавать. Напиши, если тебе не хватает какого-то типа контента.

#### Diagrams
### Diagrams

Для диаграм используем [Mermaid](https://mermaid-js.github.io/mermaid/#/), описываем их в текстовом виде:
Diagrams is a preferable way for schemes and processes.\
They are cheaper in maintenance. Text is the source of truth.\
You don't need an original image and can edit it in a text editor.

- Содержимое читается без отрисовки картинки
- Для редактирования не нужны никакие программы
Use [mermaid](https://mermaid-js.github.io/mermaid/#/) shortcode:

[Live editor](https://mermaid-js.github.io/mermaid-live-editor/)

Expand All @@ -198,7 +199,16 @@ stateDiagram
B --> [*]
{{</mermaid>}}

#### Hints
### Images

Images are good for illustrating an explanation.\
Use any public file storage for them. For example, a Github CDN:

![](https://user-images.githubusercontent.com/499192/57450172-1a955f80-725e-11e9-9fed-267179bdab15.gif)

There is a html [figure](https://gohugo.io/content-management/shortcodes/#figure) element for more control.

### Hints

```tpl
{{</* hint [info|warning|danger] */>}}
Expand All @@ -222,7 +232,7 @@ Lorem markdownum insigne. Olympo signis Delphis!
{{< button relref="/" >}}Home{{< /button >}}
{{< button href="http://repo/CONTRIBUTING.md" >}}Contribute{{< /button >}}

#### Tabs
### Tabs

```tpl
{{</* tabs "Unique ID" */>}}
Expand All @@ -238,7 +248,7 @@ Lorem markdownum insigne. Olympo signis Delphis!
{{< tab "Windows" >}} Windows Content {{< /tab >}}
{{< /tabs >}}

#### Columns
### Columns

```tpl
{{</* columns */>}}
Expand All @@ -255,7 +265,7 @@ Right Content
{{< /columns >}}


#### Expand
### Expand

```tpl
{{</* expand "Title" */>}}
Expand All @@ -282,15 +292,6 @@ Markdown content
\overline{a \lor b} = \overline{a} \land \overline{b}
{{< /katex >}}


### Images

Попробуй сначала выразить текстом и диаграммами.
Картинки и скриншоты дороже поддерживать в актуальном состоянии.\
Загружаем картинки в любой публичный image storage.\
На крайний случай, в репозиторий в `docs/static` ( [Static files](https://gohugo.io/content-management/static-files/) )
Для более гибкого отображения картинок используй [shortcode](https://gohugo.io/content-management/shortcodes/#figure)

### Lists

#### Нумерованный или ненумерованный
Expand Down Expand Up @@ -318,6 +319,14 @@ Markdown content

{{< /columns >}}

## Language

### Interaction with UI

- Use bold text for describing menu items and `>` as separator\
Open **Preferences > Build, Execution, Deployment > Debugger**
- Use exact words as shown in UI

### Выделение терминов

Выделяй символом ` команды, параметры, значения, имена файлов и т.п.:
Expand Down
4 changes: 2 additions & 2 deletions docs/content/contributing/HowToStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type: docs

# How to start

## Минимальные требования
## Minimal requirements

- 16Gb RAM
- Linux/OSX/Windows
Expand All @@ -31,7 +31,7 @@ type: docs

### Обнови Kotlin плагин до последней версии

_Preferences | Languages & Frameworks | Kotlin_
**Preferences > Languages & Frameworks > Kotlin**

### Подключи необходимые плагины

Expand Down
2 changes: 1 addition & 1 deletion docs/content/ide/Benchmarking.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: docs
## Как попробовать?

1. Установи плагин
1. Запусти Help > Diagnostic > Execute Performance Scrip from File\
1. Запусти **Help > Diagnostic > Execute Performance Scrip from File**\
Выбери готовый сценарий из /benchmarks/ide

## Как проверить гипотезу и измерить разницу?
Expand Down
Loading

0 comments on commit df87818

Please sign in to comment.