Merge commit '2d92e1d44491d62005e45adcf3dc1c5a403c386f' into less_memory_test_branch
This commit is contained in:
@@ -27,6 +27,9 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-
|
||||||
|
|
||||||
|
- name: Linter (gradle)
|
||||||
|
run: ./gradlew ktlintCheck
|
||||||
|
|
||||||
- name: Test (gradle)
|
- name: Test (gradle)
|
||||||
run: ./gradlew test --no-daemon
|
run: ./gradlew test --no-daemon
|
||||||
|
|
||||||
|
|||||||
@@ -97,11 +97,25 @@ Build the app:
|
|||||||
./gradlew connectedAndroidTest
|
./gradlew connectedAndroidTest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Linting
|
||||||
|
```bash
|
||||||
|
./gradlew ktlintCheck
|
||||||
|
./gradlew ktlintFormat
|
||||||
|
```
|
||||||
|
|
||||||
## Installing on device
|
## Installing on device
|
||||||
```bash
|
```bash
|
||||||
./gradlew installDebug
|
./gradlew installDebug
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Git Hooks
|
||||||
|
|
||||||
|
You can add the git hook running the following bash script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./tools/git-hooks/init.sh
|
||||||
|
```
|
||||||
|
|
||||||
## How to Deploy
|
## How to Deploy
|
||||||
|
|
||||||
1. Generate a new signing key
|
1. Generate a new signing key
|
||||||
|
|||||||
@@ -167,3 +167,7 @@ dependencies {
|
|||||||
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
|
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
|
||||||
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
|
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ktlint {
|
||||||
|
disabledRules.set(["no-wildcard-imports"])
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,3 +14,10 @@ plugins {
|
|||||||
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
|
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
|
||||||
id 'org.jetbrains.kotlin.jvm' version '1.8.10' apply false
|
id 'org.jetbrains.kotlin.jvm' version '1.8.10' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task installGitHook(type: Copy) {
|
||||||
|
from new File(rootProject.rootDir, 'pre-commit')
|
||||||
|
into { new File(rootProject.rootDir, '.git/hooks') }
|
||||||
|
fileMode 0777
|
||||||
|
}
|
||||||
|
tasks.getByPath(':app:preBuild').dependsOn installGitHook
|
||||||
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
NO_COLOR='\033[0m'
|
||||||
|
|
||||||
|
echo "*********************************************************"
|
||||||
|
echo "Running git pre-commit hook. Running Static analysis... "
|
||||||
|
echo "*********************************************************"
|
||||||
|
|
||||||
|
./gradlew ktlintCheck
|
||||||
|
|
||||||
|
status=$?
|
||||||
|
|
||||||
|
if [ "$status" = 0 ] ; then
|
||||||
|
echo "Static analysis found no problems."
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "*********************************************************"
|
||||||
|
echo 1>&2 "Static analysis found violations it could not fix."
|
||||||
|
printf "Run ${GREEN}./gradlew ktlintFormat${NO_COLOR} to fix formatting related issues...\n"
|
||||||
|
echo "*********************************************************"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user