Updates android Readme and Gradle (#7942)

Co-authored-by: Garen7 <Garen7@users.noreply.github.com>
This commit is contained in:
Garen7
2023-01-07 10:45:25 -06:00
committed by GitHub
parent eb9b0f69bb
commit cb5351419b
2 changed files with 14 additions and 5 deletions

View File

@@ -122,8 +122,14 @@ dependencies{
natives "com.github.Anuken.Arc:natives-android:${getArcHash()}"
natives "com.github.Anuken.Arc:natives-freetype-android:${getArcHash()}"
//TODO dynamically find best android platform jar instead of hard-coding to 30
def sdkFile = new File((String)findSdkDir(), "/platforms/android-30/android.jar")
def version;
def highestVersion;
new File((String)findSdkDir(), "/platforms").eachFileMatch ~/android-\d+/, {
version = it.name.find(/\d+/).toInteger();
highestVersion = version > highestVersion ? version : highestVersion;
}
def sdkFile = new File((String)findSdkDir(), "/platforms/android-${highestVersion}/android.jar")
if(sdkFile.exists()) compileOnly files(sdkFile.absolutePath)
}