├── README.md ├── configs ├── codestyles │ ├── Prolific.xml │ ├── ProlificAndroid.xml │ └── SquareAndroid.xml └── inspection │ └── Prolific.xml └── install.sh /README.md: -------------------------------------------------------------------------------- 1 | Android Code Styles and Quality Checks 2 | ====================================== 3 | 4 | Android Studio code style settings and code quality configs for Prolific's Android projects. 5 | 6 | 7 | Installation for Code Styles 8 | ---------------------------- 9 | 10 | * Run the `install.sh` script. 11 | * Restart Android Studio if it's running. 12 | * Open Android Studio Project Settings -> Code Styles, change the code style for the 13 | project to the one you want. 14 | 15 | Adding Code Quality Checks to Project 16 | ------------------------------------- 17 | 18 | * Copy the quality folder to your project folder. 19 | * In your `app/build.gradle` file add the following lines whereever you define plugins: 20 | - `apply from: '../quality/quality.gradle'` 21 | - `apply from: '../quality/jacoco/jacoco.gradle'` 22 | 23 | * __Run the task using `./gradlew check`__ 24 | 25 | License 26 | ------- 27 | 28 | [![Public domain](https://licensebuttons.net/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/legalcode) 29 | -------------------------------------------------------------------------------- /configs/codestyles/Prolific.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 28 | -------------------------------------------------------------------------------- /configs/codestyles/ProlificAndroid.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 23 | 30 | -------------------------------------------------------------------------------- /configs/codestyles/SquareAndroid.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 28 | -------------------------------------------------------------------------------- /configs/inspection/Prolific.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Installs Prolific's IntelliJ configs into your user configs. 3 | 4 | echo "Installing Prolific code style configs..." 5 | 6 | CONFIGS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/configs" 7 | 8 | for i in $HOME/Library/Preferences/IntelliJIdea* \ 9 | $HOME/Library/Preferences/IdeaIC* \ 10 | $HOME/Library/Preferences/AndroidStudio* \ 11 | $HOME/.IntelliJIdea*/config \ 12 | $HOME/.IdeaIC*/config \ 13 | $HOME/.AndroidStudio*/config 14 | do 15 | if [[ -d $i ]]; then 16 | 17 | # Install codestyles 18 | mkdir -p $i/codestyles 19 | cp -frv "$CONFIGS/codestyles"/* $i/codestyles 20 | 21 | # Install inspections 22 | mkdir -p $i/inspection 23 | cp -frv "$CONFIGS/inspection"/* $i/inspection 24 | fi 25 | done 26 | 27 | echo "Done." 28 | echo "" 29 | echo "Restart IntelliJ and/or AndroidStudio, go to preferences, and apply 'Prolific' or 'ProlificAndroid'." 30 | 31 | --------------------------------------------------------------------------------