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
12 changes: 4 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,9 @@ tasks.withType<Test>().configureEach {
// Required to test configuration cache in tests when using withDebug()
// https://github.com/gradle/gradle/issues/22765#issuecomment-1339427241
jvmArgs(
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens",
"java.base/java.net=ALL-UNNAMED",
"--add-opens=java.base/java.util=ALL-UNNAMED",
"--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED",
"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
"--add-opens=java.base/java.net=ALL-UNNAMED",
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ApplicationSpec extends PluginSpecification {
settingsFile << "rootProject.name = 'myapp'"

when:
BuildResult result = run('runShadow')
BuildResult result = runWithSuccess('runShadow')

then: 'tests that runShadow executed and exited'
assert result.output.contains('TestApp: Hello World! (foo)')
Expand Down Expand Up @@ -123,7 +123,7 @@ class ApplicationSpec extends PluginSpecification {
""".stripIndent()

when:
BuildResult result = run('runShadow')
BuildResult result = runWithSuccess('runShadow')

then: 'tests that runShadow executed and exited'
assert result.output.contains('Running application with JDK 17')
Expand Down Expand Up @@ -187,7 +187,7 @@ class ApplicationSpec extends PluginSpecification {
settingsFile << "rootProject.name = 'myapp'"

when:
run('shadowDistZip')
runWithSuccess('shadowDistZip')

then: 'Check that the distribution zip was created'
File zip = getFile('build/distributions/myapp-shadow-1.0.zip')
Expand Down Expand Up @@ -239,7 +239,7 @@ class ApplicationSpec extends PluginSpecification {
settingsFile << "rootProject.name = 'myapp'"

when:
run(ShadowApplicationPlugin.SHADOW_INSTALL_TASK_NAME)
runWithSuccess(ShadowApplicationPlugin.SHADOW_INSTALL_TASK_NAME)

then: 'Check that the proper jar file was installed'
File installedJar = getFile('build/install/myapp-shadow/lib/myapp-1.0-all.jar')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class ConfigurationCacheSpec extends PluginSpecification {
settingsFile << "rootProject.name = 'myapp'"

when:
run('shadowJar')
def result = run('shadowJar')
runWithSuccess('shadowJar')
def result = runWithSuccess('shadowJar')

then:
result.output.contains("Reusing configuration cache.")
Expand All @@ -68,9 +68,9 @@ class ConfigurationCacheSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')
output.delete()
def result = run('shadowJar')
def result = runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'b.properties'])
Expand Down Expand Up @@ -120,9 +120,9 @@ class ConfigurationCacheSpec extends PluginSpecification {
def output = getFile('server/build/libs/server-all.jar')

when:
run('shadowJar', '-s')
runWithSuccess('shadowJar', '-s')
output.delete()
def result = run('shadowJar', '-s')
def result = runWithSuccess('shadowJar', '-s')

then:
output.exists()
Expand Down Expand Up @@ -163,8 +163,8 @@ class ConfigurationCacheSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar', '-s')
def result = run('shadowJar', '-s')
runWithSuccess('shadowJar', '-s')
def result = runWithSuccess('shadowJar', '-s')

then:
result.output.contains(":lib:shadowJar UP-TO-DATE")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ConfigureShadowRelocationSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar', '-s')
runWithSuccess('shadowJar', '-s')

then:
contains(output, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FilteringSpec extends PluginSpecification {

def 'include all dependencies'() {
when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'a2.properties', 'b.properties'])
Expand All @@ -46,7 +46,7 @@ class FilteringSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'b.properties'])
Expand Down Expand Up @@ -80,7 +80,7 @@ class FilteringSpec extends PluginSpecification {
'''.stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'a2.properties', 'b.properties', 'c.properties'])
Expand Down Expand Up @@ -115,7 +115,7 @@ class FilteringSpec extends PluginSpecification {
'''.stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'a2.properties', 'b.properties', 'c.properties'])
Expand Down Expand Up @@ -149,7 +149,7 @@ class FilteringSpec extends PluginSpecification {
'''.stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'a2.properties', 'b.properties', 'c.properties'])
Expand All @@ -161,7 +161,7 @@ class FilteringSpec extends PluginSpecification {
buildFile.text = buildFile.text.replace('exclude(dependency(\'shadow:d:1.0\'))',
'exclude(dependency(\'shadow:c:1.0\'))')

BuildResult result = run('shadowJar')
BuildResult result = runWithSuccess('shadowJar')

then:
assert result.task(':shadowJar').outcome == TaskOutcome.SUCCESS
Expand Down Expand Up @@ -198,7 +198,7 @@ class FilteringSpec extends PluginSpecification {
'''.stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'a2.properties', 'b.properties', 'c.properties'])
Expand All @@ -213,7 +213,7 @@ class FilteringSpec extends PluginSpecification {
}
'''.stripIndent()

BuildResult result = run('shadowJar')
BuildResult result = runWithSuccess('shadowJar')

then:
assert result.task(':shadowJar').outcome == TaskOutcome.SUCCESS
Expand Down Expand Up @@ -253,7 +253,7 @@ class FilteringSpec extends PluginSpecification {
'''.stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['d.properties', 'shadow/Passed.class'])
Expand Down Expand Up @@ -305,7 +305,7 @@ class FilteringSpec extends PluginSpecification {
File serverOutput = getFile('server/build/libs/server-1.0-all.jar')

when:
run(':server:shadowJar')
runWithSuccess(':server:shadowJar')

then:
serverOutput.exists()
Expand Down Expand Up @@ -359,7 +359,7 @@ class FilteringSpec extends PluginSpecification {
File serverOutput = getFile('server/build/libs/server-1.0-all.jar')

when:
run(':server:shadowJar')
runWithSuccess(':server:shadowJar')

then:
serverOutput.exists()
Expand Down Expand Up @@ -387,7 +387,7 @@ class FilteringSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'b.properties'])
Expand Down Expand Up @@ -421,7 +421,7 @@ class FilteringSpec extends PluginSpecification {
'''.stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, ['a.properties', 'a2.properties', 'b.properties', 'c.properties'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PropertiesFileTransformerSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
assert output.exists()
Expand Down Expand Up @@ -87,7 +87,7 @@ class PropertiesFileTransformerSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
output.exists()
Expand Down Expand Up @@ -121,7 +121,7 @@ class PropertiesFileTransformerSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
output.exists()
Expand Down Expand Up @@ -158,7 +158,7 @@ class PropertiesFileTransformerSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
output.exists()
Expand Down Expand Up @@ -202,7 +202,7 @@ class PropertiesFileTransformerSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
output.exists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PublishingSpec extends PluginSpecification {
""".stripIndent()

when:
run('publish')
runWithSuccess('publish')

then:
File publishedFile = publishingRepo.rootDir.file('shadow/maven-all/1.0/maven-all-1.0.jar').canonicalFile
Expand Down Expand Up @@ -125,7 +125,7 @@ class PublishingSpec extends PluginSpecification {
""".stripIndent()

when:
run('publish')
runWithSuccess('publish')

then:
File publishedFile = publishingRepo.rootDir.file('shadow/maven-all/1.0/maven-all-1.0-my-classifier.my-ext').canonicalFile
Expand Down Expand Up @@ -206,7 +206,7 @@ class PublishingSpec extends PluginSpecification {
""".stripMargin()

when:
run('publish')
runWithSuccess('publish')

then:
File publishedFile = publishingRepo.rootDir.file('shadow/maven-all/1.0/maven-all-1.0.jar').canonicalFile
Expand Down Expand Up @@ -270,7 +270,7 @@ class PublishingSpec extends PluginSpecification {
""".stripIndent()

when:
run('publish')
runWithSuccess('publish')

then:
File mainJar = publishingRepo.rootDir.file('com/acme/maven/1.0/maven-1.0.jar').canonicalFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RelocationSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, [
Expand Down Expand Up @@ -95,7 +95,7 @@ class RelocationSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, [
Expand Down Expand Up @@ -158,7 +158,7 @@ class RelocationSpec extends PluginSpecification {
'''.stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, [
Expand Down Expand Up @@ -230,7 +230,7 @@ class RelocationSpec extends PluginSpecification {
'''.stripIndent()

when:
run(':app:shadowJar')
runWithSuccess(':app:shadowJar')

then:
File appOutput = getFile('app/build/libs/app-all.jar')
Expand Down Expand Up @@ -271,7 +271,7 @@ class RelocationSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
contains(output, [
Expand Down Expand Up @@ -316,7 +316,7 @@ class RelocationSpec extends PluginSpecification {
""".stripIndent()

when:
run('shadowJar')
runWithSuccess('shadowJar')

then:
noExceptionThrown()
Expand Down
Loading