I am creating a distribution zip containing a jar as an output to my gradle task. I am using plugin project for creating the task. Now, in my gradle project(where I use this plugin), I get the jar zip as output and I want to customize that zip file so that in the gradle project, the user can add stuff as per the requirement. This means if the user needs some other files in the zip file, he should be able to do so without changing the task in the plugin project. I have tried a few solutions available but nothing seems to work so well. I have tried
jar{
baseName = 'distZip’
from(‘src/main/jni/’){
include(‘VC*.h’)
into(‘includes’)
}
manifest {
attributes ‘Implementation-Title’: ‘Analytics Library’, ‘Implementation-Version’: version
}
Another solution :
sourceSets.main.resources{
from(‘src/main/jni/’){
include(‘VC*.h’)
into(‘includes’)
}
Also, I used distribution plugin:
/apply plugin: 'java-library-distribution’
version 1.0
distributions{
jar{
baseName='distZip’
contents{
from(‘src/main/jni/’) {
include('VC.h’)
into(‘includes’)
}
}
}
}
No solution seems to work till now. Any pointers