Skip to content

Commit

Permalink
Initial Release (1.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
areitz-nerdery committed Jun 1, 2017
0 parents commit 78e8f7b
Show file tree
Hide file tree
Showing 13 changed files with 1,853 additions and 0 deletions.
173 changes: 173 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
= Android Standards Repo

This is a single place for all our Android Standards to live and grow.
To make a change or suggest an edit to these standards please fork this
repository and create a pull request. To discuss possible changes please
create an issue.

== code-style

Contains Android Studio code style templates and an install script for copying them
to your Android Studio or IntelliJ config directory. See the
link:code-style/README.adoc[README] for more info.

== standards

Living documents which demonstrate best practices for The Nerdery's Android
discipline. See them link:standards/index.adoc[here].

== License

image:https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png["Creative Commons License", link="LICENSE"]

This work is licensed under a link:LICENSE[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License]
14 changes: 14 additions & 0 deletions code-style/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
= Android Code Styles

Android Studio code style settings for The Nerdery's Android projects.

== Installation

* On Unix, run the `install.sh` script. Windows users should use `install.bat` instead.
* Restart Android Studio if it is running.
* Open Android Studio -> Settings -> Editor -> Code Styles, change the scheme to `NerderyAndroid`

== Credit

Based on the Android code style customized by
https://github.com/square/java-code-styles[Square].
374 changes: 374 additions & 0 deletions code-style/configs/codestyles/NerderyAndroid.xml

Large diffs are not rendered by default.

Empty file.
5 changes: 5 additions & 0 deletions code-style/configs/inspection/Nerdery.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<inspections profile_name="Nerdery" version="1.0">
<option name="myName" value="Nerdery" />
<inspection_tool class="FallthruInSwitchStatement" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="UnnecessarySemicolon" enabled="true" level="ERROR" enabled_by_default="true" />
</inspections>
17 changes: 17 additions & 0 deletions code-style/configs/options/editor.codeinsight.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<application>
<component name="CodeInsightSettings">
<EXCLUDED_PACKAGE NAME="autovalue.shaded" />
<EXCLUDED_PACKAGE NAME="avro.shaded" />
<EXCLUDED_PACKAGE NAME="com.beust.jcommander.internal" />
<EXCLUDED_PACKAGE NAME="com.sun.istack" />
<EXCLUDED_PACKAGE NAME="jline.internal" />
<EXCLUDED_PACKAGE NAME="joptsimple.internal" />
<EXCLUDED_PACKAGE NAME="junit.framework.Assert" />
<EXCLUDED_PACKAGE NAME="org.assertj.core.util" />
<EXCLUDED_PACKAGE NAME="org.flywaydb.core.internal.util" />
<EXCLUDED_PACKAGE NAME="org.hibernate.validator.internal" />
<EXCLUDED_PACKAGE NAME="org.mockito.internal.util.collections" />
<EXCLUDED_PACKAGE NAME="org.mockito.internal.verification.VerificationModeFactory" />
<EXCLUDED_PACKAGE NAME="junit.framework.Assert" />
</component>
</application>
22 changes: 22 additions & 0 deletions code-style/install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
REM Installs The Nerdery's IntelliJ configs into your user configs.
@echo off
echo Installing Nerdery IntelliJ configs...

setlocal enableDelayedExpansion

for /D %%i in ("%userprofile%"\.AndroidStudio*) do call :copy_config "%%i"
for /D %%i in ("%userprofile%"\.IdeaIC*) do call :copy_config "%%i"
for /D %%i in ("%userprofile%"\.IntelliJIdea*) do call :copy_config "%%i"

echo.
echo Restart IntelliJ and/or AndroidStudio, go to preferences, and apply 'NerderyAndroid'.
exit /b

REM sub function for copy config files
:copy_config
set config_dir=%~1\config
echo Installing to "!config_dir!"
xcopy /s configs "!config_dir!"
echo Done.
echo.
exit /b
39 changes: 39 additions & 0 deletions code-style/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# Installs The Nerdery's Android Studio configs into your user configs.

echo "Installing Nerdery Android Studio configs..."

CONFIGS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/configs"
# escape spaces in path
CONFIGS=$(echo $CONFIGS | sed 's/ /\\ /g')

for i in $HOME/Library/Preferences/IntelliJIdea* \
$HOME/Library/Preferences/IdeaIC* \
$HOME/Library/Preferences/AndroidStudio* \
$HOME/.IntelliJIdea*/config \
$HOME/.IdeaIC*/config \
$HOME/.AndroidStudio*/config
do
if [[ -d $i ]]; then

# Install codestyles
mkdir -p $i/codestyles
cp -frv "$CONFIGS/codestyles"/* $i/codestyles

# Install inspections
mkdir -p $i/inspection
cp -frv "$CONFIGS/inspection"/* $i/inspection

# Install options ("Exclude from Import and Completion")
mkdir -p $i/options
cp -frv "$CONFIGS/options"/* $i/options

# Install file templates
mkdir -p $i/fileTemplates/includes
cp -fv "$CONFIGS/fileTemplates/includes/File Header.java" $i/fileTemplates/includes
fi
done

echo "Done."
echo ""
echo "Restart Android Studio, go to preferences, and apply 'NerderyAndroid'."
Loading

0 comments on commit 78e8f7b

Please sign in to comment.