Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN Ignore files in Android Studio

I'm trying to ignore the build folder in my project, I've tried adding the svn:ignore property recursively to it, added in to Settings > Version Control > Ignore Files, from the right click menu under Subversion I can't choose the Ignore option, it's greyed out. After I've done all that when I choose commit directory on the project the build folder still shows up. What's the correct way to make the folder be ignored?

like image 253
TMH Avatar asked May 08 '14 08:05

TMH


People also ask

How do I find my svn ignore list?

Use: svn pg -R svn:ignore . See Stack Overflow question How do I view all ignored patterns set with svn:ignore recursively in an SVN repository? This shows the relative path with all files ignored by SVN in a working copy of a folder structure.

How do I ignore target folder in svn?

To ignore files in subversion you want to set the svn:ignore property. You can see more here http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.ignore.html about half way down. svn propset svn:ignore target . svn propedit svn:ignore .


2 Answers

I am new to Android Studio too. I tried this method to not use plug-in nor command lines. Only uses Android Studio interface (version 1.5.1).

  • First step, as Kenneth Evans' good answer says, is declare all resources that must be ignored in File > Settings > Version Control > Ignored Files. These resources are:
    Mask: *.iws (select Ignore all files matching option to add this pattern)
    Directory: .gradle
    Directory: .idea/libraries/
    File:.idea/workspace.xml
    Directory: build/
    File: local.properties
    Directory: app/build/ (this must be for every module your project has)
    Mask: *.iml
    File: .DS_Store
  • Next step is Revert these resources (files and folders) to their initial state in repository

I have a project with several modules, each of them with a build folder. If this is your case, can avoid wasting too much time and try one module. Test if this process is successful and apply to all of them.
First you see build folder in green color because it's attached to svn repository. Right click it and choose Subversion - Revert. This process is unrelevant because all files in this folder will be rebuilt next time you build your project. If you dare, can mark all folders that must be ignored in order to be reverted. Once Revert finishes, folder names are showed in brown color

  • Make a commit of the project - this updates which resources must be taken into account when commit is made. It takes a while beacause all files that were marked before as included in commit process, now are being unmarked. When this long process finishes, shows a dialog where all excluded resources are not showed or a message with "No changes" instead

Now local.propeties file can be right-click and choose Subversion > ignore local.properties
Compile your project an try commit - make some change at any source to force compile and build your project.
Finally commit directory from project (right click project and choose Subversion - Commit Directory...). This final step allows test that now, it is really faster because these excluded resources doesn't appear in commit accept dialog

like image 156
Castanini Avatar answered Sep 20 '22 12:09

Castanini


When you add files or folders to VCS they are added to the Default Changelist. Move the files and folders you wish to ignore into a different Changelist (perhaps called ignored). Finally, only commit the Default Changelist and ignore the ignored Changelist.

like image 38
Tosin Ogunrinde Avatar answered Sep 18 '22 12:09

Tosin Ogunrinde