Skip to content

Commit a246d62

Browse files
committed
support windows
1 parent c7b77a4 commit a246d62

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app/build.gradle.kts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,22 @@ tasks.register<Download>("downloadJDK") {
125125
"$imageType/" +
126126
"hotspot/normal/eclipse?project=jdk")
127127

128-
dest(layout.buildDirectory.file("jdk-$platform-$arch.tar.gz"))
128+
val extension = if (os.isWindows) "zip" else "tar.gz"
129+
dest(layout.buildDirectory.file("jdk-$platform-$arch.$extension"))
129130
overwrite(false)
130131
}
131132
tasks.register<Copy>("unzipJDK") {
132133
val dl = tasks.findByPath("downloadJDK") as Download
133134
dependsOn(dl)
134-
from(tarTree(dl.dest))
135+
136+
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
137+
val archive = if (os.isWindows) {
138+
zipTree(dl.dest)
139+
} else {
140+
tarTree(dl.dest)
141+
}
142+
143+
from(archive)
135144
into(layout.buildDirectory.dir("resources-bundled/common"))
136145
}
137146
afterEvaluate {

0 commit comments

Comments
 (0)