Dynamic gatling.conf and logback.xml files

Hi,

I have a multi-tenant, multi-env setup running, that executes the same requests and bodies. The different tenants and environments just use different endpoints and different sets of product features. As such, I am trying to use a different logback.xml and gatling.conf for each. This is primarily because they each have a different security setup, publishing strategy, etc. I am using the gatling-gradle-plugin and my build file (simplified and abstracted) looks like this:

plugins {
    id "com.github.lkishalmi.gatling" version "0.7.1"
}

repositories {
    mavenCentral()
}

apply plugin: 'scala'

dependencies {

    compile 'org.scala-lang:scala-library:2.12.4'
}

if(env1){
    gatling.confDir = '/src/gatling/conf/env1'
}
else if(env2){
    gatling.confDir = "/src/gatling/conf/env2"
}
else if (env3) {
    gatling.confDir = "/src/gatling/conf/env3"
}
else if (env4) {
    gatling.confDir = "/src/gatling/conf/env4"
}
...
...
...


I’ve seen stuff online about multiple source sets, but these different environments and clients all use the same code, the same requests, etc, so I don’t think that is the solution I want. If I add gatlingRuntime files(“src/gatling/conf/env1”) to the dependencies, then the logback.xml prints lines that says multiple files logback.xml files were found: one in the env1 folder and one in the conf folder that I didn’t put there.

What’s the correct way of doing this?

Thanks,
Tim