Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[Adaptive] Migrate gradle module til Kotlin DSL" #1592

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions adaptive/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.dokka'
id 'me.tylerbwong.gradle.metalava'
}

kotlin {
explicitApi()
}

android {
namespace "com.google.accompanist.adaptive"

compileSdkVersion 33

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

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

buildFeatures {
buildConfig false
compose true
}

composeOptions {
kotlinCompilerExtensionVersion libs.versions.composeCompiler.get()
}

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

packagingOptions {
// 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"
}

testOptions {
unitTests {
includeAndroidResources = true
}
animationsDisabled true
}

sourceSets {
test {
java.srcDirs += 'src/sharedTest/kotlin'
res.srcDirs += 'src/sharedTest/res'
}
androidTest {
java.srcDirs += 'src/sharedTest/kotlin'
res.srcDirs += 'src/sharedTest/res'
}
}
}

metalava {
sourcePaths.setFrom("src/main")
filename.set("api/current.api")
reportLintsAsErrors.set(true)
}

dependencies {
api libs.compose.foundation.foundation
api libs.compose.ui.ui
api libs.androidx.window

implementation libs.napier
implementation libs.kotlin.coroutines.android

// ======================
// Test dependencies
// ======================

androidTestImplementation project(':internal-testutils')
testImplementation project(':internal-testutils')

androidTestImplementation project(':testharness')
testImplementation project(':testharness')

androidTestImplementation libs.junit
testImplementation libs.junit

androidTestImplementation libs.truth
testImplementation libs.truth

androidTestImplementation libs.compose.ui.test.junit4
testImplementation libs.compose.ui.test.junit4

androidTestImplementation libs.compose.ui.test.manifest
testImplementation libs.compose.ui.test.manifest

androidTestImplementation libs.androidx.test.runner
testImplementation libs.androidx.test.runner

androidTestImplementation libs.androidx.window.testing
testImplementation libs.androidx.window.testing

testImplementation libs.robolectric
}

apply plugin: "com.vanniktech.maven.publish"
133 changes: 0 additions & 133 deletions adaptive/build.gradle.kts

This file was deleted.

18 changes: 3 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ composeCompiler = "1.4.6"
composeMaterial3 = "1.0.1"
composesnapshot = "-" # a single character = no snapshot

dokka = "1.5.0"

# gradlePlugin and lint need to be updated together
gradlePlugin = "8.0.0"
lintMinCompose = "30.0.0"
Expand All @@ -21,9 +19,6 @@ androidxtest = "1.4.0"
androidxnavigation = "2.6.0-alpha08"
androidxWindow = "1.0.0"

metalava = "0.3.2"
vanniktechPublish = "0.17.0"

[libraries]
compose-ui-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-ui-util = { module = "androidx.compose.ui:ui-util", version.ref = "compose" }
Expand All @@ -41,8 +36,8 @@ compose-animation-animation = { module = "androidx.compose.animation:animation",
snapper = "dev.chrisbanes.snapper:snapper:0.2.2"

android-gradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "gradlePlugin" }
gradleMavenPublishPlugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "vanniktechPublish" }
metalavaGradle = { module = "me.tylerbwong.gradle.metalava:plugin", version.ref = "metalava" }
gradleMavenPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.17.0"
metalavaGradle = "me.tylerbwong.gradle.metalava:plugin:0.3.2"

glide = "com.github.bumptech.glide:glide:4.12.0"

Expand All @@ -55,7 +50,7 @@ kotlin-metadataJvm = "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.3.0"
kotlin-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
kotlin-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }

dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
dokka = "org.jetbrains.dokka:dokka-gradle-plugin:1.5.0"

okhttp-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okhttp-mockWebServer = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
Expand Down Expand Up @@ -104,10 +99,3 @@ android-tools-lint-api = { module = "com.android.tools.lint:lint-api", version.r
android-tools-lint-tests = { module = "com.android.tools.lint:lint-tests", version.ref = "lintMinCompose" }

squareup-mockwebserver = "com.squareup.okhttp3:mockwebserver:4.9.3"

[plugins]
android-kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "gradlePlugin" }
jetbrains-dokka = {id = "org.jetbrains.dokka", version.ref = "dokka" }
gradle-metalava = {id = "me.tylerbwong.gradle.metalava", version.ref = "metalava" }
vanniktech-maven-publish = {id = "com.vanniktech.maven.publish", version.ref = "vanniktechPublish"}