Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: CI

on:
pull_request:
branches:
- main
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
Expand All @@ -28,3 +26,23 @@ jobs:
gradle-home-cache-cleanup: true
validate-wrappers: true
- run: ./gradlew build

publish-snapshot:
needs: build
runs-on: ubuntu-latest
# I'll add github.ref == 'refs/heads/main' check before merging this PR.
if: github.repository == 'GradleUp/shadow'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true
# Disable CC due to https://github.com/gradle/gradle/issues/22779
- run: ./gradlew publish --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
tags:
- '**'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true
- run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Read the [User Guide](https://imperceptiblethoughts.com/shadow/)!

## Current Status

[![Download](https://img.shields.io/gradle-plugin-portal/v/com.github.johnrengelman.shadow)](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow)
[![Maven Central](https://img.shields.io/maven-central/v/com.gradleup.shadow/shadow-gradle-plugin)](https://central.sonatype.com/artifact/com.gradleup.shadow/shadow-gradle-plugin)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/com.gradleup.shadow/shadow-gradle-plugin?&server=https://s01.oss.sonatype.org/)](https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/GradleUp/shadow/shadow-gradle-plugin)
[![Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/com.gradleup.shadow)](https://plugins.gradle.org/plugin/com.gradleup.shadow)
[![CI](https://github.com/GradleUp/shadow/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/GradleUp/shadow/actions/workflows/ci.yml?query=branch:main+event:push)
[![License](https://img.shields.io/github/license/GradleUp/shadow.svg)](LICENSE)

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ plugins {
id 'project-report'
id 'idea'
id 'java-gradle-plugin'
id 'signing'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'org.ajoberstar.git-publish' version '4.2.2'
id 'com.github.node-gradle.node' version '7.0.2'
id 'com.vanniktech.maven.publish' version "0.29.0"
}

apply plugin: ShadowPlugin
Expand All @@ -32,7 +32,7 @@ tasks.withType(Test).configureEach {
maxHeapSize "1g"
}

systemProperty 'java.io.tmpdir', project.layout.buildDirectory.asFile.get().absolutePath
systemProperty 'shadowVersion', version

// Required to test configuration cache in tests when using withDebug()
// https://github.com/gradle/gradle/issues/22765#issuecomment-1339427241
Expand Down
27 changes: 26 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache=true


GROUP=com.gradleup.shadow
POM_ARTIFACT_ID=shadow-gradle-plugin
VERSION_NAME=8.3.0-SNAPSHOT

SONATYPE_AUTOMATIC_RELEASE=true
SONATYPE_HOST=DEFAULT

POM_NAME=Shadow Gradle Plugin
POM_DESCRIPTION=Gradle version of Maven's Shade plugin.
POM_INCEPTION_YEAR=2024
POM_URL=https://github.com/GradleUp/shadow

POM_LICENSE_NAME=The Apache Software License, Version 2.0
POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENSE_DIST=repo

POM_SCM_URL=https://github.com/GradleUp/shadow
POM_SCM_CONNECTION=scm:git:git://github.com/GradleUp/shadow.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/GradleUp/shadow.git

POM_DEVELOPER_ID=gradleup
POM_DEVELOPER_NAME=GradleUp developers
POM_DEVELOPER_URL=https://github.com/GradleUp
44 changes: 10 additions & 34 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,52 +1,28 @@
apply plugin: "com.gradle.plugin-publish"
apply plugin: "com.vanniktech.maven.publish"

group = 'com.github.johnrengelman'

if (System.env.CIRCLE_TAG && System.env.CIRCLE_TAG =~ /^\d\.\d\.\d$/) {
version = System.env.CIRCLE_TAG
} else {
version = file('src/main/resources/shadow-version.txt').text.trim()
if (!version.endsWith("-SNAPSHOT")) {
version = version + "-SNAPSHOT"
}
}
group = providers.gradleProperty("GROUP")
version = providers.gradleProperty("VERSION_NAME")

gradlePlugin {
website = 'https://github.com/johnrengelman/shadow'
vcsUrl = 'https://github.com/johnrengelman/shadow'
website = providers.gradleProperty("POM_URL")
vcsUrl = providers.gradleProperty("POM_URL")

plugins {
shadowPlugin {
id = 'com.github.johnrengelman.shadow'
id = 'com.gradleup.shadow'
implementationClass = 'com.github.jengelman.gradle.plugins.shadow.ShadowPlugin'
displayName = 'Shadow Plugin'
description = "Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin."
displayName = providers.gradleProperty("POM_NAME").orNull
description = providers.gradleProperty("POM_DESCRIPTION").orNull
tags.set(['onejar', 'shade', 'fatjar', 'uberjar'])
}
}
}

tasks.named('publishPlugins') {
doFirst {
if (version.endsWith("SNAPSHOT")) {
throw new GradleException('Cannot publish SNAPSHOT versions to Plugin Portal!')
}
}
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/21283")
}

signing {
if (System.env.CI == 'true') {
def encodedSigningKey = findProperty("signingKey")
def signingKey = encodedSigningKey ? new String(encodedSigningKey.decodeBase64()) : null
def signingPassword = findProperty("signingPassword") as String
useInMemoryPgpKeys(signingKey, signingPassword)
}
// See https://github.com/johnrengelman/shadow/pull/831#discussion_r1119012328
required = false && gradle.taskGraph.hasTask("artifactoryPublish")
sign(publishing.publications)
}

tasks.register('release') {
dependsOn tasks.named('assemble'), tasks.named('publishPlugins'), tasks.named('gitPublishPush')
mavenPublishing {
signAllPublications()
}
2 changes: 1 addition & 1 deletion src/docs/application-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ configured to contain the `Main-Class` attribute with the value specified in the
// Using Shadow with Application Plugin
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

application {
mainClass = 'myapp.Main'
Expand Down
2 changes: 1 addition & 1 deletion src/docs/changes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Instead, use the `enableRelocation = true` and `relocationPrefix = "<new package
}
}

apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "com.gradleup.shadow"
```

- [Cédric Champeau](https://github.com/melix) - Support Gradle 7 [#624](https://github.com/johnrengelman/shadow/pull/624)
Expand Down
6 changes: 3 additions & 3 deletions src/docs/getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```groovy no-plugins
plugins {
id 'com.github.johnrengelman.shadow' version '@version@'
id 'com.gradleup.shadow' version '@version@'
id 'java'
}
```
Expand All @@ -19,11 +19,11 @@ buildscript {
}
}

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'java'
```

**NOTE:** The correct maven coordinates for each version of Shadow can be found by referencing the Gradle Plugin documentation [here](https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow).
**NOTE:** The correct maven coordinates for each version of Shadow can be found by referencing the Gradle Plugin documentation [here](https://plugins.gradle.org/plugin/com.gradleup.shadow).

Shadow is a reactive plugin.
This means that applying Shadow by itself will perform no configuration on your project.
Expand Down
2 changes: 1 addition & 1 deletion src/docs/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A simple Gradle plugin can use this feature by applying the `shadow` plugin and
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id 'com.github.johnrengelman.shadow' version '@version@'
id 'com.gradleup.shadow' version '@version@'
id 'java'
}

Expand Down
2 changes: 1 addition & 1 deletion src/docs/publishing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publication with the necessary artifact and dependencies in the POM file.
// Publishing a Shadow JAR with the Maven-Publish Plugin
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

publishing {
publications {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/shadow-version.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ConfigurationCacheSpec extends PluginSpecification {
""".stripIndent()
file('server/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

shadowJar {
minimize {
Expand Down Expand Up @@ -148,7 +148,7 @@ class ConfigurationCacheSpec extends PluginSpecification {
""".stripIndent()
file('lib/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

repositories { maven { url "${repo.uri}" } }
dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class PublishingSpec extends PluginSpecification {

file('c/build.gradle') << """
plugins {
id 'com.github.johnrengelman.shadow'
id 'com.gradleup.shadow'
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class RelocationSpec extends PluginSpecification {
and: 'App project with shadow, relocation, and project dependency'
file('app/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

repositories { maven { url "${repo.uri}" } }
dependencies { implementation project(':core') }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('server/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

repositories { maven { url "${repo.uri}" } }
dependencies { implementation project(':client') }
Expand Down Expand Up @@ -242,7 +242,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('server/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

shadowJar {
minimize()
Expand Down Expand Up @@ -295,7 +295,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('server/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

shadowJar {
minimize {
Expand Down Expand Up @@ -348,7 +348,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('server/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

shadowJar {
minimize {
Expand Down Expand Up @@ -403,7 +403,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('server/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

shadowJar {
minimize {
Expand Down Expand Up @@ -456,7 +456,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('server/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

shadowJar {
minimize {
Expand Down Expand Up @@ -536,7 +536,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('impl/build.gradle') << """
apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

shadowJar {
minimize()
Expand Down Expand Up @@ -612,7 +612,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('impl/build.gradle') << """
apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

shadowJar {
minimize()
Expand Down Expand Up @@ -651,7 +651,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('client/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'
repositories { maven { url "${repo.uri}" } }
dependencies { implementation 'junit:junit:3.8.2' }

Expand Down Expand Up @@ -708,7 +708,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('client/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'
repositories { maven { url "${repo.uri}" } }
dependencies { implementation 'junit:junit:3.8.2' }

Expand All @@ -728,7 +728,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('server/build.gradle') << """
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

repositories { maven { url "${repo.uri}" } }
dependencies { implementation project(path: ':client', configuration: 'shadow') }
Expand Down Expand Up @@ -1023,7 +1023,7 @@ class ShadowPluginSpec extends PluginSpecification {

file('impl/build.gradle') << """
apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.gradleup.shadow'

version = '1.0'
repositories { maven { url "${repo.uri}" } }
Expand Down
Loading