Gradle - Include Properties File

前端 未结 9 1051
天命终不由人
天命终不由人 2020-12-08 04:13

How would I include a properties file in Gradle?

For example in Ant, I could do the following:



        
9条回答
  •  鱼传尺愫
    2020-12-08 04:30

    Here is how I include a .csv file in my .jar that Gradle builds:

    sourceSets {
      main {
        java {
          srcDir 'src/main/java'
          output.classesDir   = 'build/classes/main'      
        }
        resources {
          srcDir 'src/main/resources'
          include '*.csv'
          output.resourcesDir = 'build/resources/main'
        }
      }
    }
    

    Then, when my application loads the resource, that is done independently of Gradle.

提交回复
热议问题