Skip to content

Commit

Permalink
Merge branch 'master' into pr-793
Browse files Browse the repository at this point in the history
  • Loading branch information
John Engelman committed Feb 26, 2023
2 parents 9c0b051 + 98e666d commit a32da02
Show file tree
Hide file tree
Showing 69 changed files with 986 additions and 766 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defaults: &defaults
working_directory: ~/shadow
docker:
- image: circleci/openjdk:11-jdk
- image: cimg/openjdk:17.0
environment:
- TERM: "dumb"
- GRADLE_OPTS: "-Xmx1024m"
Expand Down
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto eol=lf

gradlew binary
gradlew.bat binary
14 changes: 12 additions & 2 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
name: "Validate Gradle Wrapper"
on: [push, pull_request]
on:
push:
paths:
- 'gradlew'
- 'gradlew.bat'
- 'gradle/wrapper/'
pull_request:
paths:
- 'gradlew'
- 'gradlew.bat'
- 'gradle/wrapper/'

jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ yarn-error.log
src/docs/.vuepress/dist/
.DS_Store
jd-gui.cfg
bin/
.vscode/
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ Read the [User Guide](https://imperceptiblethoughts.com/shadow/)!

| Gradle Version | Shadow Version |
|----------------|----------------|
| 5.x | 5.2.0 - 6.0.0 |
| 6.x | 5.2.0 - 6.1.0 |
| 7.x | 7.0.0+ |
| 5.x | 5.2.0 - 6.0.0 |
| 6.x | 5.2.0 - 6.1.0 |
| 7.x | 7.0.0+ |
| 8.x | 8.0.0+ |

**NOTE**: Shadow v5.+ is compatible with Gradle 5.x - 6.x and Java 7 - 15 _only_, v6.1.0+ requires Java 8+.
61 changes: 17 additions & 44 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,52 +1,23 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation

buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.16.0"
classpath 'org.ajoberstar:gradle-git-publish:3.0.0'
classpath "com.github.node-gradle:gradle-node-plugin:3.1.1"
}
}
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id 'groovy'
id 'project-report'
id 'idea'
id 'java-gradle-plugin'
id 'signing'
id 'com.gradle.plugin-publish' version '1.1.0'
id 'org.ajoberstar.git-publish' version '4.1.1'
id 'com.github.node-gradle.node' version '3.5.1'
}

// Remove the gradleApi so it isn't merged into the jar file.
configurations.named(JavaPlugin.API_CONFIGURATION_NAME) {
dependencies.remove(project.dependencies.gradleApi())
}

gradlePlugin {
automatedPublishing = false
}

apply plugin: 'com.github.johnrengelman.shadow'

buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
if (System.env.CI == 'true') {
tag 'CI'
if (System.env.CIRCLE_TAG) {
link 'VCS', "https://github.com/johnrengelman/shadow/tree/${System.env.CIRCLE_TAG}"
} else {
link 'VCS', "https://github.com/johnrengelman/shadow/tree/${System.env.CIRCLE_BRANCH}"
}
link 'VCS Commit', "https://github.com/johnrengelman/shadow/commit/${System.env.CIRCLE_SHA1}"
if (System.env.CI_PULL_REQUEST) {
link 'Pull Request', "${System.env.CI_PULL_REQUEST}"
}
}
}
apply plugin: ShadowPlugin

apply from: file('gradle/docs.gradle')
apply from: file('gradle/publish.gradle')
Expand Down Expand Up @@ -79,7 +50,7 @@ jar {
jar.enabled = false

shadowJar {
classifier = ''
archiveClassifier = ''
}

idea {
Expand All @@ -88,32 +59,34 @@ idea {
}
}

tasks.named('ideaModule') {
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13480")
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

task downloadDependencies(type: Exec) {
tasks.register('downloadDependencies', Exec) {
dependsOn configurations.testRuntimeClasspath
commandLine 'echo', 'Downloaded all dependencies'
}

tasks.build.dependsOn tasks.shadowJar
tasks.named('build') { dependsOn tasks.named('shadowJar') }

project.tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
// This will be the default in Gradle 5.0
if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs << '-proc:none'
}
}

project.tasks.withType(GroovyCompile) {
tasks.withType(GroovyCompile).configureEach {
// This will be the default in Gradle 5.0
if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs << '-proc:none'
}
}

task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
tasks.named('shadowJar', ShadowJar) {
enableRelocation true
}

tasks.shadowJar.dependsOn tasks.relocateShadowJar
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ sourceSets {
}
}

