it's frustrating, i uploaded my project to subversion and everything is perfect.
but I can not ignore the *.iml files and local.properties
the folders are ignored correctly, but the files are not ignored.
You should use an svn client to set the svn-property "svn:ignore" to your wished setting. svn supports wildcards like "*.iml". It is easiest in tortoisesvn but also possible via commandline:
svn propedit <Your Directory>
Related
I have read about general files that should be ignored in android studio project(What should be committed to the repository in the eclipse workspace?), but whenever i checkout to earlier versions on repo, i'm facing problems like difference in gradle version so i have to download gradle versions that i don't want to use in future and it is hard for me to download them.
so Which files on .idea directory should be committed to git repository?
what about *.iml files?
Have a look here for an answer to your question. The IntelliJ documentation claims that you should share the following:
All the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings
All the .iml module files that can be located in different module directories (applies to IntelliJ IDEA)
I develop using IntelliJ, and I noticed that the .idea\libraries folder does in fact contain data relevant to the JAR files which are on my classpath. This information would be critical to anyone who wants to also run my project from their IDE on another computer.
I have been working on a local machine and pushing my changes up to Stash (Pretty much BitBucket).
Everything has been going fine but not I am trying to clone the code down to a co-workers machine and am having some serious issues with Android Studio.
I am importing the project through vcs, choosing git option, and providing the URL.
Whenever we try to get the project running we run into build problems and Gradle not working properly. The project is not initially shown as an Android project and we have to configure the framework. Then we have gradle saying it cannot find 'com.android.application' file. I have ensured that I have the correct Gradle version to work.
I think that I may not be pushing up the correct files to Stash, so when we clone the project it does not have enough information to build properly.
The files that I have not pushed up are the following:
build.gradle (at highest level not app level)
gradle.properties
gradlew
gradlew.bat
NAMEOFAPP.iml
.idea/.name
.idea/encodings.xml
.idea/gradle.xml
.idea/misc.xml
.idea/modules.xml
.idea/vcs.xml
.idea/copyright/profiles_settings.xml
.idea/dictionaries/USERNAME.xml
.idea/scope/scope_settings.xml
app/app.iml
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
You definitely want to push up build.gradle. That is the file that describes the Gradle build for the project.
You will also want the .iml files pushed up, and the gradlew files (which are gradle scripts for different platforms), and probably the gradle/wrapper files.
You do not have to push up the .idea files. They specify the AS/IntelliJ workspace settings. It can be convenient to share these between collaborators as you will all be in the same environment, but it can also be frustrating having other people overwrite your preferred settings, so this is up to the developers in question.
I am developing an android application in eclipse and using git as the version control system. When I first created the git repo, I accidentally added some eclipse project files. As a result, when I clone the project to a different environment, (e.g. another window/linux computer) there are some project properties/directories that are based on my initial environment and can cause issues in the new environment (directory doesn't exist, toolchain doesn't exist, etc).
What are some eclipse project files I should exclude from the repo to ensure that the project can be build in any environment assuming they have already set up eclipse to work with android apps?
Thanks
bin/gen folders and local.properties files should be ignored. That's should be all you need to ignore
Files in the /gen and /bin folders, because these contain files generated during compilation and/or building. If you are using proguard, files in /proguard should also be excluded, though you should keep them somewhere so that you can remap the class names when you get stack traces from crash reports on Google Play.
I am trying to automate the android build process using Jenkins
I am using the following site to achieve this
Link to site
I am successfully able to Build it on my own machine. Initially i got error saying that build.xml file not found (build using ant requires this file). So i execute "android update project". So it automatically generate all necessary file for ant.
Now my problem begins when i tried to host my repo to remote server and tried to build from another machine. The error it is giving is the sdk.dir is not correct. When i analysed the project folder ther is a file called local.properties which contains the SDK path of my first machine which is wrong for other machines. So i add that file to gitignore. Now that file is not tracking and because of this the build is failing.
So is there any way to automatically generate the files that is necessary for ant after jenkins is cloning project from the remote repo?
From the website you link to, they precisely explain how to configure sdk.dir:
Configuring the environment
When jenkins builds your project with Ant, it needs to know where your
android sdk folder is. To do this, click Advanced on the Ant target
build step you just configured and add the following variable to the
Properties field. sdk.dir=/opt/android-sdk-linux/
Don’t forget to substitute the value of the variable with the correct
location where the Android SDK is installed on your build server.
Job configuration is done. Click Save. Time to test your build.
We also build android apps with Jenkins, and also need to edit the local.properties.
In my case, I have the file updated with the path to SDK by the Jenkins build itself. Just before the build starts.
You can use a simple sed command on linux or echo the content on windows (overwriting content).
Example flow:
SCM - get sources
Edit the local.properties (as suggested before)
Run ant build
Note - if you are using the "Invoke Ant", you should add an "Execute Shell" step before to deal with the editing of the local.properties.
I hope this helps.
Yes.
If you install the Android Emulator Plugin for Jenkins, you can add the "Create Android build files" build step to your job.
This will automatically detect any Android app, test or library projects in your Jenkins workspace and add/update the build.xml and local.properties files as necessary.
Alternatively, if you're using the Ant build step and already have the build.xml in your repository, you can ignore the need to create a local.properties file, by specifying the sdk.dir property yourself in the Advanced Ant options.
You can configure ant properties in jenkins. So you can specify all properties of your local.properties through the jenkins job configuration.
Of course you will have to install the android sdk on the jenkins build server.
Please read this for info on how setting ant properties with jenkins.
It's not a good practice to put the local.properties under source code management since multiple developers and CI will have different values for those properties.
you can edit the local.properties file in the jenkins workspace folder to the correct sdk path
I think you want to add the build step "Create Android build files" to your configuration. Place it before the ant build.
This invokes the android update project and android update lib-project. Make sure you referenced your library dependencies in the project.properties with relative paths. Like this:
# Project target.
target=Google Inc.:Google APIs:19
android.library.reference.1=../external-libs/google-play-services_lib
android.library.reference.2=../external-libs/android-support-v7-appcompat
Hi I'm currently working on an android project with a group of developers using both Eclipse and IntelliJ. We're using SVN as our repo. It seems like every time someone using eclipse checks in they break the IDEA people and vice-verse. I was wondering if anyone had any recommendations on what files we should ignore from SCM and any other advice on making this process smoother?
I would suggest keeping IDE specific project files out of versioning. I have few Android projects where I use Intellij IDEA and Eclipse interchangingly and they seem to be playing well with each other.
Here is what I have in the git repository:
.gitignore
AndroidManifest.xml
ant.properties
build.xml
proguard.cfg
project.properties
res/ folder
src/ folder
It's pretty hard to give advice without knowing more details about what "breaks." But I can tell you that for Eclipse you need to have the files .project and .classpath checked in. If there's a .settings directory, that should be checked in also. These files are Eclipse-specific and won't affect IntelliJ or any other tool.
Check out https://github.com/github/gitignore. Just add the IDEs, languages, and frameworks you're using. The Eclipse and IntelliJ ignores are in the Global/ folder.