• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1apply plugin: 'com.android.application'
2apply plugin: 'kotlin-android'
3
4android {
5    defaultConfig {
6        applicationId "com.google.oboe.samples.rhythmgame"
7        targetSdkVersion 35
8        compileSdkVersion 35
9        versionCode 1
10        versionName "1.0"
11        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
12        externalNativeBuild {
13            cmake {
14                cppFlags "-std=c++17"
15                abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
16            }
17        }
18    }
19    buildTypes {
20        release {
21            minifyEnabled false
22            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23        }
24    }
25    compileOptions {
26        sourceCompatibility JavaVersion.VERSION_18
27        targetCompatibility JavaVersion.VERSION_18
28    }
29    externalNativeBuild {
30        cmake {
31            path "CMakeLists.txt"
32        }
33    }
34    flavorDimensions "extractorLibrary"
35    productFlavors {
36        ndkExtractor {
37            dimension "extractorLibrary"
38
39            // Oboe has a minimum API of 16, but AMediaExtractor (used to extract the MP3 assets)
40            // is only available from API 21.
41            // For further backward compatibility consider using FFmpeg (see below)
42            minSdkVersion 21
43            externalNativeBuild {
44                cmake {
45                    arguments "-DUSE_FFMPEG=0"
46                }
47            }
48        }
49        /**
50         * To use FFmpeg for asset extraction do the following:
51         * - Uncomment this block
52         * - Change the build variant to ffmpegExtractor
53         * - Update the FFMPEG_DIR variable in CMakeLists.txt to the local FFmpeg path
54         */
55        /*
56        ffmpegExtractor {
57            dimension "extractorLibrary"
58            minSdkVersion 16
59            externalNativeBuild {
60                cmake {
61                    arguments "-DUSE_FFMPEG=1"
62                }
63            }
64        }
65        */
66    }
67    namespace 'com.google.oboe.samples.rhythmgame'
68    buildFeatures {
69        buildConfig true
70    }
71}
72
73dependencies {
74    implementation fileTree(dir: 'libs', include: ['*.jar'])
75    implementation 'androidx.appcompat:appcompat:1.7.0'
76    implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
77}
78