Skip to content

Commit

Permalink
Update to Gradle 5 and start using properties for conventions when av…
Browse files Browse the repository at this point in the history
…ailable.
  • Loading branch information
John Engelman committed Jan 20, 2019
1 parent 62c4ecb commit 978d5d0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 14 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildscript {
}

plugins {
id 'com.gradle.build-scan' version '1.16'
id 'com.gradle.build-scan' version '2.1'
id 'groovy'
id 'project-report'
id 'idea'
Expand All @@ -35,8 +35,8 @@ gradlePlugin {
apply plugin: 'com.github.johnrengelman.shadow'

buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
if (System.env.CI == 'true') {
tag 'CI'
if (System.env.CIRCLE_TAG) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-rc-4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@

rootProject.name = 'shadow'
enableFeaturePreview('STABLE_PUBLISHING')
9 changes: 7 additions & 2 deletions src/docs/changes/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Change Log

## v4.0.4 (2018-11-21)
## v5.0.0 (Unreleased)
* Require Gradle 5.0+
* Fix issue with build classifier `-all` being dropped in Gradle 5.1+


## v4.0.4 (2019-01-19)
* When using `shadow`, `application`, and `maven` plugins together, remove `shadowDistZip` and `shadowDistTar` from
`configurations.archives` so they are not published or installed by default with the `uploadArchives` or `install`
tasks. [#347](https://github.com/johnrengelman/shadow/issues/347)
* [James Nelson](https://github.com/JamesXNelson) Fix `null` path when using Jar minimization and Gradle's `api` configuration. [#424](https://github.com/johnrengelman/shadow/issues/424), [#425](https://github.com/johnrengelman/shadow/issues/425)
* [James Nelson](https://github.com/JamesXNelson) - Fix `null` path when using Jar minimization and Gradle's `api` configuration. [#424](https://github.com/johnrengelman/shadow/issues/424), [#425](https://github.com/johnrengelman/shadow/issues/425)

## v4.0.3 (2018-11-21)
* [Mark Vieira](https://github.com/mark-vieira) - Don't leak plugin classes to Gradle's Spec cache [#430](https://github.com/johnrengelman/shadow/pull/430)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ShadowBasePlugin implements Plugin<Project> {

@Override
void apply(Project project) {
if (GradleVersion.current() < GradleVersion.version("4.0")) {
throw new GradleException("This version of Shadow supports Gradle 4.0+ only. Please upgrade.")
if (GradleVersion.current() < GradleVersion.version("5.0")) {
throw new GradleException("This version of Shadow supports Gradle 5.0+ only. Please upgrade.")
}
project.extensions.create(EXTENSION_NAME, ShadowExtension, project)
createShadowConfiguration(project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.gradle.api.plugins.MavenPlugin
import org.gradle.api.tasks.Upload
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.configuration.project.ProjectConfigurationActionContainer
import org.gradle.util.GradleVersion

import javax.inject.Inject

Expand Down Expand Up @@ -45,6 +46,9 @@ class ShadowJavaPlugin implements Plugin<Project> {
'all'
}
}
if (GradleVersion.current() >= GradleVersion.version("5.1")) {
shadow.archiveClassifier.set("all")
}
shadow.manifest.inheritFrom project.tasks.jar.manifest
shadow.doFirst {
def files = project.configurations.findByName(ShadowBasePlugin.CONFIGURATION_NAME).files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ class ShadowPluginSpec extends PluginSpecification {
assert output.exists()

where:
version << ['4.0', '4.1', '4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '4.10', '5.0-rc-4']
version << ['5.0', '5.1']
}

def 'Error in Gradle versions < 4.0'() {
def 'Error in Gradle versions < 5.0'() {
given:
GradleRunner versionRunner = GradleRunner.create()
.withGradleVersion('3.5')
.withGradleVersion('4.5')
.withArguments('--stacktrace')
.withProjectDir(dir.root)
.forwardOutput()
Expand Down Expand Up @@ -652,7 +652,6 @@ class ShadowPluginSpec extends PluginSpecification {
def "include java-library configurations by default"() {
given:
GradleRunner versionRunner = runner
.withGradleVersion('4.0')
.withArguments('--stacktrace')
.withDebug(true)

Expand Down Expand Up @@ -940,6 +939,7 @@ class ShadowPluginSpec extends PluginSpecification {
}

@Issue("SHADOW-303")
@Ignore("Plugin has been deprecated")
def "doesn't error when adding aspectj plugin"() {
given:
buildFile.text = """
Expand Down

0 comments on commit 978d5d0

Please sign in to comment.