Feature variants (#376)

Migrate from buildSrc to build-logic. Setup feature variants.
This commit is contained in:
Edwin Jakobs
2025-09-17 01:03:02 -07:00
committed by GitHub
parent 2979963d3f
commit b7ba6f6daa
100 changed files with 424 additions and 326 deletions

View File

@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
}

View File

@@ -0,0 +1,24 @@
plugins {
`kotlin-dsl`
}
val preload: SourceSet by project.sourceSets.creating
repositories {
mavenCentral()
mavenLocal()
}
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
dependencies {
implementation(project(":orx-variant-plugin"))
implementation(libs.findLibrary("kotlin-gradle-plugin").get())
implementation(libs.findLibrary("dokka-gradle-plugin").get())
"preloadImplementation"(openrndr.application)
"preloadImplementation"(openrndr.orextensions)
}
kotlin {
compilerOptions {
freeCompilerArgs.add("-Xskip-metadata-version-check")
}
}
tasks.getByName("compileKotlin").dependsOn("compilePreloadKotlin")

View File

@@ -38,7 +38,7 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
@TaskAction @TaskAction
fun execute(inputChanges: InputChanges) { fun execute(inputChanges: InputChanges) {
val preloadClass = File(project.rootProject.projectDir, "buildSrc/build/classes/kotlin/preload") val preloadClass = File(project.rootProject.projectDir, "build-logic/orx-convention/build/classes/kotlin/preload")
require(preloadClass.exists()) { require(preloadClass.exists()) {
"preload class not found: '${preloadClass.absolutePath}'" "preload class not found: '${preloadClass.absolutePath}'"
} }

View File

@@ -6,8 +6,6 @@ import org.gradle.nativeplatform.MachineArchitecture
import org.gradle.nativeplatform.OperatingSystemFamily import org.gradle.nativeplatform.OperatingSystemFamily
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
data class JvmNativeVariant(val targetName: String, val os: String, val arch: String)
val currentOperatingSystemName: String = DefaultNativePlatform.getCurrentOperatingSystem().toFamilyName() val currentOperatingSystemName: String = DefaultNativePlatform.getCurrentOperatingSystem().toFamilyName()
val currentArchitectureName: String = DefaultNativePlatform.getCurrentArchitecture().name val currentArchitectureName: String = DefaultNativePlatform.getCurrentArchitecture().name

View File

@@ -0,0 +1,4 @@
package org.openrndr.extra.convention
addHostMachineAttributesToRuntimeConfigurations()

View File

@@ -1,9 +1,7 @@
package org.openrndr.extra.convention package org.openrndr.extra.convention
import ScreenshotsHelper.collectScreenshots import ScreenshotsHelper.collectScreenshots
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.kotlin.dsl.the
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.JvmTarget
@@ -11,7 +9,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
val sharedLibs = extensions.getByType(VersionCatalogsExtension::class.java).named("sharedLibs") val sharedLibs = extensions.getByType(VersionCatalogsExtension::class.java).named("sharedLibs")
val openrndr = extensions.getByType(VersionCatalogsExtension::class.java).named("openrndr") val openrndr = extensions.getByType(VersionCatalogsExtension::class.java).named("openrndr")
val libs = the<LibrariesForLibs>() val libs = extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
val shouldPublish = project.name !in setOf("openrndr-demos", "orx-git-archiver-gradle") val shouldPublish = project.name !in setOf("openrndr-demos", "orx-git-archiver-gradle")
@@ -34,10 +32,10 @@ repositories {
group = "org.openrndr.extra" group = "org.openrndr.extra"
val main: SourceSet by sourceSets.getting val main: SourceSet by project.sourceSets.getting
@Suppress("UNUSED_VARIABLE") @Suppress("UNUSED_VARIABLE")
val demo: SourceSet by sourceSets.creating { val demo: SourceSet by project.sourceSets.creating {
val skipDemos = setOf( val skipDemos = setOf(
"openrndr-demos", "openrndr-demos",
"orx-axidraw", "orx-axidraw",
@@ -60,13 +58,11 @@ dependencies {
testRuntimeOnly(sharedLibs.findLibrary("slf4j-simple").get()) testRuntimeOnly(sharedLibs.findLibrary("slf4j-simple").get())
"demoImplementation"(main.output.classesDirs + main.runtimeClasspath) "demoImplementation"(main.output.classesDirs + main.runtimeClasspath)
"demoImplementation"(openrndr.findLibrary("application").get()) "demoImplementation"(openrndr.findLibrary("application").get())
"demoImplementation"(libs.openrndr.extensions) "demoImplementation"(openrndr.findLibrary("orextensions").get())
if (DefaultNativePlatform.getCurrentOperatingSystem().isMacOsX) { "demoRuntimeOnly"(openrndr.findLibrary("gl3").get())
"demoRuntimeOnly"(libs.openrndr.gl3.natives.macos.arm64)
} "demoRuntimeOnly"(sharedLibs.findLibrary("slf4j-simple").get())
"demoRuntimeOnly"(libs.openrndr.gl3.core)
"demoRuntimeOnly"(sharedLibs.findLibrary("slf4j.simple").get())
} }
tasks { tasks {
@@ -88,11 +84,11 @@ tasks {
} }
withType<KotlinCompile> { withType<KotlinCompile> {
compilerOptions { compilerOptions {
jvmTarget.set(JvmTarget.valueOf("JVM_${libs.versions.jvmTarget.get()}")) jvmTarget.set(JvmTarget.valueOf("JVM_${libs.findVersion("jvmTarget").get().displayName.replace(".", "_")}"))
freeCompilerArgs.add("-Xexpect-actual-classes") freeCompilerArgs.add("-Xexpect-actual-classes")
freeCompilerArgs.add("-Xjdk-release=${libs.versions.jvmTarget.get()}") freeCompilerArgs.add("-Xjdk-release=${libs.findVersion("jvmTarget").get().displayName}")
apiVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.versions.kotlinApi.get().replace(".", "_")}")) apiVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.findVersion("kotlinApi").get().displayName.replace(".", "_")}"))
languageVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.versions.kotlinLanguage.get().replace(".", "_")}")) languageVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.findVersion("kotlinLanguage").get().displayName.replace(".", "_")}"))
} }
} }
} }
@@ -100,8 +96,8 @@ tasks {
java { java {
withJavadocJar() withJavadocJar()
withSourcesJar() withSourcesJar()
targetCompatibility = JavaVersion.valueOf("VERSION_${libs.versions.jvmTarget.get()}") targetCompatibility = JavaVersion.valueOf("VERSION_${libs.findVersion("jvmTarget").get().displayName}")
sourceCompatibility = JavaVersion.valueOf("VERSION_${libs.versions.jvmTarget.get()}") sourceCompatibility = JavaVersion.valueOf("VERSION_${libs.findVersion("jvmTarget").get().displayName}")
} }
val isReleaseVersion = !(version.toString()).endsWith("SNAPSHOT") val isReleaseVersion = !(version.toString()).endsWith("SNAPSHOT")

View File

@@ -1,7 +1,6 @@
package org.openrndr.extra.convention package org.openrndr.extra.convention
import CollectScreenshotsTask import CollectScreenshotsTask
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
@@ -11,7 +10,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
val libs = the<LibrariesForLibs>() val libs = extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
val sharedLibs = extensions.getByType(VersionCatalogsExtension::class.java).named("sharedLibs") val sharedLibs = extensions.getByType(VersionCatalogsExtension::class.java).named("sharedLibs")
val openrndr = extensions.getByType(VersionCatalogsExtension::class.java).named("openrndr") val openrndr = extensions.getByType(VersionCatalogsExtension::class.java).named("openrndr")
@@ -37,16 +36,16 @@ group = "org.openrndr.extra"
tasks.withType<KotlinCompilationTask<*>> { tasks.withType<KotlinCompilationTask<*>> {
compilerOptions { compilerOptions {
apiVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.versions.kotlinApi.get().replace(".", "_")}")) apiVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.findVersion("kotlinApi").get().displayName.replace(".", "_")}"))
languageVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.versions.kotlinLanguage.get().replace(".", "_")}")) languageVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.findVersion("kotlinLanguage").get().displayName.replace(".", "_")}"))
freeCompilerArgs.add("-Xexpect-actual-classes") freeCompilerArgs.add("-Xexpect-actual-classes")
} }
} }
tasks.withType<KotlinJvmCompile>().configureEach { tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions { compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(libs.versions.jvmTarget.get())) jvmTarget.set(JvmTarget.fromTarget(libs.findVersion("jvmTarget").get().displayName))
freeCompilerArgs.add("-Xjdk-release=${libs.versions.jvmTarget.get()}") freeCompilerArgs.add("-Xjdk-release=${libs.findVersion("jvmTarget").get().displayName}")
} }
} }
@@ -65,9 +64,8 @@ kotlin {
dependsOn(compileTaskProvider) dependsOn(compileTaskProvider)
} }
dependencies { dependencies {
if (DefaultNativePlatform.getCurrentOperatingSystem().isMacOsX) { runtimeOnly(openrndr.findLibrary("gl3").get())
runtimeOnly(libs.openrndr.gl3.natives.macos.arm64)
}
} }
} }
} }
@@ -91,14 +89,14 @@ kotlin {
sourceSets { sourceSets {
val commonMain by getting { val commonMain by getting {
dependencies { dependencies {
implementation(libs.kotlin.stdlib) implementation(libs.findLibrary("kotlin-stdlib").get())
implementation(sharedLibs.findLibrary("kotlin-logging").get()) implementation(sharedLibs.findLibrary("kotlin-logging").get())
} }
} }
val commonTest by getting { val commonTest by getting {
dependencies { dependencies {
implementation(libs.kotlin.test) implementation(libs.findLibrary("kotlin-test").get())
} }
} }
@@ -113,7 +111,7 @@ kotlin {
dependencies { dependencies {
implementation(openrndr.findLibrary("application").get()) implementation(openrndr.findLibrary("application").get())
implementation(openrndr.findLibrary("orextensions").get()) implementation(openrndr.findLibrary("orextensions").get())
runtimeOnly(libs.openrndr.gl3.core) runtimeOnly(openrndr.findLibrary("gl3").get())
runtimeOnly(sharedLibs.findLibrary("slf4j-simple").get()) runtimeOnly(sharedLibs.findLibrary("slf4j-simple").get())
} }
} }

View File

@@ -0,0 +1,5 @@
package org.openrndr.extra.convention
plugins {
id("orx-variant")
}

View File

@@ -0,0 +1,17 @@
plugins {
`kotlin-dsl`
}
repositories {
mavenCentral()
}
gradlePlugin {
plugins {
create("orxVariants") {
id = "orx-variant"
implementationClass = "org.openrndr.extra.variant.plugin.VariantPlugin"
}
}
}

View File

@@ -0,0 +1,169 @@
package org.openrndr.extra.variant.plugin
import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.attributes.Attribute
import org.gradle.api.attributes.Bundling
import org.gradle.api.attributes.Category
import org.gradle.api.attributes.LibraryElements
import org.gradle.api.attributes.Usage
import org.gradle.api.attributes.java.TargetJvmVersion
import org.gradle.api.component.AdhocComponentWithVariants
import org.gradle.api.model.ObjectFactory
import org.gradle.api.plugins.jvm.JvmComponentDependencies
import org.gradle.api.tasks.Nested
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.TaskContainer
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.named
import org.gradle.language.jvm.tasks.ProcessResources
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import javax.inject.Inject
fun arch(arch: String = System.getProperty("os.arch")): String {
return when (arch) {
"x86-64", "x86_64", "amd64" -> "x86-64"
"arm64", "aarch64" -> "aarch64"
else -> error("unsupported arch $arch")
}
}
abstract class VariantContainer @Inject constructor(
@Inject val tasks: TaskContainer,
val apiElements: Configuration,
val runtimeElements: Configuration,
val sourceSet: SourceSet
) {
@Nested
abstract fun getDependencies(): JvmComponentDependencies
fun Dependency.withClassifier(classifier: String): String {
return "$group:$name:$version:$classifier"
}
/**
* Setup dependencies for this variant.
*/
fun dependencies(action: Action<in JvmComponentDependencies>) {
action.execute(getDependencies())
}
/**
* Specify that this variant comes with a resource bundle.
*/
fun jar(action: Action<Unit>) {
sourceSet.resources.srcDirs.add(sourceSet.java.srcDirs.first().parentFile.resolve("resources"))
sourceSet.resources.includes.add("**/*.*")
tasks.named<Jar>(sourceSet.jarTaskName).configure {
include("**/*.*")
dependsOn(tasks.named<ProcessResources>(sourceSet.processResourcesTaskName))
manifest {
//this.attributes()
}
this.from(sourceSet.resources.srcDirs)
}
runtimeElements.outgoing.artifact(tasks.named(sourceSet.jarTaskName))
action.execute(Unit)
}
}
abstract class VariantExtension(
@Inject val objectFactory: ObjectFactory,
@Inject val project: Project
) {
fun platform(os: String, arch: String, f: VariantContainer.() -> Unit) {
val sourceSets = project.extensions.getByType(SourceSetContainer::class.java)
val sourceSetArch = arch.replace("-", "_")
val nameMain = "${os}${sourceSetArch.capitalize()}Main"
val platformMain = sourceSets.create(nameMain)
val tasks = project.tasks
tasks.register(platformMain.jarTaskName, Jar::class.java) {
archiveClassifier.set("$os-$arch")
}
val configurations = project.configurations
val objects = project.objects
val main = sourceSets.getByName("main")
val mainApi = configurations.getByName(main.apiElementsConfigurationName)
val mainRuntimeOnly = configurations.getByName(main.runtimeElementsConfigurationName)
mainApi.attributes {
val osAttribute = Attribute.of("org.gradle.native.operatingSystem", String::class.java)
attribute(osAttribute, "do_not_use_me")
}
val platformMainRuntimeElements = configurations.create(platformMain.runtimeElementsConfigurationName) {
extendsFrom(mainRuntimeOnly, mainApi)
isCanBeResolved = false
isCanBeConsumed = true
val osAttribute = Attribute.of("org.gradle.native.operatingSystem", String::class.java)
val archAttribute = Attribute.of("org.gradle.native.architecture", String::class.java)
val typeAttribute = Attribute.of("org.jetbrains.kotlin.platform.type", String::class.java)
val environmentAttribute = Attribute.of("org.gradle.jvm.environment", String::class.java)
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
attribute(osAttribute, os)
attribute(archAttribute, arch)
attribute(typeAttribute, "jvm")
attribute(environmentAttribute, "standard-jvm")
}
outgoing.artifact(tasks.named(main.jarTaskName))
outgoing.artifact(tasks.named(platformMain.jarTaskName))
}
val javaComponent = project.components.getByName("java") as AdhocComponentWithVariants
javaComponent.addVariantsFromConfiguration(platformMainRuntimeElements) {
platformMain.runtimeClasspath.files.add(platformMain.resources.srcDirs.first())
}
val variantContainer = objectFactory.newInstance(
VariantContainer::class.java,
platformMainRuntimeElements,
platformMainRuntimeElements,
platformMain
)
variantContainer.f()
platformMainRuntimeElements.dependencies.addAll(variantContainer.getDependencies().runtimeOnly.dependencies.get())
/*
Setup dependencies for current platform. This will make in-module tests and demos work.
*/
val currentOperatingSystemName: String = DefaultNativePlatform.getCurrentOperatingSystem().toFamilyName()
val currentArchitectureName: String = arch()
if (currentOperatingSystemName == os && currentArchitectureName == arch) {
project.dependencies {
add("testRuntimeOnly", platformMain.output)
add("demoRuntimeOnly", platformMain.output)
for (i in platformMainRuntimeElements.dependencies) {
add("testRuntimeOnly", i)
add("demoRuntimeOnly", i)
}
}
}
}
}
class VariantPlugin : Plugin<Project> {
override fun apply(target: Project) {
val project = target
project.extensions.create("variants", VariantExtension::class.java)
}
}

View File

@@ -1,3 +1,5 @@
include("orx-convention", "orx-variant-plugin")
dependencyResolutionManagement { dependencyResolutionManagement {
repositories { repositories {
mavenCentral() mavenCentral()

View File

@@ -1,27 +0,0 @@
plugins {
`kotlin-dsl`
// alias(sha)
}
val preload: SourceSet by sourceSets.creating
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation(libs.kotlin.gradle.plugin)
implementation(libs.dokka.gradle.plugin)
implementation(libs.kotlin.serialization.gradle.plugin)
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
"preloadImplementation"(openrndr.application)
"preloadImplementation"(libs.openrndr.extensions)
}
kotlin {
compilerOptions {
freeCompilerArgs.add("-Xskip-metadata-version-check")
}
}
tasks.getByName("compileKotlin").dependsOn("compilePreloadKotlin")

View File

@@ -1,46 +0,0 @@
package org.openrndr.extra.convention
import org.gradle.api.artifacts.CacheableRule
import org.gradle.api.artifacts.ComponentMetadataContext
import org.gradle.api.artifacts.ComponentMetadataRule
import org.gradle.api.model.ObjectFactory
import org.gradle.kotlin.dsl.named
import org.gradle.nativeplatform.MachineArchitecture
import org.gradle.nativeplatform.OperatingSystemFamily
import javax.inject.Inject
@CacheableRule
abstract class FFmpegRule : ComponentMetadataRule {
val jvmNativeVariants: List<JvmNativeVariant> = listOf(
JvmNativeVariant("linux-arm64", OperatingSystemFamily.LINUX, "aarch64"),
JvmNativeVariant("linux-arm64", OperatingSystemFamily.LINUX, "arm64-v8"),
JvmNativeVariant("linux-x86_64", OperatingSystemFamily.LINUX, "x86-64"),
JvmNativeVariant("macosx-arm64", OperatingSystemFamily.MACOS, "aarch64"),
JvmNativeVariant("macosx-arm64", OperatingSystemFamily.MACOS, "arm64-v8"),
JvmNativeVariant("macosx-x86_64", OperatingSystemFamily.MACOS, "x86-64"),
JvmNativeVariant("windows-x86_64", OperatingSystemFamily.WINDOWS, "x86-64")
)
@get:Inject
abstract val objects: ObjectFactory
override fun execute(context: ComponentMetadataContext) = context.details.run {
withVariant("runtime") {
attributes {
attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named("none"))
attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named("none"))
}
}
for ((targetName, os, arch) in jvmNativeVariants) {
addVariant("$targetName-$arch-runtime", "runtime") {
attributes {
attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named(os))
attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named(arch))
}
withFiles {
addFile("${id.name}-${id.version}-$targetName.jar")
}
}
}
}
}

