From 78dc1dfa2ea0c720fe4f885f65dee153ad1f73f2 Mon Sep 17 00:00:00 2001 From: "Daniel A. A. Pelsmaeker" Date: Sun, 21 Jul 2024 20:31:32 +0200 Subject: [PATCH] Use platform --- example/empty/empty.example/build.gradle.kts | 2 ++ example/empty/empty.test/build.gradle.kts | 3 +++ example/empty/empty/build.gradle.kts | 2 ++ example/stratego_format_override/build.gradle.kts | 2 ++ .../src/main/kotlin/mb/spoofax/gradle/util/ConfigOverride.kt | 5 +++++ 5 files changed, 14 insertions(+) diff --git a/example/empty/empty.example/build.gradle.kts b/example/empty/empty.example/build.gradle.kts index bd80139..578cdd3 100644 --- a/example/empty/empty.example/build.gradle.kts +++ b/example/empty/empty.example/build.gradle.kts @@ -17,6 +17,8 @@ spoofaxProject { dependencies { + api(platform(libs.metaborg.platform)) { version { require("latest.integration") } } + compileLanguage(project(":empty")) compileOnly(libs.spoofax.core) diff --git a/example/empty/empty.test/build.gradle.kts b/example/empty/empty.test/build.gradle.kts index f51f1a4..4e27521 100644 --- a/example/empty/empty.test/build.gradle.kts +++ b/example/empty/empty.test/build.gradle.kts @@ -14,6 +14,9 @@ spoofaxTest { } dependencies { + api(platform(libs.metaborg.platform)) { version { require("latest.integration") } } + compileLanguage(project(":empty")) + compileOnly(libs.spoofax.core) } diff --git a/example/empty/empty/build.gradle.kts b/example/empty/empty/build.gradle.kts index 9fc1721..04abeaf 100644 --- a/example/empty/empty/build.gradle.kts +++ b/example/empty/empty/build.gradle.kts @@ -16,6 +16,8 @@ spoofaxLanguageSpecification { } dependencies { + api(platform(libs.metaborg.platform)) { version { require("latest.integration") } } + compileLanguage(libs.esv.lang) compileLanguage(libs.sdf3.lang) diff --git a/example/stratego_format_override/build.gradle.kts b/example/stratego_format_override/build.gradle.kts index b006510..39c942c 100644 --- a/example/stratego_format_override/build.gradle.kts +++ b/example/stratego_format_override/build.gradle.kts @@ -18,6 +18,8 @@ spoofaxLanguageSpecification { } dependencies { + api(platform(libs.metaborg.platform)) { version { require("latest.integration") } } + compileLanguage(libs.esv.lang) compileLanguage(libs.sdf3.lang) diff --git a/plugin/src/main/kotlin/mb/spoofax/gradle/util/ConfigOverride.kt b/plugin/src/main/kotlin/mb/spoofax/gradle/util/ConfigOverride.kt index c9701f4..5c908fd 100644 --- a/plugin/src/main/kotlin/mb/spoofax/gradle/util/ConfigOverride.kt +++ b/plugin/src/main/kotlin/mb/spoofax/gradle/util/ConfigOverride.kt @@ -102,6 +102,11 @@ internal fun SpoofaxExtensionBase.overrideIdentifiers(configOverrides: SpoofaxGr internal fun SpoofaxExtensionBase.overrideDependencies(configOverrides: SpoofaxGradleConfigOverrides) { configOverrides.update(project) { + // FIXME: Cannot use a plarform(...) dependency, as you'll get an error later in the pipeline that the platform + // dependency is not a Spoofax language. It is not clear how to distinguish normal from platform or enforcePlatform + // dependencies. + // TODO: I think this should become `project.compileLanguageFiles.incoming.resolutionResult`, but I'm not sure what + // to do with project(...) dependencies, as they don't have a group:module:version ID. compileDeps = project.compileLanguageFiles.resolvedConfiguration.firstLevelModuleDependencies.map { it.toSpoofaxDependency() }