Build: Download webassembly wabt and test suite using configuration
This commit is contained in:
committed by
Space Team
parent
0d070f8ba9
commit
965b00549f
@@ -9481,6 +9481,26 @@
|
||||
<sha256 value="9aa9dfeb2e85e1d5e7932c87140697cecc2b0fadd933d679fd420a2e43831a82" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="webassembly" name="testsuite" version="18f8340">
|
||||
<artifact name="testsuite-18f8340.zip">
|
||||
<md5 value="d6ea2de35c54be9e8cfd74eebe475b62" origin="Generated by Gradle"/>
|
||||
<sha256 value="f6e0411ac90d2c09d2d120f7fe0b4bfa1f63b72a26088ce6802fc30bdd26633c" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="webassembly" name="wabt" version="1.0.19">
|
||||
<artifact name="wabt-1.0.19-macos.tar.gz">
|
||||
<md5 value="3439fb02f02897274f49683d9766c026" origin="Generated by Gradle"/>
|
||||
<sha256 value="ea462b9ef70a192ed01848f1914a34a1347b673c934c458457ef690fec96c224" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="wabt-1.0.19-ubuntu.tar.gz">
|
||||
<md5 value="8f08ed0c1c045e35214df841085d0830" origin="Generated by Gradle"/>
|
||||
<sha256 value="f209a2bc08415cc185cfb0915d02e0b55eeb2f390e59249b18c0a791cc03d3f1" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
<artifact name="wabt-1.0.19-windows.tar.gz">
|
||||
<md5 value="1e9c606e2a004e4af57e41cb42e1dcfb" origin="Generated by Gradle"/>
|
||||
<sha256 value="3c5b4785b0d4ad91aeeafbdff0424993ad62f9ee829838dba6419d89d6bcde3e" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="xerces" name="xercesImpl" version="2.12.0">
|
||||
<artifact name="xercesImpl-2.12.0.jar">
|
||||
<md5 value="b89632b53c4939a2982bcb52806f6dec" origin="Generated by Gradle"/>
|
||||
|
||||
@@ -1,8 +1,52 @@
|
||||
import java.net.URI
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
kotlin("plugin.serialization")
|
||||
id("de.undercouch.download")
|
||||
}
|
||||
|
||||
repositories {
|
||||
ivy {
|
||||
url = URI("https://github.com/webassembly/testsuite/zipball/")
|
||||
patternLayout {
|
||||
artifact("[revision]")
|
||||
}
|
||||
metadataSources { artifact() }
|
||||
content { includeModule("webassembly", "testsuite") }
|
||||
}
|
||||
|
||||
ivy {
|
||||
url = URI("https://github.com/webassembly/wabt/releases/download/")
|
||||
patternLayout {
|
||||
artifact("[revision]/[artifact]-[revision]-[classifier].[ext]")
|
||||
}
|
||||
metadataSources { artifact() }
|
||||
content { includeModule("webassembly", "wabt") }
|
||||
}
|
||||
}
|
||||
|
||||
val wabtDir = File(buildDir, "wabt")
|
||||
val wabtVersion = "1.0.19"
|
||||
val testSuiteRevision = "18f8340"
|
||||
val testSuiteDir = File(buildDir, "testsuite")
|
||||
|
||||
val gradleOs = org.gradle.internal.os.OperatingSystem.current()
|
||||
val wabtOS = when {
|
||||
gradleOs.isMacOsX -> "macos"
|
||||
gradleOs.isWindows -> "windows"
|
||||
gradleOs.isLinux -> "ubuntu"
|
||||
else -> error("Unsupported OS: $gradleOs")
|
||||
}
|
||||
|
||||
val wabt by configurations.creating {
|
||||
isCanBeResolved = true
|
||||
isCanBeConsumed = false
|
||||
}
|
||||
|
||||
val testSuite by configurations.creating {
|
||||
isCanBeResolved = true
|
||||
isCanBeConsumed = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -15,45 +59,28 @@ dependencies {
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-junit"))
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-serialization-json"))
|
||||
}
|
||||
|
||||
|
||||
val testSuiteRevision = "18f8340"
|
||||
val testSuiteDir = File(buildDir, "testsuite")
|
||||
val testSuiteZip = File(testSuiteDir, testSuiteRevision + ".zip")
|
||||
|
||||
val downloadTestSuite by task<de.undercouch.gradle.tasks.download.Download> {
|
||||
src("https://github.com/WebAssembly/testsuite/zipball/$testSuiteRevision")
|
||||
dest(testSuiteZip)
|
||||
overwrite(false)
|
||||
testSuite("webassembly:testsuite:$testSuiteRevision@zip")
|
||||
wabt("webassembly:wabt:$wabtVersion:$wabtOS@tar.gz")
|
||||
}
|
||||
|
||||
val unzipTestSuite by task<Copy> {
|
||||
dependsOn(downloadTestSuite)
|
||||
from(zipTree(downloadTestSuite.get().dest))
|
||||
dependsOn(testSuite)
|
||||
|
||||
from(provider {
|
||||
zipTree(testSuite.singleFile)
|
||||
})
|
||||
|
||||
into(testSuiteDir)
|
||||
}
|
||||
|
||||
val wabtDir = File(buildDir, "wabt")
|
||||
val wabtVersion = "1.0.19"
|
||||
|
||||
val downloadWabt by task<de.undercouch.gradle.tasks.download.Download> {
|
||||
val gradleOs = org.gradle.internal.os.OperatingSystem.current()
|
||||
val os = when {
|
||||
gradleOs.isMacOsX -> "macos"
|
||||
gradleOs.isWindows -> "windows"
|
||||
gradleOs.isLinux -> "ubuntu"
|
||||
else -> error("Unsupported OS: $gradleOs")
|
||||
}
|
||||
val fileName = "wabt-$wabtVersion-$os.tar.gz"
|
||||
src("https://github.com/WebAssembly/wabt/releases/download/$wabtVersion/$fileName")
|
||||
dest(File(wabtDir, fileName))
|
||||
overwrite(false)
|
||||
}
|
||||
|
||||
val unzipWabt by task<Copy> {
|
||||
dependsOn(downloadWabt)
|
||||
from(tarTree(resources.gzip(downloadWabt.get().dest)))
|
||||
dependsOn(wabt)
|
||||
|
||||
from(provider {
|
||||
tarTree(resources.gzip(wabt.singleFile))
|
||||
})
|
||||
|
||||
into(wabtDir)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user