mockito / shipkit

Toolkit for shipping it used by Mockito library
http://shipkit.org
MIT License
158 stars 35 forks source link

Dependency-info format changed from json to txt #543

Closed wwilk closed 6 years ago

wwilk commented 6 years ago

I completely agree that we shouldn't parse dependency-info when comparing publications. The only problem is with these submodules dependencies.

I thought at the beginning to exclude them from dependency-info but you pointed out correctly that we are losing important information. Then I thought of removing it at the point of comparing publications, as proposed in #538 , but I had to parse JSON and additionally there was a problem with JSON ordering (since json-simple internally uses hash maps which don't guarantee order).

So I like the idea of using a different structure - let's go with a simple and concise txt format, similar to the one in which dependencies are declared.

About submodules I really like the idea of not saving the version if the submodule is in the same version as the project being built. This way there won't be a difference when comparing publications. Let's still keep the version if it's different though.

I also moved "createDependencyInfoFileTask" config from JavaLibrary to ComparePublicationsPlugin.

I tested it by running ./gradlew clean and then ./gradlew sourcesJar in shipkit-example.

Result for impl:

#description
This file was generated by Shipkit Gradle plugin. See http://shipkit.org.

#dependencies
#group : name : version @@@ extension : classifier : artifactName : type
org.mockito.shipkit-example : api
com.google.guava : guava : 20.0
wwilk commented 6 years ago

As discussed on Slack with @mockitoguy format changed to markdown with artifacts nested deeper than dependencies.

Here is an example output file from unit test (md so it's formatted below, click Edit to see the raw version):

Description

This file was generated by Shipkit Gradle plugin. It contains all declared dependencies of the project. See http://shipkit.org. The format of dependencies is: group:name:version Each of the dependencies may contain artifacts (more nested) formatted like: artifactName:classifier:type:extension

Dependencies