Accessing Native Binaries as a list for traversal


(Renato da Silveira) #1

Hey there.

To start I would like to say that I am not too familiar with Gradle at present, so any input in the matter will be appreciated.

I have been trying to access Binaries so that I could have them as a list that I could traverse, and use as the basis of my build.

I am trying to do something like this:
model{
components{
main(SharedLibraryBinarySpec){
binaries.all{
binaryName = getName()
println "============= ================ ================== [[[BINARY NAME]]] —> " + binaryName
}
}
}
}

Is there a way to access that part of the model in a build?

My target is to be able to so something like this:
a) Obtain Binary
b) get its name
c) get the project that it belongs to
d) get the task name that builds it
e) ensure that the necessary tasks that are required to build the libraries are called
f) add the native binaries to a distribution.

For the above I believe I would need to be able to traverse the list of binaries available.

Is any of this possible at all?

Again, any input in this matter will be highly appreciated.