J
J
J. Snow2017-01-26 13:50:20
Java
J. Snow, 2017-01-26 13:50:20

How to work with Gradle Configurations (not Android)?

Hey!
I want to make sure that in a Java project there are 2 different builds (such as dev and prod), and each of these builds has its own dependencies (in particular, different loggers).
Let's say I created 2 configurations and specified different dependencies for them:

configurations {
  prod { extendsFrom compile }
  dev { extendsFrom compile }
}
dependencies {
  dev group: 'org.slf4j', name: 'slf4j-nop', version: '1.7.22'
  prod group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.9'

  // compile dependencies
}

Как теперь между ними переключаться в IntelliJ IDEA ?
И как билдить соответствующие jar-ки?
Ну и вообще, есть ли какой-то механизм настройки разных версий проекта (типа BuildTypes/BuildFlavors как в Android) ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question