-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edf7b9c
commit fb34090
Showing
18 changed files
with
117 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
repo/gradle-build-conventions/d8-configuration/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}") | ||
} |
25 changes: 25 additions & 0 deletions
25
repo/gradle-build-conventions/d8-configuration/src/main/kotlin/d8-configuration.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@file:OptIn(ExperimentalWasmDsl::class) | ||
|
||
import org.jetbrains.kotlin.build.d8.D8Extension | ||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl | ||
import org.jetbrains.kotlin.gradle.targets.js.d8.D8EnvSpec | ||
import org.jetbrains.kotlin.gradle.targets.js.d8.D8Plugin | ||
import org.jetbrains.kotlin.gradle.targets.js.d8.D8RootExtension | ||
|
||
project.plugins.apply(D8Plugin::class.java) | ||
val d8EnvSpec = project.the<D8EnvSpec>() | ||
project.rootProject.plugins.apply(D8Plugin::class.java) | ||
val d8Root = project.rootProject.the<D8RootExtension>() | ||
|
||
val d8KotlinBuild = extensions.create<D8Extension>( | ||
"d8KotlinBuild", | ||
d8EnvSpec, | ||
d8Root | ||
) | ||
|
||
with(d8KotlinBuild) { | ||
d8EnvSpec.version.set(project.v8Version) | ||
|
||
@Suppress("DEPRECATION") | ||
d8Root.version = project.v8Version | ||
} |
35 changes: 35 additions & 0 deletions
35
...conventions/d8-configuration/src/main/kotlin/org/jetbrains/kotlin/build/d8/D8Extension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
@file:OptIn(ExperimentalWasmDsl::class) | ||
|
||
package org.jetbrains.kotlin.build.d8 | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.tasks.testing.Test | ||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl | ||
import org.jetbrains.kotlin.gradle.targets.js.d8.D8EnvSpec | ||
import org.jetbrains.kotlin.gradle.targets.js.d8.D8RootExtension | ||
|
||
abstract class D8Extension( | ||
private val d8envSpec: D8EnvSpec, | ||
private val d8Root: D8RootExtension | ||
) { | ||
val Project.v8Version: String get() = property("versions.v8") as String | ||
|
||
fun Test.setupV8() { | ||
with(d8envSpec) { | ||
dependsOn(project.d8SetupTaskProvider) | ||
} | ||
dependsOn(d8Root.setupTaskProvider) | ||
val v8ExecutablePath = project.provider { | ||
d8Root.requireConfigured().executablePath.absolutePath | ||
} | ||
doFirst { | ||
systemProperty("javascript.engine.path.V8", v8ExecutablePath.get()) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.