View File

@@ -1,48 +0,0 @@
package org.openrndr.extra.convention
import org.gradle.api.artifacts.CacheableRule
import org.gradle.api.artifacts.ComponentMetadataContext
import org.gradle.api.artifacts.ComponentMetadataRule
import org.gradle.api.model.ObjectFactory
import org.gradle.kotlin.dsl.named
import org.gradle.nativeplatform.MachineArchitecture
import org.gradle.nativeplatform.OperatingSystemFamily
import javax.inject.Inject
@CacheableRule
abstract class LwjglRule : ComponentMetadataRule {
val jvmNativeVariants: List<JvmNativeVariant> = listOf(
JvmNativeVariant("natives-linux-arm64", OperatingSystemFamily.LINUX, "aarch64"),
JvmNativeVariant("natives-linux-arm64", OperatingSystemFamily.LINUX, "arm64-v8"),
JvmNativeVariant("natives-linux", OperatingSystemFamily.LINUX, "x86-64"),
JvmNativeVariant("natives-macos-arm64", OperatingSystemFamily.MACOS, "aarch64"),
JvmNativeVariant("natives-macos-arm64", OperatingSystemFamily.MACOS, "arm64-v8"),
JvmNativeVariant("natives-macos", OperatingSystemFamily.MACOS, "x86-64"),
JvmNativeVariant("natives-windows", OperatingSystemFamily.WINDOWS, "x86-64")
)
@get:Inject
abstract val objects: ObjectFactory
override fun execute(context: ComponentMetadataContext) = context.details.run {
if (id.group != "org.lwjgl") return
if (id.name == "lwjgl-egl") return
withVariant("runtime") {
attributes {
attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named("none"))
attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named("none"))
}
}
for ((targetName, os, arch) in jvmNativeVariants) {
addVariant("$targetName-$arch-runtime", "runtime") {
attributes {
attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named(os))
attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named(arch))
}
withFiles {
addFile("${id.name}-${id.version}-$targetName.jar")
}
}
}
}
}

