GradleUp / GradleUp/shadow

Add original artifact name to `TransformerContext`

Open
#546 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Kotlin
Stars
4.2k
Forks
425
Avg merge
3h 52m
Merged PRs (30d)
88

Description

Shadow Version

5.2.0

Gradle Version

6.1.1

Currently TransformerContext only relative path. For some transformers it would be helpful to have not only relative path but original artifact name to base decisions on that.

In my case I want to merge some files in particular order when assembling uber-jar to allow overriding configuration values in current artifact to be last in the merge. It's similar to how current AppendingTransformer works but with deferred joining. Then with current project dependency tree I can topologically sort entries before actually merging them.

If you have some other ideas how to get the same result without extending transformer context I'm eager to listen.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating TransformerContext and the transformer API in the Shadow plugin, then trace how the current relative path is populated during artifact processing. The change is complete when transformers can access the original artifact name as well as the relative path, with behavior covered by the relevant transformer tests if they exist.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.