Skip to content

Commit

Permalink
Get rid of setupBinaryen
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgonmic authored and qodana-bot committed Nov 19, 2024
1 parent fb34090 commit 4f4b460
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
plugins {
`kotlin-dsl`
id("org.jetbrains.kotlin.jvm")
}

repositories {
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
mavenCentral()
gradlePluginPortal()

extra["bootstrapKotlinRepo"]?.let {
maven(url = it)
}
}

kotlin {
jvmToolchain(8)

compilerOptions {
allWarningsAsErrors.set(true)
}
}

dependencies {
compileOnly(kotlin("stdlib", embeddedKotlinVersion))
compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import org.jetbrains.kotlin.build.binaryen.BinaryenExtension
import org.jetbrains.kotlin.gradle.targets.js.binaryen.BinaryenRootPlugin

val binaryenRoot = BinaryenRootPlugin.apply(project.rootProject)

extensions.create<BinaryenExtension>(
"binaryenKotlinBuild",
binaryenRoot,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/

package org.jetbrains.kotlin.build.binaryen

import org.gradle.api.tasks.testing.Test
import org.jetbrains.kotlin.gradle.targets.js.binaryen.BinaryenRootExtension

abstract class BinaryenExtension(
private val binaryenRoot: BinaryenRootExtension
) {
fun Test.setupBinaryen() {
dependsOn(binaryenRoot.setupTaskProvider)
val binaryenExecutablePath = project.provider {
binaryenRoot.requireConfigured().executablePath.absolutePath
}
doFirst {
systemProperty("binaryen.path", binaryenExecutablePath.get())
}
}
}

This file was deleted.

3 changes: 2 additions & 1 deletion repo/gradle-build-conventions/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ include(":asm-deprecating-transformer")
include(":binary-compatibility-extended")
include(":gradle-plugins-documentation")
include(":gradle-plugins-common")
include(":d8-configuration")
include(":d8-configuration")
include(":binaryen-configuration")
7 changes: 5 additions & 2 deletions wasm/wasm.tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import org.gradle.internal.os.OperatingSystem
import java.net.URI
import com.github.gradle.node.npm.task.NpmTask
import org.jetbrains.kotlin.build.binaryen.BinaryenExtension
import org.jetbrains.kotlin.build.d8.D8Extension
import java.nio.file.Files
import java.util.*
Expand All @@ -10,6 +11,7 @@ plugins {
id("jps-compatible")
alias(libs.plugins.gradle.node)
id("d8-configuration")
id("binaryen-configuration")
}

node {
Expand Down Expand Up @@ -125,7 +127,6 @@ dependencies {
val generationRoot = projectDir.resolve("tests-gen")

useNodeJsPlugin()
useBinaryenPlugin()
optInToExperimentalCompilerApi()

sourceSets {
Expand Down Expand Up @@ -283,7 +284,9 @@ fun Project.wasmProjectTest(
setupV8()
}
setupNodeJs()
setupBinaryen()
with(project.the<BinaryenExtension>()) {
setupBinaryen()
}
setupSpiderMonkey()
setupWasmEdge()
useJUnitPlatform()
Expand Down

0 comments on commit 4f4b460

Please sign in to comment.