View File

@@ -1,11 +0,0 @@
package org.openrndr.extra.convention
addHostMachineAttributesToRuntimeConfigurations()
dependencies {
components {
all<LwjglRule>()
withModule<FFmpegRule>("org.bytedeco:javacpp")
withModule<FFmpegRule>("org.bytedeco:ffmpeg")
}
}

View File

@@ -39,10 +39,6 @@ mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk"}
processing-core = { group = "org.processing", name = "core", version.ref = "processing"} processing-core = { group = "org.processing", name = "core", version.ref = "processing"}
openrndr-extensions = { group = "org.openrndr", name = "openrndr-extensions", version.ref = "openrndr" }
openrndr-gl3-core = { group = "org.openrndr", name = "openrndr-gl3", version.ref = "openrndr" }
openrndr-gl3-natives-macos-arm64 = { group = "org.openrndr", name = "openrndr-gl3-natives-macos-arm64", version.ref = "openrndr" }
boofcv = { group = "org.boofcv", name = "boofcv-core", version.ref = "boofcv" } boofcv = { group = "org.boofcv", name = "boofcv-core", version.ref = "boofcv" }
libfreenect = { group = "org.bytedeco", name = "libfreenect", version.ref = "libfreenect" } libfreenect = { group = "org.bytedeco", name = "libfreenect", version.ref = "libfreenect" }
librealsense = { group = "org.bytedeco", name = "librealsense2", version.ref = "librealsense" } librealsense = { group = "org.bytedeco", name = "librealsense2", version.ref = "librealsense" }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,10 +1,7 @@
@Suppress("DSL_SCOPE_VIOLATION") @Suppress("DSL_SCOPE_VIOLATION")
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
// kotlinx-serialization ends up on the classpath through openrndr-math and Gradle doesn't know which alias(libs.plugins.kotlin.serialization)
// version was used. If openrndr were an included build, we probably wouldn't need to do this.
// https://github.com/gradle/gradle/issues/20084
id(libs.plugins.kotlin.serialization.get().pluginId)
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -1,9 +1,6 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
// kotlinx-serialization ends up on the classpath through openrndr-math and Gradle doesn't know which alias(libs.plugins.kotlin.serialization)
// version was used. If openrndr were an included build, we probably wouldn't need to do this.
// https://github.com/gradle/gradle/issues/20084
id(libs.plugins.kotlin.serialization.get().pluginId)
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,9 +1,6 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
// kotlinx-serialization ends up on the classpath through openrndr-math and Gradle doesn't know which alias(libs.plugins.kotlin.serialization)
// version was used. If openrndr were an included build, we probably wouldn't need to do this.
// https://github.com/gradle/gradle/issues/20084
id(libs.plugins.kotlin.serialization.get().pluginId)
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -2,7 +2,7 @@ import com.strumenta.antlrkotlin.gradle.AntlrKotlinTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
alias(libs.plugins.antlr.kotlin) alias(libs.plugins.antlr.kotlin)
} }

