GoogleCloudPlatform / opentelemetry-operations-java

Apache License 2.0
73 stars 38 forks source link

Configures auto-exporter to publish shaded and non-shaded variants #235

Closed psx95 closed 1 year ago

psx95 commented 1 year ago

Supports #215

Currently, if gradle.properties have shadowed property set to true, then only shadowed variant is published, this change also configures the maven-publish plugin to publish normal Jar along with the shadow-jar.

The artifactId is currently set to be the archivesBaseName which based on current configuration for auto-exporter should contain the suffix - shaded.

Testing

META-INF/
META-INF/MANIFEST.MF
com/
com/google/
com/google/cloud/
com/google/cloud/opentelemetry/
com/google/cloud/opentelemetry/auto/
com/google/cloud/opentelemetry/auto/GoogleCloudMetricExporterFactory.java
com/google/cloud/opentelemetry/auto/Constants.java
com/google/cloud/opentelemetry/auto/GoogleCloudSpanExporterFactory.java

Verified that the sources and javadoc JARs are for the un-shaded variant.

psx95 commented 1 year ago

Can you verify if -srcs.jar and -javadoc.jar are generated appropriately for the raw component?

In the same location in the local .m2 repository, I can see exporter-auto-0.1.0-alpha-SNAPSHOT-javadoc.jar & exporter-auto-0.1.0-alpha-SNAPSHOT-sources.jar, looked at their contents and they looked appropriate. 

psx95 commented 1 year ago

One other thing that I suspect is a change required in how we determine if an artifact is release version here - Since the artifact ends with -shaded here this would result in false, but I am not sure about this.

Thoughts ?

punya commented 1 year ago

One other thing that I suspect is a change required in how we determine if an artifact is release version here - Since the artifact ends with -shaded here this would result in false, but I am not sure about this.

Thoughts ?

The artifact ends with -shaded but not the version (which is what that check cares about). I would guess that the logic doesn't need to be changed.