From 4122bbf7fc8eaca494129dc65f3e380f331f6581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Maltoni?= Date: Fri, 26 Mar 2021 11:22:13 +0100 Subject: [PATCH] fix: add back deprecated mainClassName property waiting for fix from PR https://github.com/johnrengelman/shadow/pull/612 to be released in a new version of com.github.johnrengelman.shadow --- build.gradle.kts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index ce32e2f4..a00bb797 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { // Apply the application plugin to add support for building a CLI application // You can run your app via task "run": ./gradlew run application - + /* * Adds tasks to export a runnable jar. * In order to create it, launch the "shadowJar" task. @@ -42,6 +42,14 @@ dependencies { application { // Define the main class for the application. mainClass.set("it.unibo.sampleapp.App") + + /* + * mainClassName was deprecated by Gradle, but it is still required by John Engelman's Shadow plugin. + * A pull request with a fix was already merged, but it hasn't been released yet; + * see https://github.com/johnrengelman/shadow/issues/609 and https://github.com/johnrengelman/shadow/pull/612 + */ + @Suppress("DEPRECATION") + mainClassName = mainClass.get() } java {