Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .gitignore #170

Open
wants to merge 3 commits into
base: primary
Choose a base branch
from
Open

Conversation

shaneharper123
Copy link
Contributor

Some reasons to add a .gitignore file:

  • "Externally added files can be added to Git" notifications in Android Studio won't be displayed regarding build output files.
  • "git status" won't list irrelevant build files.
  • After adding new source files it should be possible to simply add them all to git with "git add ."; files that don't need to be versioned will be ignored.
  • Some command line search tools such as ripgrep and ag ("The Silver Searcher") will automatically ignore files specified by a .gitignore file.

- "Externally added files can be added to Git" notifications in Android Studio won't be displayed regarding build output files.
- "git status" won't list irrelevant build files.
Common/build/outputs/mapping/*/mapping.txt will still be generated. (That file will contain exactly what Common/printmappingout.txt would have contained.)

(The original reason to modify Common/proguard-rules.my was to stop an output file (printmappingout.txt) being written in a directory where source files are stored.)
Android Studio would show a notification window regarding an invalid path when the project was opened for the first time if the SDK couldn't be found at the location specified in local.properties. (local.properties specified the Android SDK directory as '/home/jka/Android/Sdk'.)

Now, with no local.properties file in the git repo, there's no notification about an invalid SDK directory when opening the project for the first time. A new local.properties file specifying the correct SDK directory is created when the project is opened.

If there's a need to regenerate the local.properties file after pulling this commit one can do that by clicking on "File / Sync Project with Gradle Files" in Android Studio. (The Android SDK directory can also be specified using the ANDROID_HOME environment variable.)

The first line of the local.properties file was:
    ## This file must *NOT* be checked into Version Control Systems,

local.properties was added to .gitignore in f53ea03.
@shaneharper123
Copy link
Contributor Author

I've just amended the commit message of the last commit ("Delete local.properties file."). I mentioned how the commit can stop Android Studio showing a notification window regarding an invalid path, viz.

Android Studio would show a notification window regarding an invalid path when the project was opened for the first time if the SDK couldn't be found at the location specified in local.properties. (local.properties specified the Android SDK directory as '/home/jka/Android/Sdk'.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant