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

<includes> and <excludes> filtering feature for extraDirectories #3173

Merged
merged 19 commits into from
Mar 31, 2021

Conversation

chanseokoh
Copy link
Member

@chanseokoh chanseokoh commented Mar 31, 2021

On top of #3171. Review it first.

Fixes #2564 (and #3164).

The idea is to allow glob patterns that works similar to how maven-resources-plugin works. This makes adding a single file easy as well.

         <extraDirectories>
            <paths>
              <path>
                <from>src/main/resources/static</from>
                <into>/app/static</into>
                <includes>foo.txt</includes> <!-- only foo.txt will be copied -->
              </path>
              <path>
                <from>src/main/resources/pictures</from>
                <into>/app/pictures</into>
                <!-- Only copy these, but exclude some. -->
                <includes>*.bmp,*.gif,**/*.bmp,**/*.gif</includes>
                <excludes>
                  <exclude>*test*.*</exclude>
                  <exclude>*.thumbnail</exclude>
                  <exclude>**/*test*.*</exclude>
                  <exclude>**/*.thumbnail</exclude>
                </excludes>
              </path>
            </paths>
          </extraDirectories>

In a follow-up PR, I'll add integration tests for Maven and Gradle and update CHANGELOG.

@google-cla google-cla bot added the cla: yes label Mar 31, 2021
@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #3173 (f97e546) into master (1ea37ee) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3173      +/-   ##
============================================
+ Coverage     71.15%   71.18%   +0.03%     
- Complexity     2323     2331       +8     
============================================
  Files           279      279              
  Lines          9835     9846      +11     
  Branches        989      990       +1     
============================================
+ Hits           6998     7009      +11     
  Misses         2491     2491              
  Partials        346      346              
Impacted Files Coverage Δ Complexity Δ
...jib/plugins/common/JavaContainerBuilderHelper.java 95.31% <100.00%> (+0.76%) 21.00 <12.00> (+8.00)
...b/plugins/common/PluginConfigurationProcessor.java 64.08% <100.00%> (+0.20%) 65.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ea37ee...f97e546. Read the comment docs.

@chanseokoh chanseokoh merged commit b286cca into master Mar 31, 2021
@chanseokoh chanseokoh deleted the impl-extra-dirs-filtering branch March 31, 2021 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to add single file to a container (with setting rights)
2 participants