diff --git a/README.md b/README.md index 737d161..0ea6370 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The buildpack will do the following: * If `/deps.edn` exists * Contributes Clojure Tools to a layer with all commands on `$PATH` * Runs `/clojure -X:uberjar` to build the application -* Removes the source code in `` +* Removes the source code in ``, following include/exclude rules * If `$BP_CLJ_BUILT_ARTIFACT` matched a single file * Restores `$BP_CLJ_BUILT_ARTIFACT` from the layer, expands the single file to `` * If `$BP_CLJ_BUILT_ARTIFACT` matched a directory or multiple files @@ -30,6 +30,8 @@ The buildpack will do the following: | `$BP_CLJ_DEPS_ARGUMENTS` | Configure the arguments to pass to build system. Defaults to `-X:uberjar`. | | `$BP_CLJ_BUILT_MODULE` | Configure the module to find application artifact in. Defaults to the root module (empty). | | `$BP_CLJ_BUILT_ARTIFACT` | Configure the built application artifact explicitly. Supersedes `$BP_CLJ_BUILT_MODULE`. Defaults to `target/*.jar`. Can match a single file, multiple files or a directory. Can be one or more space separated patterns. | +| `$BP_INCLUDE_FILES` | Colon separated list of glob patterns to match source files. Any matched file will be retained in the final image. Defaults to `` (i.e. nothing). | +| `$BP_EXCLUDE_FILES` | Colon separated list of glob patterns to match source files. Any matched file will be specifically removed from the final image. If include patterns are also specified, then they are applied first and exclude patterns can be used to further reduce the fileset. | ## Bindings diff --git a/buildpack.toml b/buildpack.toml index 4ad08db..21fcbfc 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -60,6 +60,18 @@ api = "0.7" description = "the module to find application artifact in" name = "BP_CLJ_BUILT_MODULE" + [[metadata.configurations]] + build = true + default = "" + description = "colon separated list of glob patterns, matched source files are included" + name = "BP_INCLUDE_FILES" + + [[metadata.configurations]] + build = true + default = "" + description = "colon separated list of glob patterns, matched source files are removed" + name = "BP_EXCLUDE_FILES" + [[metadata.dependencies]] cpes = ["cpe:2.3:a:cognitect:clojure:1.11.1:*:*:*:*:*:*:*"] id = "clojure"