xref: /aosp_15_r20/system/extras/simpleperf/demo/SimpleperfExampleCpp/app/build.gradle (revision 288bf5226967eb3dac5cce6c939ccc2a7f2b4fe5)
1*288bf522SAndroid Build Coastguard Workerplugins {
2*288bf522SAndroid Build Coastguard Worker    id 'com.android.application'
3*288bf522SAndroid Build Coastguard Worker}
4*288bf522SAndroid Build Coastguard Worker
5*288bf522SAndroid Build Coastguard Workerandroid {
6*288bf522SAndroid Build Coastguard Worker    compileSdkVersion 32
7*288bf522SAndroid Build Coastguard Worker
8*288bf522SAndroid Build Coastguard Worker    defaultConfig {
9*288bf522SAndroid Build Coastguard Worker        applicationId "simpleperf.example.cpp"
10*288bf522SAndroid Build Coastguard Worker        minSdkVersion 24
11*288bf522SAndroid Build Coastguard Worker        targetSdkVersion 32
12*288bf522SAndroid Build Coastguard Worker        versionCode 1
13*288bf522SAndroid Build Coastguard Worker        versionName "1.0"
14*288bf522SAndroid Build Coastguard Worker
15*288bf522SAndroid Build Coastguard Worker        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16*288bf522SAndroid Build Coastguard Worker        externalNativeBuild {
17*288bf522SAndroid Build Coastguard Worker            cmake {
18*288bf522SAndroid Build Coastguard Worker                cppFlags '-std=c++17'
19*288bf522SAndroid Build Coastguard Worker                // Cmake Debug build type uses -O0, which makes the code slow. So use release build.
20*288bf522SAndroid Build Coastguard Worker                arguments "-DCMAKE_BUILD_TYPE=Release"
21*288bf522SAndroid Build Coastguard Worker            }
22*288bf522SAndroid Build Coastguard Worker        }
23*288bf522SAndroid Build Coastguard Worker    }
24*288bf522SAndroid Build Coastguard Worker
25*288bf522SAndroid Build Coastguard Worker    buildTypes {
26*288bf522SAndroid Build Coastguard Worker        release {
27*288bf522SAndroid Build Coastguard Worker            minifyEnabled false
28*288bf522SAndroid Build Coastguard Worker            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
29*288bf522SAndroid Build Coastguard Worker        }
30*288bf522SAndroid Build Coastguard Worker    }
31*288bf522SAndroid Build Coastguard Worker    compileOptions {
32*288bf522SAndroid Build Coastguard Worker        sourceCompatibility JavaVersion.VERSION_1_8
33*288bf522SAndroid Build Coastguard Worker        targetCompatibility JavaVersion.VERSION_1_8
34*288bf522SAndroid Build Coastguard Worker    }
35*288bf522SAndroid Build Coastguard Worker    externalNativeBuild {
36*288bf522SAndroid Build Coastguard Worker        cmake {
37*288bf522SAndroid Build Coastguard Worker            path file('src/main/cpp/CMakeLists.txt')
38*288bf522SAndroid Build Coastguard Worker            version '3.18.1'
39*288bf522SAndroid Build Coastguard Worker        }
40*288bf522SAndroid Build Coastguard Worker    }
41*288bf522SAndroid Build Coastguard Worker    buildFeatures {
42*288bf522SAndroid Build Coastguard Worker        viewBinding true
43*288bf522SAndroid Build Coastguard Worker    }
44*288bf522SAndroid Build Coastguard Worker}
45*288bf522SAndroid Build Coastguard Worker
46*288bf522SAndroid Build Coastguard Workerdependencies {
47*288bf522SAndroid Build Coastguard Worker
48*288bf522SAndroid Build Coastguard Worker    implementation 'androidx.appcompat:appcompat:1.3.1'
49*288bf522SAndroid Build Coastguard Worker    implementation 'com.google.android.material:material:1.2.1'
50*288bf522SAndroid Build Coastguard Worker    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
51*288bf522SAndroid Build Coastguard Worker    implementation 'androidx.navigation:navigation-fragment:2.3.0'
52*288bf522SAndroid Build Coastguard Worker    implementation 'androidx.navigation:navigation-ui:2.3.0'
53*288bf522SAndroid Build Coastguard Worker    testImplementation 'junit:junit:4.+'
54*288bf522SAndroid Build Coastguard Worker    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
55*288bf522SAndroid Build Coastguard Worker    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
56*288bf522SAndroid Build Coastguard Worker}