project.tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
// This will be the default in Gradle 5.0
if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs << '-proc:none'
}
}

project.tasks.withType(GroovyCompile) {
tasks.withType(GroovyCompile).configureEach {
// This will be the default in Gradle 5.0
if (!options.compilerArgs.contains("-processor")) {
options.compilerArgs << '-proc:none'
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.caching=true
org.gradle.unsafe.configuration-cache=true
24 changes: 12 additions & 12 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ dependencies {
shadow gradleApi()
shadow 'org.codehaus.groovy:groovy-backports-compat23:3.0.8'

implementation 'org.jdom:jdom2:2.0.6'
implementation 'org.ow2.asm:asm:9.3'
implementation 'org.ow2.asm:asm-commons:9.3'
implementation 'org.jdom:jdom2:2.0.6.1'
implementation 'org.ow2.asm:asm:9.4'
implementation 'org.ow2.asm:asm-commons:9.4'
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.apache.ant:ant:1.10.11'
implementation 'org.codehaus.plexus:plexus-utils:3.4.1'
implementation "org.apache.logging.log4j:log4j-core:2.17.1"
implementation('org.vafer:jdependency:2.7.0') {
implementation 'org.apache.ant:ant:1.10.13'
implementation 'org.codehaus.plexus:plexus-utils:3.5.0'
implementation "org.apache.logging.log4j:log4j-core:2.20.0"
implementation('org.vafer:jdependency:2.8.0') {
exclude group: 'org.ow2.asm'
}

testImplementation('org.spockframework:spock-core:2.0-groovy-3.0') {
testImplementation('org.spockframework:spock-core:2.3-groovy-3.0') {
exclude group: 'org.codehaus.groovy'
}
testImplementation 'org.spockframework:spock-junit4:2.0-groovy-3.0'
testImplementation 'org.spockframework:spock-junit4:2.3-groovy-3.0'
testImplementation 'xmlunit:xmlunit:1.6'
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
testImplementation 'com.google.guava:guava:31.0.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.8.1'
testImplementation 'com.google.guava:guava:31.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.9.2'
}
15 changes: 8 additions & 7 deletions gradle/docs.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
def javaApiUrl = 'http://docs.oracle.com/javase/1.7.0/docs/api'
def groovyApiUrl = "http://docs.groovy-lang.org/2.4.7/html/gapi/"
def javaApiUrl = 'https://docs.oracle.com/javase/17/docs/api'
def groovyApiUrl = "https://docs.groovy-lang.org/2.4.7/html/gapi/"

tasks.withType(Javadoc) {
tasks.withType(Javadoc).configureEach {
classpath += project.configurations.shadow
options.links(javaApiUrl, groovyApiUrl)
if (JavaVersion.current().java8Compatible) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
tasks.register('javadocJar', Jar) {
dependsOn javadoc
archiveClassifier.set('javadoc')
from 'build/docs/javadoc'
}

task sourcesJar(type: Jar) {
tasks.register('sourcesJar', Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}

project.tasks.groovydoc {
tasks.named('groovydoc') {
classpath += project.configurations.shadow
}

build.dependsOn javadocJar, sourcesJar
tasks.named('build') { dependsOn javadocJar, sourcesJar }
6 changes: 3 additions & 3 deletions gradle/ghPages.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'org.ajoberstar.git-publish'

if (project.hasProperty('githubToken')) {
System.setProperty('org.ajoberstar.grgit.auth.username', project.githubToken)
System.setProperty('org.ajoberstar.grgit.auth.username', project.githubToken)
}

gitPublish {
Expand All @@ -23,5 +23,5 @@ gitPublish {
}
}

tasks.gitPublishCopy.dependsOn yarn_build
tasks.gitPublishCopy.dependsOn groovydoc
tasks.named('gitPublishCopy') { dependsOn yarn_build }
tasks.named('gitPublishCopy') { dependsOn groovydoc }
Loading

0 comments on commit a32da02

Please sign in to comment.