Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to exclude entire source directories #6

Open
msrd0 opened this issue Oct 18, 2017 · 1 comment
Open

Add a way to exclude entire source directories #6

msrd0 opened this issue Oct 18, 2017 · 1 comment

Comments

@msrd0
Copy link

msrd0 commented Oct 18, 2017

Consider the following source set:

sourceSets {
    main {
        java.srcDirs = ['src/', 'generated/']
        resources.srcDirs = ['res/']
    }
}

Right now, it is not possible to write something like this to exclude the generated/ folder:

license {
    exclude 'generated/**'
}

However, it doesn't make sense to add the license header to the generated source files. The only option right now is either put all generated sources into their own package and exclude that one (only works when your code generator supports this), or by excluding every file on its own, which requires you to know the name of that file.

Can we please have an option to exclude an entire source directory?

@zml2008
Copy link
Contributor

zml2008 commented Apr 10, 2021

I have something like:

                extensions.configure(LicenseExtension::class.java) {
                    it.exclude {
                        it.file.startsWith(buildDir)
                    }
                }

in my buildscripts, which seems to work well enough to handle this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants