mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-26 17:56:24 +02:00
Merge commit '2d92e1d44491d62005e45adcf3dc1c5a403c386f' into less_memory_test_branch
This commit is contained in:
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@@ -27,6 +27,9 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Linter (gradle)
|
||||
run: ./gradlew ktlintCheck
|
||||
|
||||
- name: Test (gradle)
|
||||
run: ./gradlew test --no-daemon
|
||||
|
||||
|
14
README.md
14
README.md
@@ -97,11 +97,25 @@ Build the app:
|
||||
./gradlew connectedAndroidTest
|
||||
```
|
||||
|
||||
## Linting
|
||||
```bash
|
||||
./gradlew ktlintCheck
|
||||
./gradlew ktlintFormat
|
||||
```
|
||||
|
||||
## Installing on device
|
||||
```bash
|
||||
./gradlew installDebug
|
||||
```
|
||||
|
||||
## Git Hooks
|
||||
|
||||
You can add the git hook running the following bash script:
|
||||
|
||||
```bash
|
||||
./tools/git-hooks/init.sh
|
||||
```
|
||||
|
||||
## How to Deploy
|
||||
|
||||
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-test-manifest:$compose_ui_version"
|
||||
}
|
||||
|
||||
ktlint {
|
||||
disabledRules.set(["no-wildcard-imports"])
|
||||
}
|
||||
|
@@ -13,4 +13,11 @@ plugins {
|
||||
id 'com.android.library' version '7.4.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' 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
|
23
pre-commit
Executable file
23
pre-commit
Executable file
@@ -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