// The filepath must end in "/**" or "/" - Glob wildcard - as a git sparse checkout def allowed(String filepath) { if (filepath.endsWith('/**') || filepath.endsWith('/')) { def files = findFiles glob: filepath if (files.length > 0) { return } else { error "There are no files/folders under the publishable item: ${filepath}" } } error "The publishable item: ${filepath} does not end in /** or / (for git sparse checkouts)" } // Generate a list of artifact files that are publishable to outside parties def generatelist(meta, publishable) { filelist = [] for (filepath in publishable) { if (filepath != meta.METAARTIFACTS) { allowed(filepath) } meta.addPublishable(filepath) } } return this;