license-gradle-plugin icon indicating copy to clipboard operation
license-gradle-plugin copied to clipboard

Excluding folders?

Open WittyYeti opened this issue 10 years ago • 7 comments

Hello is it possible to exclude entire folders from the task without changing the sourceSets? I have tried all possible combinations of exclusion patters, none seem to be working.

WittyYeti avatar Dec 16 '14 14:12 WittyYeti

I have also tried to achieve this, and failed. In our case we have java source code generated through wsdl2java, and I have not been able to exclude this folder of generated code from the checks, resulting in a failed build if ignoreFailures is false.

I have tried a lot of different things, most of them variations on the following:

exclude "/generatedSource//*"

strindberg avatar Dec 17 '14 13:12 strindberg

I would assume (note I have not tested this) that the following should work:

license {
  exclude "**/generatedSource/**"
}

A "best practice" is for generated code to end up in a different source directory, for instance src/main/generated.

hierynomus avatar Dec 17 '14 13:12 hierynomus

What you suggest is what I have tried without success. In fact, we store the generated source under the build directory, i.e. it is not even in the real source tree. Still I can't get it to be excluded.

strindberg avatar Dec 17 '14 14:12 strindberg

Btw, I see now that my first comment was mangled by the Markdown processor (I assume). I use the same pattern as you suggest in your reply.

strindberg avatar Dec 17 '14 14:12 strindberg

The problem with **generatedSource** is that it excludes ALL folder containing that name. We want to exclude a third-party API inside the API folder, so when we exclude api our API is also excluded.

WittyYeti avatar Dec 17 '14 15:12 WittyYeti

@hierynomus I would've assumed the same thing as its standard ANT notation, however I face the same problem of not being able to exclude directories. Tried this but also formatting like: /my/path/** to exclude all files and paths underneath that. This doesn't work but should according to http://ant.apache.org/manual/dirtasks.html#patterns

stijnvandrunen avatar Mar 17 '16 07:03 stijnvandrunen

Anyone here had luck figuring this one out?

shabtaisharon avatar Jun 10 '20 16:06 shabtaisharon