summaryrefslogtreecommitdiff
path: root/android/android_studio_project/app/build.gradle
blob: 92fc816b2417a7da9427a21c677a60159ae8d775 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 33
    ndkVersion '25.0.8775105'

    defaultConfig {
        applicationId 'jp.xenia.emulator'
        // 24 (7.0) - Vulkan.
        minSdkVersion 24
        targetSdkVersion 33
        versionCode 1
        versionName 'Prototype'
        externalNativeBuild {
            ndkBuild {
                arguments 'NDK_APPLICATION_MK:=../../../build/xenia.Application.mk',
                        'PREMAKE_ANDROIDNDK_PLATFORMS:=Android-ARM64',
                        'PREMAKE_ANDROIDNDK_PLATFORMS+=Android-x86_64',
                        // ndk.jobs doesn't work as of Gradle 7.1.0.
                        "-j${Runtime.runtime.availableProcessors()}",
                        // Work around "Bad file descriptor" on Windows on NDK r22+.
                        '--output-sync=none'
                // For the app, don't build the executables designed for running from a terminal.
                // To build the executables, run ndk-build manually.
                targets 'xenia-app'
            }
        }
        ndk {
            abiFilters 'arm64-v8a', 'x86_64'
            stl 'c++_static'
        }
    }

    buildTypes {
        release {
            externalNativeBuild {
                ndkBuild {
                    arguments 'PREMAKE_ANDROIDNDK_CONFIGURATIONS:=Release'
                }
            }
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix '.debug'
            debuggable true
            externalNativeBuild {
                ndkBuild {
                    arguments 'PREMAKE_ANDROIDNDK_CONFIGURATIONS:=Debug'
                }
            }
        }
        checked {
            applicationIdSuffix '.checked'
            debuggable true
            externalNativeBuild {
                ndkBuild {
                    arguments 'PREMAKE_ANDROIDNDK_CONFIGURATIONS:=Checked'
                }
            }
        }
    }

    flavorDimensions 'distribution'
    productFlavors {
        github {
            dimension 'distribution'
            applicationIdSuffix '.github'
        }
        googlePlay {
            dimension 'distribution'
            // TODO(Triang3l): Provide a signing config for core contributors only.
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    externalNativeBuild {
        ndkBuild {
            path file('../../../build/xenia.wks.Android.mk')
        }
    }
}

dependencies {
    implementation 'org.jetbrains:annotations:15.0'
}