n0mer / gradle-git-properties

Gradle plugin for `git.properties` file generation
https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties
Apache License 2.0
323 stars 55 forks source link

how can i put the properties file into the jar using johnrengelman shadowJar #216

Open joeleoli opened 2 years ago

joeleoli commented 2 years ago

so i'm trying to get the properties file into the jar with shadow jar but i have no clue how to do it. (the file ends up in the root directory of the project)

currently using this in my build.gradle:

gitProperties {
    keys = ["git.commit.id.abbrev", "git.commit.id", "git.branch"]

    gitPropertiesName = "app.properties"
    gitPropertiesResourceDir = file("${project.rootDir}/assets/properties")
}

shadowJar {
    exclude "**/*.kotlin_metadata"
    exclude "**/*.kotlin_builtins"
    exclude "kotlin/"
    exclude "META-INF/"

    archiveFileName = "orange.jar"
}

any help appreciated.