Skip to content

Commit dbbceb9

Browse files
Reorganize doc navigations (#1340)
* Remove "Shadowing Gradle Plugins" * Update "Default Java/Kotlin/Groovy Tasks" * Update Gradle Plugins nav * Update docs/getting-started/README.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Merge introductions * Move introduction/README.md out * Compat image for GMF * Note "I" * Add myself into "Maintainers" --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent a6aff56 commit dbbceb9

File tree

7 files changed

+65
-69
lines changed

7 files changed

+65
-69
lines changed

docs/README.md

+53-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,59 @@
11
<div style="text-align: center;">
2-
<img src="images/logo.svg" alt="Shadow Gradle Plugin" style="max-width: 300px; height: auto;">
2+
<img src="images/logo.svg" alt="Shadow Gradle Plugin" width="300"/>
33
<h1><strong>Shadow Gradle Plugin</strong></h1>
4-
<p><em>The library author's dependency toolkit</em></p>
54
</div>
65

7-
---
6+
# Introduction
87

9-
Previously this plugin was developed by [@johnrengelman](https://github.com/johnrengelman) and published under the ID [
10-
`com.github.johnrengelman.shadow`](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow)
11-
before maintenance was transferred to the [GradleUp organization](https://github.com/GradleUp) to ensure future
12-
development, see [#908](https://github.com/GradleUp/shadow/issues/908).
8+
Shadow is a Gradle plugin for combining a project's dependency classes and resources into a single
9+
output Jar.
10+
The combined Jar is often referred to a _fat-jar_ or _uber-jar_.
11+
Shadow utilizes [`JarInputStream`](https://docs.oracle.com/javase/8/docs/api/java/util/jar/JarInputStream.html) and [`JarOutputStream`](https://docs.oracle.com/javase/8/docs/api/java/util/jar/JarOutputStream.html) to efficiently process dependent libraries
12+
into the output jar without incurring the I/O overhead of expanding the jars to disk.
1313

14-
If you are still using the old plugin ID in your build script, we recommend to switch to the new plugin ID [
15-
`com.gradleup.shadow`](https://plugins.gradle.org/plugin/com.gradleup.shadow)
16-
and update to the latest version to receive all the latest bug fixes and improvements.
14+
!!! warning "Plugin ID Change"
15+
16+
Previously this plugin was developed by [@johnrengelman](https://github.com/johnrengelman) and published under the ID [
17+
`com.github.johnrengelman.shadow`](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow)
18+
before maintenance was transferred to the [GradleUp organization](https://github.com/GradleUp) to ensure future
19+
development, see [#908](https://github.com/GradleUp/shadow/issues/908).
20+
21+
If you are still using the old plugin ID in your build script, we recommend to switch to the new plugin ID [
22+
`com.gradleup.shadow`](https://plugins.gradle.org/plugin/com.gradleup.shadow)
23+
and update to the latest version to receive all the latest bug fixes and improvements.
24+
25+
## Benefits of Shadow
26+
27+
Shadowing a project output has 2 major use cases:
28+
29+
1. Creating an _executable_ JAR distribution
30+
2. Bundling and relocating common dependencies in libraries to avoid classpath conflicts
31+
32+
### Executable Distributions
33+
34+
Executable distribution is the main use case for deploying an _application_ that can be executed/run in the runtime
35+
environment.
36+
In the case of Shadow, this is a single _uber_ or _fat_ JAR.
37+
The JAR file contains all the application code and dependent libraries to execute (not including the standard JVM
38+
libraries).
39+
The shadow JAR does **not** include the JRE itself.
40+
It must be available on the target system.
41+
42+
Executable JARs contain a JAR MANIFEST that specifies the application Main Class.
43+
This allows the application to be started with a single command:
44+
45+
```shell
46+
java -jar application-shadow.jar
47+
```
48+
49+
### Library Bundling
50+
51+
Dependency bundling and relocation is the main use case for _library_ authors.
52+
The goal of a bundled library is to create a pre-packaged dependency for other libraries or applications to utilize.
53+
Often in these scenarios, a library may contain a dependency that a downstream library or application also uses.
54+
In _some_ cases, different versions of this common dependency can cause an issue in either the upstream library or
55+
the downstream application.
56+
These issues often manifest themselves as binary incompatibilities in either the library or application code.
57+
58+
By utilizing Shadow's ability to _relocate_ the package names for dependencies, a library author can ensure that the
59+
library's dependencies will not conflict with the same dependency being declared by the downstream application.

docs/about/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# About This Project
22

3-
I started this project in December 2012. We were working on converting from a monolithic application into the
3+
I (John Engelman) started this project in December 2012. We were working on converting from a monolithic application into the
44
new hot jazz of "microservices" using Dropwizard.
55
I had also just started learning about Gradle and I knew that the incremental build system it provided would benefit
66
our development team greatly.
77
Unfortunately, the closest thing that Gradle had to Maven's Shade plugin was its ability to create application TARs and
88
ZIPs.
99

10-
So, Charlie Knudsen and I (John Engelman) set out to port the existing Shade code into a Gradle plugin.
10+
So, Charlie Knudsen and I set out to port the existing Shade code into a Gradle plugin.
1111
This port is what existed up until the `0.9` milestone releases for Shadow.
1212
It functioned, but it wasn't idiomatic Gradle by any means.
1313

@@ -19,6 +19,7 @@ so Shadow was published there.
1919
## Maintainers
2020

2121
* [John Engelman](https://github.com/johnrengelman)
22+
* [Goooler](https://github.com/Goooler)
2223

2324
## Contributors
2425

docs/getting-started/README.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,16 @@ Instead, Shadow _reacts_
116116
This means, that for most users, the `java` or `groovy` plugins must be _explicitly_ applied
117117
to have the desired effect.
118118

119-
## Default Java/Groovy Tasks
119+
## Default Java/Kotlin/Groovy Tasks
120120

121-
In the presence of the `java` or `groovy` plugins, Shadow will automatically configure the
122-
following behavior:
121+
In the presence of the `java`, `org.jetbrains.kotlin.jvm` or `groovy` plugins
122+
(that apply [JavaPlugin](https://docs.gradle.org/current/userguide/java_plugin.html) in their build logic),
123+
Shadow will automatically configure the following behavior:
123124

124125
* Adds a `shadowJar` task to the project.
125126
* Adds a `shadow` configuration to the project.
127+
* Adds a `shadow` variant to the project.
128+
* Adds a `shadow` component to the project.
126129
* Configures the `shadowJar` task to include all sources from the project's `main` sourceSet.
127130
* Configures the `shadowJar` task to bundle all dependencies from the `runtimeClasspath` configuration.
128131
* Configures the _classifier_ attribute of the `shadowJar` task to be `'all'` .
@@ -137,10 +140,3 @@ following behavior:
137140
* `META-INF/versions/**/module-info.class`
138141
* `module-info.class`
139142
* Creates and registers the `shadow` component in the project (used for integrating with `maven-publish`).
140-
141-
## Shadowing Gradle Plugins
142-
143-
Shadow ships with a companion task that can be used to automatically discover dependency packages and configure
144-
them for relocation. This is useful in projects if you want to relocate all dependencies.
145-
146-
For more details see the section [Using Shadow to Package Gradle Plugins](../plugins/README.md)
File renamed without changes.

docs/introduction/README.md

-43
This file was deleted.

docs/kotlin-plugins/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Shadow works well for Kotlin JVM projects like Java projects. Here is an example
4040
```
4141

4242
You can mix the Kotlin JVM plugin with `java-gradle-plugin`, `application`, and other Java plugins,
43-
easily organize your build logic for [Packaging Gradle Plugins](../plugins/README.md), [Publishing Libraries](../publishing/README.md),
43+
easily organize your build logic for [Packaging Gradle Plugins](../gradle-plugins/README.md), [Publishing Libraries](../publishing/README.md),
4444
[Running Applications](../application-plugin/README.md), and so on.
4545

4646
## For Kotlin Multiplatform Plugin

mkdocs.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ markdown_extensions:
5757
- md_in_html
5858

5959
nav:
60-
- 'Home': README.md
61-
- 'Introduction': introduction/README.md
60+
- 'Introduction': README.md
6261
- 'Getting Started': getting-started/README.md
6362
- 'Configuration':
6463
- 'Overview': configuration/README.md
@@ -74,7 +73,7 @@ nav:
7473
- 'Groovy and Scala Plugins': groovy-and-scala-plugins/README.md
7574
- 'Publishing': publishing/README.md
7675
- 'Multi-Project': multi-project/README.md
77-
- 'Plugins': plugins/README.md
76+
- 'Gradle Plugins': gradle-plugins/README.md
7877
- 'Changes': changes/README.md
7978
- 'API': api/index.html
8079
- 'About': about/README.md

0 commit comments

Comments
 (0)