DataDog / dd-sdk-android-gradle-plugin

The Datadog Gradle Plugin for Android
Apache License 2.0
14 stars 9 forks source link

Fix publishing #137

Closed 0xnm closed 1 year ago

0xnm commented 1 year ago

What does this PR do?

This change fixes publishing (I hope) which was broken as the result of the com.gradle.plugin-publish plugin version bump to 1.1.0. This new version auto-configures both signing and publishing (and this cannot be disabled).

So errors which were happening are:

Cannot perform signing task ':dd-sdk-android-gradle-plugin:signDd-sdk-android-gradle-pluginPluginMarkerMavenPublication' because it has no configured signatory

This was happening because com.gradle.plugin-publish does signing auto-configuration in the afterEvaluate and its afterEvaluate was executing earlier than we do signing configuration, so I moved signing configuration out of afterEvaluate.

Invalid publication 'pluginMaven': multiple artifacts with the identical extension and classifier ('jar', 'javadoc').

This was happening because auto-configuration also adds javadoc and sources jars, so I have to remove such definitions from our code. The only thing is that while sources is generated correctly with Kotlin classes, javadoc is only checking Java files (so javadoc jar is essentially empty). So to have a proper javadoc jar I had to override default javadocJar task so that it looks for the Dokka generated files.

Publishing at least to the Maven local works fine after these changes.

Review checklist (to be filled by reviewers)

codecov-commenter commented 1 year ago

Codecov Report

Merging #137 (188ec23) into release/1.6.0 (0810fa9) will not change coverage. The diff coverage is n/a.

@@               Coverage Diff                @@
##             release/1.6.0     #137   +/-   ##
================================================
  Coverage            86.25%   86.25%           
  Complexity             174      174           
================================================
  Files                   21       21           
  Lines                  560      560           
  Branches                72       72           
================================================
  Hits                   483      483           
  Misses                  49       49           
  Partials                28       28