// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN apply plugin: 'com.android.library' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation(name: 'androidx.activity.activity-1.0.0', ext:'aar') implementation(name: 'androidx.appcompat.appcompat-1.1.0', ext:'aar') implementation(name: 'androidx.appcompat.appcompat-resources-1.1.0', ext:'aar') implementation(name: 'androidx.browser.browser-1.0.0', ext:'aar') implementation(name: 'androidx.cardview.cardview-1.0.0', ext:'aar') implementation(name: 'androidx.core.core-ktx-1.3.2', ext:'aar') implementation(name: 'androidx.legacy.legacy-support-v4-1.0.0', ext:'aar') implementation(name: 'androidx.media.media-1.0.0', ext:'aar') implementation(name: 'androidx.savedstate.savedstate-1.0.0', ext:'aar') implementation(name: 'androidx.vectordrawable.vectordrawable-animated-1.1.0', ext:'aar') implementation(name: 'com.android.installreferrer.installreferrer-2.1', ext:'aar') implementation(name: 'com.appsflyer.af-android-sdk-6.4.1', ext:'aar') implementation(name: 'com.appsflyer.oaid-6.2.4', ext:'aar') implementation(name: 'com.appsflyer.unity-wrapper-6.4.1', ext:'aar') implementation(name: 'com.facebook.android.facebook-applinks-11.3.0', ext:'aar') implementation(name: 'com.facebook.android.facebook-common-11.3.0', ext:'aar') implementation(name: 'com.facebook.android.facebook-core-11.3.0', ext:'aar') implementation(name: 'com.facebook.android.facebook-gamingservices-11.3.0', ext:'aar') implementation(name: 'com.facebook.android.facebook-login-11.3.0', ext:'aar') implementation(name: 'com.facebook.android.facebook-share-11.3.0', ext:'aar') implementation(name: 'facebook-android-wrapper-11.0.0', ext:'aar') implementation(name: 'screenutils-release', ext:'aar') implementation(name: 'ThinkingSDK', ext:'aar') implementation(name: 'UnityUtils-release', ext:'aar') implementation 'com.google.android.gms:play-services-auth:20.1.0' implementation "com.android.billingclient:billing:4.0.0" implementation platform('com.google.firebase:firebase-bom:29.2.1') implementation 'com.google.firebase:firebase-analytics:21.1.0' implementation 'com.google.firebase:firebase-messaging' } android { compileSdkVersion 30 buildToolsVersion '30.0.2' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { minSdkVersion 19 targetSdkVersion 30 ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } versionCode 1 versionName '0.1.0' consumerProguardFiles 'proguard-unity.txt' } lintOptions { abortOnError false } aaptOptions { noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ') ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" } packagingOptions { doNotStrip '*/armeabi-v7a/*.so' doNotStrip '*/arm64-v8a/*.so' doNotStrip '*/x86/*.so' doNotStrip '*/x86_64/*.so' } } def getSdkDir() { Properties local = new Properties() local.load(new FileInputStream("${rootDir}/local.properties")) return local.getProperty('sdk.dir') } def BuildIl2Cpp(String workingDir, String targetDirectory, String architecture, String abi, String configuration) { exec { commandLine(workingDir + "/src/main/Il2CppOutputProject/IL2CPP/build/deploy/netcoreapp3.1/il2cpp", "--compile-cpp", "--libil2cpp-static", "--platform=Android", "--architecture=" + architecture, "--configuration=" + configuration, "--outputpath=" + workingDir + targetDirectory + abi + "/libil2cpp.so", "--cachedirectory=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_cache", "--additional-include-directories=" + workingDir + "/src/main/Il2CppOutputProject/IL2CPP/external/bdwgc/include", "--additional-include-directories=" + workingDir + "/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/include", "--tool-chain-path=" + android.ndkDirectory, "--map-file-parser=" + workingDir + "/src/main/Il2CppOutputProject/IL2CPP/MapFileParser/MapFileParser.exe", "--generatedcppdir=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput", "--baselib-directory=" + workingDir + "/src/main/jniStaticLibs/" + abi, "--dotnetprofile=unityaot") environment "ANDROID_SDK_ROOT", getSdkDir() } delete workingDir + targetDirectory + abi + "/libil2cpp.sym.so" ant.move(file: workingDir + targetDirectory + abi + "/libil2cpp.dbg.so", tofile: workingDir + "/symbols/" + abi + "/libil2cpp.so") } android { task BuildIl2CppTask { doLast { BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), '/src/main/jniLibs/', 'ARMv7', 'armeabi-v7a', 'Release'); BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), '/src/main/jniLibs/', 'ARM64', 'arm64-v8a', 'Release'); BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), '/src/main/jniLibs/', 'x86', 'x86', 'Release'); BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), '/src/main/jniLibs/', 'x64', 'x86_64', 'Release'); } } afterEvaluate { if (project(':unityLibrary').tasks.findByName('mergeDebugJniLibFolders')) project(':unityLibrary').mergeDebugJniLibFolders.dependsOn BuildIl2CppTask if (project(':unityLibrary').tasks.findByName('mergeReleaseJniLibFolders')) project(':unityLibrary').mergeReleaseJniLibFolders.dependsOn BuildIl2CppTask } sourceSets { main { jni.srcDirs = ["src/main/Il2CppOutputProject"] } } }