This library and Gradle plugin are able to read .ABOUT files.
or for internal use only and so on.
Maven has pom.xml
, which contains all this metadata. Gradle doesn’t.
In Gradle world a lot of build authors store metadata about their projects inside build script, using some plugins like nebula.contacts or org.kordamp.gradle.licensing.
The problem with this approach is that in order to get this metadata programmatically you have to run Gradle, let the project to be configured and read this configuration with some tricky script. Or to repeat yourself duplicating the same information somewhere else. Imagine that you need your CI to run specific stage IF the project is licensed under specific license. How would you accomplish that? Is your approach really efficient and DRY?
The other problem is that these Gradle plugins are mostly opinionated. There are no common practices.
Separate standardised .ABOUT file, in YAML format, is a solution. CI build can read it and know what it is building beforehand. Gradle build can read it and use the same metadata during build. Also YAML is simple enough so human users can read it too.
TODO
.ABOUT file can be used for both source code and binaries. For sources, filling some fields makes no sense.
The following table contains:
-
recommendations which .ABOUT fields should be set if .ABOUT file describes source code
-
usage by plugins (mappings to fields in plugins being integrated)
(prefix org.fidata.about.
is skipped from plugin IDs for brevity)
.ABOUT file field | jvm.maven-publish |
jvm.ivy-publish |
jvm.bintray |
nebula.contacts |
jvm.plugin-publish |
---|---|---|---|---|---|
|
Required. I recommend you to set it to |
||||
|
|
|
|
||
|
|
|
|
|
|
|
These fields don’t differentiate organizations from persons. Use |
||||
|
|||||
|
|||||
|
|||||
|
|||||
|
I recommend to set this |
||||
|
|||||
|
|
|
|||
|
|
|
|||
|
I recommend to set this |
||||
|
|
||||
|
|
||||
|
When SPDX-listed licenses are used then the information for these fields can (and should) be derived programmatically. In this case I don’t recommend to set them. DRY and SSOT |
||||
|
|||||
|
|||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
|
|||
|
|
||||
|
|
||||
|
|
|
aboutcode-toolkit | gradle-about-plugin | Notes/Reasoning |
---|---|---|
Handles all custom fields as |
|
|
Parses |
Has designated |
|
Requires some string fields to be single line |
Accepts multiline strings as well |
It is not mentioned in specification. We consider this as a bug in aboutcode-toolkit |
Validates .ABOUT content and returns list of found errors |
Just throws exception when something is not valid |
Use separate Gradle plugin and task to run |
Reads contents of TextFileFields |
Doesn’t read them |
There was no need |
Stores |
Doesn’t store |
|
Doesn’t validate |
Validates it |
|
Prohibits null values |
Currently allows null values |
Bug in Jackson FasterXML/jackson-databind#2024 |
Is able to read .ABOUT in Json and Csv formats as well |
Is not able to read them |
There was no need |
Is able to save (serialize) .ABOUT |
Is not able to save |
There was no need |
Keeps order of fields |
Generally, doesn’t keep order of fields (preserves order of string, file, URL and custom non-mapped fields, but all fields mapped to separate classes are parsed to separate Java class fields, which have no 'order') |
There was no need |