Skip to content

Commit 84b3b09

Browse files
committed
Clean up code.
1 parent d1eb027 commit 84b3b09

File tree

4 files changed

+10
-282
lines changed

4 files changed

+10
-282
lines changed

buildSrc/src/main/kotlin/io/spine/internal/gradle/BuildCodegenPlugins.kt

Lines changed: 0 additions & 44 deletions
This file was deleted.

buildSrc/src/main/kotlin/io/spine/internal/gradle/RunCodegenPlugins.kt

Lines changed: 0 additions & 234 deletions
This file was deleted.

dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,4 +751,4 @@
751751

752752
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
753753

754-
This report was generated on **Wed Oct 16 13:20:29 EEST 2024** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
754+
This report was generated on **Wed Oct 16 13:41:22 EEST 2024** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).

gradle-plugin/src/main/kotlin/io/spine/chords/gradle/GradlePlugin.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import org.gradle.api.Plugin
3030
import org.gradle.api.Project
3131
import org.gradle.internal.os.OperatingSystem
3232
import java.io.File
33+
import java.lang.Thread.sleep
3334
import java.util.zip.ZipFile
3435

3536
/**
@@ -71,7 +72,7 @@ public class GradlePlugin : Plugin<Project> {
7172
/**
7273
* The millis to delay after run permission is set to Gradle wrapper.
7374
*/
74-
private const val delayAfterPermissionSet = 2000L
75+
private const val delayAfterRunPermissionSet = 2000L
7576
}
7677

7778
/**
@@ -135,7 +136,7 @@ public class GradlePlugin : Plugin<Project> {
135136
.command("chmod", "+x", "./gradlew")
136137
.directory(workspaceDir)
137138
.start()
138-
Thread.sleep(delayAfterPermissionSet)
139+
sleep(delayAfterRunPermissionSet)
139140
}
140141

141142
/**
@@ -175,8 +176,13 @@ public fun File.unzipTo(
175176
.forEach { entry ->
176177
File(destinationDir, entry.name).also { destinationFile ->
177178
destinationFile.parentFile.mkdirs()
179+
val inputStream = zipFile.getInputStream(entry)
178180
val outputStream = destinationFile.outputStream()
179-
zipFile.getInputStream(entry).copyTo(outputStream)
181+
inputStream.copyTo(outputStream)
182+
// The streams are closed directly because sometimes
183+
// the test can fail due to the Gradle wrapper executable
184+
// being locked by another process.
185+
inputStream.close()
180186
outputStream.close()
181187
}
182188
}

0 commit comments

Comments
 (0)