|
| 1 | +plugins { |
| 2 | + id 'com.android.library' |
| 3 | + id 'kotlin-android' |
| 4 | +} |
| 5 | + |
| 6 | +if (project.hasProperty('useKsp')) { |
| 7 | + apply plugin: 'com.google.devtools.ksp' |
| 8 | +} else { |
| 9 | + apply plugin: 'kotlin-kapt' |
| 10 | + kapt { |
| 11 | + correctErrorTypes = true |
| 12 | + arguments { |
| 13 | + arg("multiPreviewType", "com.airbnb.android.submodule.showkasesample.FontPreview") |
| 14 | + } |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +android { |
| 19 | + compileSdkVersion 32 |
| 20 | + |
| 21 | + defaultConfig { |
| 22 | + minSdkVersion 21 |
| 23 | + targetSdkVersion 32 |
| 24 | + |
| 25 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 26 | + } |
| 27 | + |
| 28 | + buildTypes { |
| 29 | + release { |
| 30 | + minifyEnabled false |
| 31 | + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| 32 | + } |
| 33 | + } |
| 34 | + compileOptions { |
| 35 | + sourceCompatibility JavaVersion.VERSION_11 |
| 36 | + targetCompatibility JavaVersion.VERSION_11 |
| 37 | + } |
| 38 | + kotlinOptions { |
| 39 | + jvmTarget = '11' |
| 40 | + } |
| 41 | + buildFeatures { |
| 42 | + compose true |
| 43 | + } |
| 44 | + composeOptions { |
| 45 | + kotlinCompilerVersion "${versions.kotlinCompilerVersion}" |
| 46 | + kotlinCompilerExtensionVersion "${versions.composeCompiler}" |
| 47 | + |
| 48 | + } |
| 49 | + // Added to avoid this error - |
| 50 | + // Execution failed for task ':app:mergeDebugAndroidTestJavaResource'. |
| 51 | + // > A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction |
| 52 | + // > 2 files found with path 'META-INF/AL2.0' from inputs: |
| 53 | + packagingOptions { |
| 54 | + exclude 'META-INF/AL2.0' |
| 55 | + exclude 'META-INF/LGPL2.1' |
| 56 | + } |
| 57 | +} |
| 58 | + |
| 59 | +dependencies { |
| 60 | + // Support Libraries |
| 61 | + implementation deps.support.appCompat |
| 62 | + implementation deps.support.ktx |
| 63 | + implementation deps.support.lifecycleExtensions |
| 64 | + |
| 65 | + // Showkase |
| 66 | + implementation project(':showkase') |
| 67 | + implementation project(':sample-submodule') |
| 68 | + |
| 69 | + if (project.hasProperty('useKsp')) { |
| 70 | + ksp project(':showkase-processor') |
| 71 | + } else { |
| 72 | + kapt project(':showkase-processor') |
| 73 | + } |
| 74 | + |
| 75 | + // Compose |
| 76 | + implementation deps.compose.activityCompose |
| 77 | + implementation deps.compose.composeRuntime |
| 78 | + implementation deps.compose.constraintLayout |
| 79 | + implementation deps.compose.core |
| 80 | + implementation deps.compose.foundation |
| 81 | + implementation deps.compose.tooling |
| 82 | + implementation deps.compose.layout |
| 83 | + implementation deps.compose.material |
| 84 | + implementation deps.compose.savedInstanceState |
| 85 | + implementation deps.compose.uiLiveData |
| 86 | + androidTestImplementation deps.compose.uiTest |
| 87 | +} |
0 commit comments