Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions addon/addon-build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// © 2024-present Godot Mobile Plugins (https://github.com/godot-mobile-plugins)
//

import org.gradle.api.file.FileSystemOperations
import javax.inject.Inject

plugins {
id("base-conventions")
}
Expand All @@ -16,6 +19,11 @@ val pluginConfig = loadPluginConfig()
val iosConfig = loadIosConfig()
val godotConfig = loadGodotConfig()

interface Injected {
@get:Inject
val fsOps: FileSystemOperations
}

// -- Collect all catalog library aliases (used in @androidDependencies@ token) -

val androidDependencies =
Expand Down Expand Up @@ -79,19 +87,21 @@ fun TaskContainerScope.registerGdscriptFormatTask(
val sharedGdformatrcDest = sharedSrcDir.resolve(".gdformatrc")
val excludePatterns = listOf("**/*Plugin.gd", "**/MediationNetwork.gd")

val fsOps = project.objects.newInstance<Injected>().fsOps

register<Exec>(name) {
this.description = description
this.group = if (check) "verification" else "formatting"

workingDir = addonSrcDir

doFirst {
copy {
fsOps.copy {
from(gdformatrcSource)
into(addonSrcDir)
}
if (sharedSrcDir.exists()) {
copy {
fsOps.copy {
from(gdformatrcSource)
into(sharedSrcDir)
}
Expand Down
18 changes: 6 additions & 12 deletions android/android-build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import javax.xml.parsers.DocumentBuilderFactory
plugins {
id("base-conventions")
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.undercouch.download)
alias(libs.plugins.openrewrite)
alias(libs.plugins.node)
Expand Down Expand Up @@ -242,6 +241,10 @@ configure<org.openrewrite.gradle.RewriteExtension> {

// -- Android configuration -----------------------------------------------------

base {
archivesName.set(pluginConfig.pluginName)
}

android {
namespace = pluginConfig.pluginPackageName
compileSdk =
Expand Down Expand Up @@ -275,13 +278,6 @@ android {
}
}

libraryVariants.all {
outputs.all {
(this as LibraryVariantOutputImpl).outputFileName =
"${pluginConfig.pluginName}-$name.aar"
}
}

buildTypes {
// enableUnitTestCoverage instruments testDebugUnitTest with the JaCoCo
// agent and wires up the createDebugUnitTestCoverageReport task, which
Expand Down Expand Up @@ -655,11 +651,9 @@ tasks {
dependsOn("testDebugUnitTest")
dependsOn("createDebugUnitTestCoverageReport")

val buildDirProvider = project.layout.buildDirectory // Capture at configuration time
doLast {
val buildDir =
project.layout.buildDirectory
.get()
.asFile
val buildDir = buildDirProvider.get().asFile
val resultsDir = File(buildDir, "test-results/testDebugUnitTest")
val coverageXml = File(buildDir, "reports/coverage/test/debug/report.xml")
val coverageDir = coverageXml.parentFile
Expand Down
3 changes: 2 additions & 1 deletion common/build-logic/logic.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
plugins {
`kotlin-dsl`
`java-gradle-plugin`
alias(libs.plugins.kotlin.serialization)
kotlin("plugin.serialization") version embeddedKotlinVersion
}


java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
Expand Down
Loading
Loading