Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have separate gradle.properties for CI and AndroidStudio?

Currently, I have one gradle.properties file. It configured specifically for CI with low available memory, because otherwise CI will crash

org.gradle.jvmargs=-Xmx1500m -XX:MaxPermSize=512m

However, when I make builds on the local machine it is very slow and local machine allows more memory use. Can I have separate gradle.properties for CI and AndroidStudio?

like image 524
ar-g Avatar asked Jun 29 '17 14:06

ar-g


People also ask

What is Gradle properties in Android Studio?

Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.

Where is Gradle properties file in Android Studio?

properties in the project folder or in the C:\Users\Username. gradle. Please make sure that the name of file is "gradle.

Do I need Gradle for Android Studio?

Android Studio comes with a working installation of Gradle, so you don't need to install Gradle separately in that case. In order to create a new build or add a Wrapper to an existing build, you will need to install Gradle according to these instructions.


1 Answers

According to the documentation, you can have multiple gradle.properties files. One in your project directory and one in user home directory.

As it's said:

The configuration is applied in following order (if an option is configured in multiple locations the last one wins):

  • from gradle.properties in project build dir.
  • from gradle.properties in gradle user home.

In your case, you cam place CI-specific properties into the gradle.properties under user home on CI-server. This properties will be specific for CI-server and take over local properties stored under VCS.

like image 52
Stanislav Avatar answered Sep 30 '22 04:09

Stanislav