Bump Gradle Wrapper Neo to 0.2.0 (#6397)

This commit is contained in:
Glavo authored and GitHub committed 2026-07-14 00:06:56 +08:00
1 parent 8728c89093
commit a6f8659349
3 files changed
+21 -12

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ import org.jackhuang.hmcl.gradle.l10n.ParseLanguageSubtagRegistry
plugins { plugins {
id("checkstyle") id("checkstyle")
id("org.glavo.gradle-wrapper-neo") version "0.1.0" id("org.glavo.gradle-wrapper-neo") version "0.2.0"
} }
group = "org.jackhuang" group = "org.jackhuang"
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* Gradle Wrapper Neo single-file source distribution. * Gradle Wrapper Neo single-file source distribution.
* *
* This source file is part of Gradle Wrapper Neo 0.1.0. * This source file is part of Gradle Wrapper Neo 0.2.0.
* Documentation and updates: https://github.com/Glavo/gradle-wrapper-neo * Documentation and updates: https://github.com/Glavo/gradle-wrapper-neo
* *
* Place this file at gradle/wrapper/GradleWrapperNeo.java in a Gradle project. * Place this file at gradle/wrapper/GradleWrapperNeo.java in a Gradle project.
+19 -10
View File
@@ -157,19 +157,17 @@ function Resolve-JavacExecutable {
} }
function Find-AppHome { function Find-AppHome {
param([string] $LauncherHome) param(
[string] $LauncherHome,
[string] $WorkingDirectory
)
$launcherProperties = Join-Path $LauncherHome 'gradle\wrapper\gradle-wrapper.properties' $launcherProperties = Join-Path $LauncherHome 'gradle\wrapper\gradle-wrapper.properties'
if (Test-Path -LiteralPath $launcherProperties -PathType Leaf) { if (Test-Path -LiteralPath $launcherProperties -PathType Leaf) {
return $LauncherHome return $LauncherHome
} }
$currentLocation = Get-Location $searchDirectory = Get-Item -LiteralPath $WorkingDirectory
if ($currentLocation.Provider.Name -ne 'FileSystem') {
throw "The current location is not a file system directory: $currentLocation"
}
$searchDirectory = Get-Item -LiteralPath $currentLocation.Path
$searchStart = $searchDirectory.FullName $searchStart = $searchDirectory.FullName
while ($null -ne $searchDirectory) { while ($null -ne $searchDirectory) {
$propertiesFile = Join-Path $searchDirectory.FullName 'gradle\wrapper\gradle-wrapper.properties' $propertiesFile = Join-Path $searchDirectory.FullName 'gradle\wrapper\gradle-wrapper.properties'
@@ -224,7 +222,8 @@ function ConvertTo-WindowsCommandLineArgument {
function Invoke-NativeApplication { function Invoke-NativeApplication {
param( param(
[string] $Executable, [string] $Executable,
[string[]] $Arguments [string[]] $Arguments,
[string] $WorkingDirectory
) )
$quotedArguments = New-Object 'System.Collections.Generic.List[string]' $quotedArguments = New-Object 'System.Collections.Generic.List[string]'
@@ -235,6 +234,7 @@ function Invoke-NativeApplication {
$startInfo = New-Object Diagnostics.ProcessStartInfo $startInfo = New-Object Diagnostics.ProcessStartInfo
$startInfo.FileName = $Executable $startInfo.FileName = $Executable
$startInfo.Arguments = [string]::Join(' ', $quotedArguments.ToArray()) $startInfo.Arguments = [string]::Join(' ', $quotedArguments.ToArray())
$startInfo.WorkingDirectory = $WorkingDirectory
$startInfo.UseShellExecute = $false $startInfo.UseShellExecute = $false
$process = New-Object Diagnostics.Process $process = New-Object Diagnostics.Process
@@ -295,7 +295,13 @@ function Compile-WrapperSource {
function Invoke-GradleWrapper { function Invoke-GradleWrapper {
param([string[]] $GradleArguments) param([string[]] $GradleArguments)
$appHome = Find-AppHome -LauncherHome $script:LauncherHome $currentLocation = Get-Location
if ($currentLocation.Provider.Name -ne 'FileSystem') {
throw "The current location is not a file system directory: $currentLocation"
}
$workingDirectory = $currentLocation.ProviderPath
$appHome = Find-AppHome -LauncherHome $script:LauncherHome -WorkingDirectory $workingDirectory
$launcherWrapperDirectory = Join-Path $script:LauncherHome 'gradle\wrapper' $launcherWrapperDirectory = Join-Path $script:LauncherHome 'gradle\wrapper'
$projectSource = Join-Path $appHome 'gradle\wrapper\GradleWrapperNeo.java' $projectSource = Join-Path $appHome 'gradle\wrapper\GradleWrapperNeo.java'
if (Test-Path -LiteralPath $projectSource -PathType Leaf) { if (Test-Path -LiteralPath $projectSource -PathType Leaf) {
@@ -351,7 +357,10 @@ function Invoke-GradleWrapper {
} }
$javaArguments += $GradleArguments $javaArguments += $GradleArguments
$script:WrapperExitCode = Invoke-NativeApplication -Executable $javaExecutable -Arguments $javaArguments $script:WrapperExitCode = Invoke-NativeApplication `
-Executable $javaExecutable `
-Arguments $javaArguments `
-WorkingDirectory $workingDirectory
} }
try { try {