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" externalNativeBuild { cmake { cppFlags '' } } ndk { //noinspection ChromeOsAbiSupport abiFilters 'arm64-v8a' } } externalNativeBuild { cmake { path file('CMakeLists.txt') version '3.22.1' } } namespace = "fhuyakou.godot.plugin.android.hellogdextension" // Used to customize the name of generated AAR file. libraryVariants.configureEach { variant -> variant.outputs.configureEach { output -> output.outputFileName = "HelloGDExtension.${variant.name}.aar" } } } dependencies { compileOnly libraries.godotAndroidLib implementation "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlinVersion" } tasks.register('copyDebugAARToDemoAddons', Copy) { from 'build/outputs/aar' include 'HelloGDExtension.debug.aar' into 'demo/addons/hello_gdextension_plugin/bin/debug' } tasks.register('copyReleaseAARToDemoAddons', Copy) { from 'build/outputs/aar' include 'HelloGDExtension.release.aar' into 'demo/addons/hello_gdextension_plugin/bin/release' } tasks.register('copyDebugSharedLibs', Copy) { dependsOn(":plugins:hello_gdextension:externalNativeBuildDebug") from 'build/intermediates/cmake/debug/obj' into 'demo/addons/hello_gdextension_plugin/bin/debug' } tasks.register('copyReleaseSharedLibs', Copy) { dependsOn(":plugins:hello_gdextension:externalNativeBuildRelease") from 'build/intermediates/cmake/release/obj' into 'demo/addons/hello_gdextension_plugin/bin/release' } tasks.register('copyGdExtensionConfigToAssets', Copy) { description 'Copy hello_gdextension.gdextension from the addons directory to the assets directory' from 'demo/addons/hello_gdextension_plugin/' include 'hello_gdextension.gdextension' into 'src/main/assets/addons/hello_gdextension_plugin' } preBuild.dependsOn(copyGdExtensionConfigToAssets) assemble.dependsOn(copyGdExtensionConfigToAssets) assemble.finalizedBy(copyDebugAARToDemoAddons) assemble.finalizedBy(copyReleaseAARToDemoAddons) assemble.finalizedBy(copyDebugSharedLibs) assemble.finalizedBy(copyReleaseSharedLibs)