diff --git a/build.gradle.kts b/build.gradle.kts index 919221a8..aa30bb78 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,9 +2,9 @@ import org.jetbrains.intellij.platform.gradle.TestFrameworkType import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.security.MessageDigest import java.util.zip.ZipFile -import kotlin.io.path.pathString plugins { id("java") @@ -62,10 +62,7 @@ dependencies { intellijPlatform { intellijIdeaCommunity(libs.versions.intellij, useInstaller = !libs.versions.intellij.get().contains("SNAPSHOT")) bundledPlugins("org.intellij.intelliLang", "org.jetbrains.plugins.terminal") - bundledLibrary(provider { - // TODO[#340]: This is a workaround, remove in intellij-platform-gradle-plugin 2.2.2 - project.intellijPlatform.platformPath.resolve("lib/testFramework.jar").pathString - }) + testFramework(TestFrameworkType.Bundled) testFramework(TestFrameworkType.Platform) pluginVerifier() } @@ -151,7 +148,7 @@ tasks { sourceCompatibility = "17" targetCompatibility = "17" } - withType { + withType { dependsOn(generateLexer, generateParser) compilerOptions { @@ -175,16 +172,13 @@ tasks { } } - val verifyPsScriptAnalyzer by registering { - dependsOn(psScriptAnalyzer) + fun PrepareSandboxTask.unpackPsScriptAnalyzer(outDir: Provider) { + inputs.files(psScriptAnalyzer) inputs.property("hash", psScriptAnalyzerSha256Hash) + doFirst { psScriptAnalyzer.singleFile.verifyHash(psScriptAnalyzerSha256Hash) } - } - - fun PrepareSandboxTask.unpackPsScriptAnalyzer(outDir: Provider) { - dependsOn(psScriptAnalyzer, verifyPsScriptAnalyzer) from(zipTree(psScriptAnalyzer.singleFile)) { into(outDir.map { "$it/PSScriptAnalyzer" }) @@ -197,16 +191,12 @@ tasks { } } - val verifyPowerShellEditorServices by registering { - dependsOn(powerShellEditorServices) + fun PrepareSandboxTask.unpackPowerShellEditorServices(outDir: Provider) { + inputs.files(powerShellEditorServices) inputs.property("hash", psesSha256Hash) doFirst { powerShellEditorServices.singleFile.verifyHash(psesSha256Hash) } - } - - fun PrepareSandboxTask.unpackPowerShellEditorServices(outDir: Provider) { - dependsOn(powerShellEditorServices, verifyPowerShellEditorServices) from(zipTree(powerShellEditorServices.singleFile)) { into(outDir.map { "$it/" }) @@ -224,10 +214,15 @@ tasks { val maxUnpackedPluginBytes: String by project val verifyDistributionSize by registering { group = "verification" - dependsOn(buildPlugin) + + val pluginArtifact = buildPlugin.flatMap { it.archiveFile } + + inputs.file(pluginArtifact) + inputs.property("maxUnpackedPluginBytes", maxUnpackedPluginBytes) + outputs.upToDateWhen { true } doLast { - val artifact = buildPlugin.flatMap { it.archiveFile }.get().asFile + val artifact = pluginArtifact.get().asFile val unpackedSize = ZipFile(artifact).use { it.entries().asSequence().sumOf { e -> e.size } } val unpackedSizeMiB = "%.3f".format(unpackedSize / 1024.0 / 1024.0) if (unpackedSize > maxUnpackedPluginBytes.toLong()) { diff --git a/gradle.properties b/gradle.properties index 72cc4dcf..fa3a4b21 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,3 +10,5 @@ psScriptAnalyzerSha256Hash=E86C97D44BB1BC8A1DE35E753B85EA1D938F6F9F881639A181507 psesVersion=4.3.0 psesSha256Hash=CBE2F11F0076B05D44F148F0C7BBD38A3B30EEEAE99C45C6D0C309EDFF50136A + +org.gradle.caching=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136..9bbc975c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23a..37f853b1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index df396029..39e374c8 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -294,7 +296,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. diff --git a/gradlew.bat b/gradlew.bat index 279d4105..70b8b42f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ##########################################################################