View File

@@ -1,6 +1,6 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
id(libs.plugins.kotlin.serialization.get().pluginId) alias(libs.plugins.kotlin.serialization)
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
val embedShaders = tasks.register<EmbedShadersTask>("embedShaders") { val embedShaders = tasks.register<EmbedShadersTask>("embedShaders") {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,3 +1,3 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
val embedShaders = tasks.register<EmbedShadersTask>("embedShaders") { val embedShaders = tasks.register<EmbedShadersTask>("embedShaders") {

View File

@@ -1,3 +1,3 @@
plugins { plugins {
org.openrndr.extra.convention.dokka id("org.openrndr.extra.convention.dokka")
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
`java-gradle-plugin` `java-gradle-plugin`
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {
api(project(":orx-depth-camera")) api(project(":orx-depth-camera"))

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {
@@ -9,6 +9,6 @@ dependencies {
implementation(project(":orx-jvm:orx-depth-camera-calibrator")) implementation(project(":orx-jvm:orx-depth-camera-calibrator"))
implementation(project(":orx-fx")) implementation(project(":orx-fx"))
implementation(project(":orx-jvm:orx-gui")) implementation(project(":orx-jvm:orx-gui"))
runtimeOnly(project(":orx-jvm:orx-kinect-v1-${(gradle as ExtensionAware).extra["openrndrClassifier"]}")) runtimeOnly(project(":orx-jvm:orx-kinect-v1"))
runtimeOnly(libs.openrndr.gl3.core) runtimeOnly(openrndr.gl3)
} }

View File

@@ -1,6 +0,0 @@
plugins {
org.openrndr.extra.convention.`kotlin-jvm`
}
dependencies {
runtimeOnly(variantOf(libs.libfreenect) { classifier("linux-arm64") })
}

View File

@@ -1,6 +0,0 @@
plugins {
org.openrndr.extra.convention.`kotlin-jvm`
}
dependencies {
runtimeOnly(variantOf(libs.libfreenect) { classifier("linux-x86_64") })
}

View File

@@ -1,6 +0,0 @@
plugins {
org.openrndr.extra.convention.`kotlin-jvm`
}
dependencies {
runtimeOnly(variantOf(libs.libfreenect) { classifier("macosx-x86_64") })
}

View File

@@ -1,6 +0,0 @@
plugins {
org.openrndr.extra.convention.`kotlin-jvm`
}
dependencies {
runtimeOnly(variantOf(libs.libfreenect) { classifier("windows-x86_64") })
}

View File

@@ -1,7 +1,28 @@
plugins {
org.openrndr.extra.convention.`kotlin-jvm`
}
plugins {
id("org.openrndr.extra.convention.kotlin-jvm")
id("org.openrndr.extra.convention.variant")
}
variants {
val nativeLibs = listOf(libs.libfreenect, sharedLibs.javacpp)
val platforms = listOf(
Triple(OperatingSystemFamily.WINDOWS, MachineArchitecture.X86_64, "windows-x86_64"),
Triple(OperatingSystemFamily.MACOS, MachineArchitecture.X86_64, "macosx-x86_64"),
Triple(OperatingSystemFamily.LINUX, MachineArchitecture.X86_64, "linux-x86_64"),
Triple(OperatingSystemFamily.LINUX, MachineArchitecture.ARM64, "linux-arm64"),
)
for ((os, arch, classifier) in platforms) {
platform(os, arch) {
dependencies {
nativeLibs.forEach {
runtimeOnly(it.get().withClassifier(classifier))
}
}
}
}
}
dependencies { dependencies {
implementation(openrndr.application) implementation(openrndr.application)
implementation(openrndr.math) implementation(openrndr.math)

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
antlr antlr
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
tasks.test { tasks.test {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
tasks.test { tasks.test {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,6 +0,0 @@
plugins {
org.openrndr.extra.convention.`kotlin-jvm`
}
dependencies {
runtimeOnly(variantOf(libs.librealsense) { classifier("linux-x86_64") })
}

View File

@@ -1,6 +0,0 @@
plugins {
org.openrndr.extra.convention.`kotlin-jvm`
}
dependencies {
runtimeOnly(variantOf(libs.librealsense) { classifier("macosx-x86_64") })
}

View File

@@ -1,6 +0,0 @@
plugins {
org.openrndr.extra.convention.`kotlin-jvm`
}
dependencies {
runtimeOnly(variantOf(libs.librealsense) { classifier("windows-x86_64") })
}

View File

@@ -1,11 +1,31 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
id("org.openrndr.extra.convention.variant")
} }
variants {
val nativeLibs = listOf(libs.librealsense, sharedLibs.javacpp)
val platforms = listOf(
Triple(OperatingSystemFamily.WINDOWS, MachineArchitecture.X86_64, "windows-x86_64"),
Triple(OperatingSystemFamily.MACOS, MachineArchitecture.X86_64, "macosx-x86_64"),
Triple(OperatingSystemFamily.LINUX, MachineArchitecture.X86_64, "linux-x86_64"),
Triple(OperatingSystemFamily.LINUX, MachineArchitecture.ARM64, "linux-arm64"),
)
for ((os, arch, classifier) in platforms) {
platform(os, arch) {
dependencies {
nativeLibs.forEach {
runtimeOnly(it.get().withClassifier(classifier))
}
}
}
}
}
dependencies { dependencies {
implementation(openrndr.application) implementation(openrndr.application)
implementation(openrndr.math) implementation(openrndr.math)
api(libs.librealsense) api(libs.librealsense)
demoRuntimeOnly(project(":orx-jvm:orx-realsense2-${(gradle as ExtensionAware).extra["openrndrClassifier"]}")) demoRuntimeOnly(project(":orx-jvm:orx-realsense2"))
demoImplementation(project(":orx-color")) demoImplementation(project(":orx-color"))
} }

View File

@@ -1,8 +1,8 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {
implementation(openrndr.application) implementation(openrndr.application)
implementation(libs.openrndr.gl3.core) implementation(openrndr.gl3)
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,10 +1,7 @@
@Suppress("DSL_SCOPE_VIOLATION") @Suppress("DSL_SCOPE_VIOLATION")
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
// kotlinx-serialization ends up on the classpath through openrndr-math and Gradle doesn't know which alias(libs.plugins.kotlin.serialization)
// version was used. If openrndr were an included build, we probably wouldn't need to do this.
// https://github.com/gradle/gradle/issues/20084
id(libs.plugins.kotlin.serialization.get().pluginId)
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -5,16 +5,16 @@ plugins {
catalog { catalog {
versionCatalog { versionCatalog {
library("camera", "org.openrnd.extra:orx-camera:$version") library("camera", "org.openrndr.extra:orx-camera:$version")
library("color", "org.openrnd.extra:orx-color:$version") library("color", "org.openrndr.extra:orx-color:$version")
library("composition", "org.openrndr.extra:orx-composition:$version") library("composition", "org.openrndr.extra:orx-composition:$version")
library("compositor", "org.openrndr.extra:orx-compositor:$version") library("compositor", "org.openrndr.extra:orx-compositor:$version")
library("delegate-magic", "org.openrndr.extra:orx-delegate-magic:$version") library("delegate-magic", "org.openrndr.extra:orx-delegate-magic:$version")
library("depth-camera", "org.openrndr.extra:orx-depth-camera:$version") library("depth-camera", "org.openrndr.extra:orx-depth-camera:$version")
library("easing", "org.openrndr.extra:orx-easing:$version") library("easing", "org.openrndr.extra:orx-easing:$version")
library("envelopes", "org.openrndr.extra:orx-envelopes:$version") library("envelopes", "org.openrndr.extra:orx-envelopes:$version")
library("expression-evaluator","org.openrndr.extra:orx-expression-evaluator:$version") library("expression-evaluator", "org.openrndr.extra:orx-expression-evaluator:$version")
library("expression-evaluator-typed","org.openrndr.extra:orx-expression-evaluator-typed:$version") library("expression-evaluator-typed", "org.openrndr.extra:orx-expression-evaluator-typed:$version")
library("fcurve", "org.openrndr.extra:orx-fcurve:$version") library("fcurve", "org.openrndr.extra:orx-fcurve:$version")
library("fft", "org.openrndr.extra:orx-fft:$version") library("fft", "org.openrndr.extra:orx-fft:$version")
library("fx", "org.openrndr.extra:orx-fx:$version") library("fx", "org.openrndr.extra:orx-fx:$version")
@@ -38,7 +38,7 @@ catalog {
library("kotlin-parser", "org.openrndr.extra:orx-kotlin-parser:$version") library("kotlin-parser", "org.openrndr.extra:orx-kotlin-parser:$version")
library("midi", "org.openrndr.extra:orx-midi:$version") library("midi", "org.openrndr.extra:orx-midi:$version")
library("minim", "org.openrndr.extra:orx-minim:$version") library("minim", "org.openrndr.extra:orx-minim:$version")
library("olive", "org.openrndr.extra.olive:orx-live:$version") library("olive", "org.openrndr.extra:orx-olive:$version")
library("osc", "org.openrndr.extra:orx-osc:$version") library("osc", "org.openrndr.extra:orx-osc:$version")
library("panel", "org.openrndr.extra:orx-panel:$version") library("panel", "org.openrndr.extra:orx-panel:$version")
library("poisson-fill", "org.openrndr.extra:orx-poisson-fill:$version") library("poisson-fill", "org.openrndr.extra:orx-poisson-fill:$version")
@@ -72,6 +72,30 @@ catalog {
library("triangulation", "org.openrndr.extra:orx-triangulation:$version") library("triangulation", "org.openrndr.extra:orx-triangulation:$version")
library("turtle", "org.openrndr.extra:orx-turtle:$version") library("turtle", "org.openrndr.extra:orx-turtle:$version")
library("view-box", "org.openrndr.extra:orx-view-box:$version") library("view-box", "org.openrndr.extra:orx-view-box:$version")
bundle(
"basic",
listOf(
"camera",
"color",
"composition",
"compositor",
"fx",
"image-fit",
"panel",
"video-profiles",
"math",
"mesh-generators",
"no-clear",
"noise",
"shade-styles",
"shader-phrases",
"shapes",
"svg",
"text-on-contour",
"text-writer"
)
)
} }
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -0,0 +1,18 @@
import org.openrndr.application
import org.openrndr.extra.noise.fbm
import org.openrndr.extra.noise.perlin2D
fun main() {
application {
configure {
width = 1280
height = 720
}
program {
extend {
perlin2D.fbm()
}
}
}
}

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.kotest.multiplatform)
} }

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` id("org.openrndr.extra.convention.kotlin-jvm")
} }
dependencies { dependencies {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -1,5 +1,5 @@
plugins { plugins {
org.openrndr.extra.convention.`kotlin-multiplatform` id("org.openrndr.extra.convention.kotlin-multiplatform")
} }
kotlin { kotlin {

View File

@@ -2,16 +2,8 @@ import org.gradle.internal.os.OperatingSystem
rootProject.name = "orx" rootProject.name = "orx"
@Suppress("INACCESSIBLE_TYPE")
// This is equivalent to `gradle.ext` https://stackoverflow.com/a/65377323/17977931 includeBuild("build-logic")
val openrndrClassifier: String by (gradle as ExtensionAware).extra(
"natives-" + when (val os = OperatingSystem.current()) {
OperatingSystem.WINDOWS -> "windows"
OperatingSystem.LINUX -> "linux-x64"
OperatingSystem.MAC_OS -> "macos"
else -> error("Unsupported operating system: $os")
}
)
dependencyResolutionManagement { dependencyResolutionManagement {
repositories { repositories {
@@ -88,9 +80,6 @@ include(
"orx-quadtree", "orx-quadtree",
"orx-jvm:orx-rabbit-control", "orx-jvm:orx-rabbit-control",
"orx-jvm:orx-realsense2", "orx-jvm:orx-realsense2",
"orx-jvm:orx-realsense2-natives-linux-x64",
"orx-jvm:orx-realsense2-natives-macos",
"orx-jvm:orx-realsense2-natives-windows",
"orx-shader-phrases", "orx-shader-phrases",
"orx-shade-styles", "orx-shade-styles",
"orx-shapes", "orx-shapes",
@@ -102,10 +91,6 @@ include(
"orx-triangulation", "orx-triangulation",
"orx-jvm:orx-kinect-common", "orx-jvm:orx-kinect-common",
"orx-jvm:orx-kinect-v1", "orx-jvm:orx-kinect-v1",
"orx-jvm:orx-kinect-v1-natives-linux-arm64",
"orx-jvm:orx-kinect-v1-natives-linux-x64",
"orx-jvm:orx-kinect-v1-natives-macos",
"orx-jvm:orx-kinect-v1-natives-windows",
"orx-jvm:orx-kinect-v1-demo", "orx-jvm:orx-kinect-v1-demo",
"orx-jvm:orx-video-profiles", "orx-jvm:orx-video-profiles",
"orx-depth-camera", "orx-depth-camera",