-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polish outdated configs #831
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
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 '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()) | ||
} | ||
Comment on lines
-14
to
-17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
./gradlew assemble
diffuse diff --jar shadow-8.1.0-SNAPSHOT-before.jar shadow-8.1.0-SNAPSHOT-after.jar
OLD: shadow-8.1.0-SNAPSHOT-before.jar
NEW: shadow-8.1.0-SNAPSHOT-after.jar
JAR │ old │ new │ diff
───────┼───────────┼───────────┼──────
class │ 700.9 KiB │ 700.9 KiB │ 0 B
other │ 10.6 KiB │ 10.6 KiB │ 0 B
───────┼───────────┼───────────┼──────
total │ 711.5 KiB │ 711.5 KiB │ 0 B
CLASSES │ old │ new │ diff
─────────┼──────┼──────┼───────────
classes │ 146 │ 146 │ 0 (+0 -0)
methods │ 1813 │ 1813 │ 0 (+0 -0)
fields │ 746 │ 746 │ 0 (+0 -0) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This appears to have broken There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, so applying the Gradle Plugin plugin adds the And this is what this block was doing before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've read-ed this line in 8.1.1. I'm not sure if that affects the configuration caching in an way. |
||
|
||
apply plugin: ShadowPlugin | ||
|
||
apply from: file('gradle/docs.gradle') | ||
|
@@ -41,18 +37,10 @@ test { | |
systemProperty 'java.io.tmpdir', buildDir.absolutePath | ||
} | ||
|
||
// jar { | ||
// from rootProject.file('LICENSE') | ||
// from rootProject.file('NOTICE') | ||
// } | ||
|
||
// jar.enabled = false | ||
|
||
shadowJar { | ||
tasks.named('shadowJar', ShadowJar) { | ||
from rootProject.file('LICENSE') | ||
from rootProject.file('NOTICE') | ||
enableRelocation true | ||
// archiveClassifier = '' | ||
} | ||
|
||
idea { | ||
|
@@ -72,19 +60,3 @@ tasks.register('downloadDependencies', Exec) { | |
dependsOn configurations.testRuntimeClasspath | ||
commandLine 'echo', 'Downloaded all dependencies' | ||
} | ||
|
||
// tasks.named('build') { dependsOn tasks.named('shadowJar') } | ||
|
||
// tasks.withType(JavaCompile).configureEach { | ||
// // This will be the default in Gradle 5.0 | ||
// if (!options.compilerArgs.contains("-processor")) { | ||
// options.compilerArgs << '-proc:none' | ||
// } | ||
// } | ||
|
||
// tasks.withType(GroovyCompile).configureEach { | ||
// // This will be the default in Gradle 5.0 | ||
// if (!options.compilerArgs.contains("-processor")) { | ||
// options.compilerArgs << '-proc:none' | ||
// } | ||
// } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import org.codehaus.groovy.control.CompilerConfiguration | ||
|
||
apply plugin: 'groovy' | ||
plugins { | ||
id 'groovy' | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
|
@@ -52,17 +54,3 @@ sourceSets { | |
resources.srcDirs = ['../src/main/resources'] | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
// This will be the default in Gradle 5.0 | ||
if (!options.compilerArgs.contains("-processor")) { | ||
options.compilerArgs << '-proc:none' | ||
} | ||
} | ||
|
||
tasks.withType(GroovyCompile).configureEach { | ||
// This will be the default in Gradle 5.0 | ||
if (!options.compilerArgs.contains("-processor")) { | ||
options.compilerArgs << '-proc:none' | ||
} | ||
} | ||
Comment on lines
-56
to
-68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems we can remove these from |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,6 @@ if (System.env.CIRCLE_TAG && System.env.CIRCLE_TAG =~ /^\d\.\d\.\d$/) { | |
} | ||
} | ||
|
||
// tasks.configureEach { | ||
// if (name == "publishPluginJar" || name == "generateMetadataFileForPluginMavenPublication") { | ||
// dependsOn(tasks.named("shadowJar")) | ||
// } | ||
// } | ||
|
||
gradlePlugin { | ||
website = 'https://github.com/johnrengelman/shadow' | ||
vcsUrl = 'https://github.com/johnrengelman/shadow' | ||
|
@@ -41,21 +35,22 @@ tasks.named('publishPlugins') { | |
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") | ||
// useInMemoryPgpKeys(signingKey, signingPassword) | ||
// } | ||
// required = gradle.taskGraph.hasTask("artifactoryPublish") | ||
// sign(publishing.publications) | ||
// } | ||
|
||
// tasks.withType(Sign).configureEach { | ||
// notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13470") | ||
// } | ||
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") | ||
Comment on lines
+45
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disabled for now. |
||
sign(publishing.publications) | ||
} | ||
|
||
tasks.withType(Sign).configureEach { | ||
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13470") | ||
} | ||
|
||
tasks.register('release') { | ||
dependsOn 'assemble', 'publishPlugins', 'gitPublishPush' | ||
dependsOn tasks.named('assemble'), tasks.named('publishPlugins'), tasks.named('gitPublishPush') | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I will re-add
signing
asplugin-publish
supports it natively. I had turned this off when troubleshooting errors with publishing the 8.1.0 plugin.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll put it back, believe you just set
signing.required = false
will disable the sign tasks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#831 (comment)