A
A
Alexey_gr2015-04-19 23:20:54
Java
Alexey_gr, 2015-04-19 23:20:54

How to organize resource preprocessing in a gradle project under eclipse?

I decided to try to use gradle in my new project, the IDE chose the eclipse I was used to, installed the Gradle IDE plugin.
In projects with maven, it is possible to replace values ​​in resource files from pom file properties. There is something like this in gradle

processResources {
    filesMatching('**/logback.groovy') {
        filter {
            it.replace('${logback.loglevel}', logbackLoglevel)
        }
    }
}

Eclipse ignores these lines, and it seems like the rest of the cost logic. Whether it is possible to overcome it somehow? So far, gradle is a pretty good project builder for me, but useless in the context of eclipse.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2015-04-20
@zolt85

In my project, I just copied resources from different directories for dev and prod environments.
I have a web application and on my machine (dev environment) I run it using the appRun task, courtesy of the gretty plugin. And I needed to put a configuration file in the assembly. Did it like this:

task copyDev (type: Copy) {
    from ("work/dev")
    into("build/resources/main")
}
...
project.afterEvaluate {
    project.tasks.appRun.dependsOn copyDev
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question