Skip to content

Commit

Permalink
Migrate insets-ui to Kotlin DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
oas004 committed May 1, 2023
1 parent c3761b6 commit e870e3f
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions insets-ui/build.gradle → insets-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
id("org.jetbrains.dokka")
id("me.tylerbwong.gradle.metalava")
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.android.kotlin.get().pluginId)
id(libs.plugins.jetbrains.dokka.get().pluginId)
id(libs.plugins.gradle.metalava.get().pluginId)
id(libs.plugins.vanniktech.maven.publish.get().pluginId)
}

kotlin {
Expand All @@ -28,12 +30,12 @@ kotlin {
android {
namespace = "com.google.accompanist.insets.ui"

compileSdkVersion = 33
compileSdk = 33

defaultConfig {
minSdkVersion 21
minSdk = 21
// targetSdkVersion has no effect for libraries. This is only used for the test APK
targetSdkVersion 33
targetSdk = 33
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -51,40 +53,41 @@ android {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}

lintOptions {
lint {
textReport = true
textOutput 'stdout'
textOutput = File("stdout")
// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks
checkReleaseBuilds = false
}

packagingOptions {
packaging {
// Some of the META-INF files conflict with coroutines-test. Exclude them to enable
// our test APK to build (has no effect on our AARs)
excludes += "/META-INF/AL2.0"
excludes += "/META-INF/LGPL2.1"
resources {
excludes += listOf("/META-INF/AL2.0", "/META-INF/LGPL2.1")
}
}

testOptions {
unitTests {
includeAndroidResources = true
isIncludeAndroidResources = true
}
unitTests.all {
useJUnit {
excludeCategories "com.google.accompanist.internal.test.IgnoreOnRobolectric"
it.useJUnit {
excludeCategories("com.google.accompanist.internal.test.IgnoreOnRobolectric")
}
}
animationsDisabled true
animationsDisabled = true
}

sourceSets {
test {
java.srcDirs += 'src/sharedTest/kotlin'
res.srcDirs += 'src/sharedTest/res'
named("test") {
java.srcDirs("src/sharedTest/kotlin")
res.srcDirs("src/sharedTest/res")
}
androidTest {
java.srcDirs += 'src/sharedTest/kotlin'
res.srcDirs += 'src/sharedTest/res'
named("androidTest") {
java.srcDirs("src/sharedTest/kotlin")
res.srcDirs("src/sharedTest/res")
}
}
}
Expand Down Expand Up @@ -125,5 +128,3 @@ dependencies {

testImplementation(libs.robolectric)
}

apply plugin: "com.vanniktech.maven.publish"

0 comments on commit e870e3f

Please sign in to comment.