plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' } android { compileSdk versions.compileSdk defaultConfig { minSdk versions.minSdk targetSdk versions.targetSdk versionCode 1 versionName "1.0" } namespace = "fhuyakou.godot.plugin.android.helloworld" // Used to customize the name of generated AAR file. libraryVariants.configureEach { variant -> variant.outputs.configureEach { output -> output.outputFileName = "HelloWorld.${variant.name}.aar" } } } dependencies { // TODO: Update the godot dep when 4.2 is stable compileOnly "io.github.m4gr3d:godot:4.2.0.dev-SNAPSHOT" implementation "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlinVersion" } tasks.register('copyDebugAARToAddons', Copy) { from 'build/outputs/aar' include 'HelloWorld.debug.aar' into 'src/main/assets/addons/hello_world_plugin/.bin/debug' } tasks.register('copyReleaseAARToAddons', Copy) { from 'build/outputs/aar' include 'HelloWorld.release.aar' into 'src/main/assets/addons/hello_world_plugin/.bin/release' } tasks.register('copyAddonsToDemo', Copy) { dependsOn(copyDebugAARToAddons) dependsOn(copyReleaseAARToAddons) doFirst { delete('demo/addons/hello_world_plugin') } from 'src/main/assets/addons/hello_world_plugin' into 'demo/addons/hello_world_plugin' } assemble.finalizedBy(copyDebugAARToAddons) assemble.finalizedBy(copyReleaseAARToAddons) assemble.finalizedBy(copyAddonsToDemo)