Skip to content

Commit

Permalink
Migrate FLAN to use Gradle Version Catalogs
Browse files Browse the repository at this point in the history
- Ran development/versionCatalogMigrate.sh
- Manually updated imports in build.gradle files

Test: ./gradlew tasks
Change-Id: Id8ae42ce08ee1cb847837a320eb514aedea60886
  • Loading branch information
liutikas committed May 24, 2021
1 parent e7eeca5 commit bc1dbeb
Show file tree
Hide file tree
Showing 63 changed files with 359 additions and 508 deletions.
14 changes: 5 additions & 9 deletions activity/activity-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
*/

import androidx.build.LibraryGroups
import androidx.build.LibraryVersions
import androidx.build.Publish
import androidx.build.RunApiTasks
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

import static androidx.build.dependencies.DependenciesKt.*

plugins {
id("AndroidXPlugin")
Expand All @@ -32,7 +28,7 @@ plugins {
dependencies {
kotlinPlugin projectOrArtifact(":compose:compiler:compiler")

implementation(KOTLIN_STDLIB)
implementation(libs.kotlinStdlib)
api projectOrArtifact(":compose:runtime:runtime")
api projectOrArtifact(":compose:runtime:runtime-saveable")
api(projectOrArtifact(":activity:activity-ktx"))
Expand All @@ -42,10 +38,10 @@ dependencies {
androidTestImplementation projectOrArtifact(":compose:material:material")
androidTestImplementation projectOrArtifact(":compose:test-utils")
androidTestImplementation("androidx.lifecycle:lifecycle-runtime-testing:2.3.1")
androidTestImplementation(ANDROIDX_TEST_RUNNER)
androidTestImplementation(ANDROIDX_TEST_EXT_KTX)
androidTestImplementation(JUNIT)
androidTestImplementation(TRUTH)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testExtJunitKtx)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
}

androidx {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
* limitations under the License.
*/


import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

import static androidx.build.dependencies.DependenciesKt.getKOTLIN_STDLIB

plugins {
id("AndroidXPlugin")
Expand All @@ -29,7 +25,7 @@ plugins {

dependencies {
kotlinPlugin projectOrArtifact(":compose:compiler:compiler")
implementation(KOTLIN_STDLIB)
implementation(libs.kotlinStdlib)
implementation projectOrArtifact(":activity:activity-compose")
implementation projectOrArtifact(":activity:activity-compose:activity-compose-samples")
}
Expand Down
7 changes: 1 addition & 6 deletions activity/activity-compose/samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@
* limitations under the License.
*/


import androidx.build.LibraryGroups
import androidx.build.LibraryVersions
import androidx.build.LibraryType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

import static androidx.build.dependencies.DependenciesKt.*

plugins {
id("AndroidXPlugin")
Expand All @@ -31,7 +26,7 @@ plugins {

dependencies {
kotlinPlugin projectOrArtifact(":compose:compiler:compiler")
implementation(KOTLIN_STDLIB)
implementation(libs.kotlinStdlib)

compileOnly projectOrArtifact(":annotation:annotation-sampled")
implementation projectOrArtifact(":compose:foundation:foundation")
Expand Down
16 changes: 7 additions & 9 deletions activity/activity-ktx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
* limitations under the License.
*/

import static androidx.build.dependencies.DependenciesKt.*
import androidx.build.LibraryGroups
import androidx.build.LibraryVersions
import androidx.build.Publish

plugins {
Expand All @@ -37,15 +35,15 @@ dependencies {
api("androidx.savedstate:savedstate-ktx:1.1.0") {
because 'Mirror activity dependency graph for -ktx artifacts'
}
api(KOTLIN_STDLIB)
api(libs.kotlinStdlib)

androidTestImplementation("androidx.lifecycle:lifecycle-runtime-testing:2.3.1")
androidTestImplementation(JUNIT)
androidTestImplementation(TRUTH)
androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
androidTestImplementation(ANDROIDX_TEST_CORE)
androidTestImplementation(ANDROIDX_TEST_RUNNER)
androidTestImplementation(ANDROIDX_TEST_RULES)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation(project(":internal-testutils-runtime"), {
exclude group: "androidx.activity", module: "activity"
})
Expand Down
16 changes: 7 additions & 9 deletions activity/activity-lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@
import androidx.build.LibraryGroups
import androidx.build.LibraryType

import static androidx.build.dependencies.DependenciesKt.*

plugins {
id("AndroidXPlugin")
id("kotlin")
}

dependencies {
compileOnly(LINT_API_MIN)
compileOnly(KOTLIN_STDLIB)
compileOnly(libs.androidLintMinApi)
compileOnly(libs.kotlinStdlib)

testImplementation(KOTLIN_STDLIB)
testImplementation(LINT_CORE)
testImplementation(LINT_TESTS)
testImplementation(JUNIT)
testImplementation(TRUTH)
testImplementation(libs.kotlinStdlib)
testImplementation(libs.androidLint)
testImplementation(libs.androidLintTests)
testImplementation(libs.junit)
testImplementation(libs.truth)
}

androidx {
Expand Down
18 changes: 8 additions & 10 deletions activity/activity/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import androidx.build.LibraryGroups
import androidx.build.Publish

import static androidx.build.dependencies.DependenciesKt.*

plugins {
id("AndroidXPlugin")
id("com.android.library")
Expand All @@ -26,14 +24,14 @@ dependencies {
implementation("androidx.tracing:tracing:1.0.0")

androidTestImplementation("androidx.lifecycle:lifecycle-runtime-testing:2.3.1")
androidTestImplementation(KOTLIN_STDLIB)
androidTestImplementation(LEAKCANARY)
androidTestImplementation(LEAKCANARY_INSTRUMENTATION)
androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
androidTestImplementation(ANDROIDX_TEST_CORE)
androidTestImplementation(ANDROIDX_TEST_RUNNER)
androidTestImplementation(ANDROIDX_TEST_RULES)
androidTestImplementation(TRUTH)
androidTestImplementation(libs.kotlinStdlib)
androidTestImplementation(libs.leakcanary)
androidTestImplementation(libs.leakcanaryInstrumentation)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.truth)
androidTestImplementation(project(":internal-testutils-runtime"), {
exclude group: "androidx.activity", module: "activity"
})
Expand Down
18 changes: 8 additions & 10 deletions activity/integration-tests/testapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import static androidx.build.dependencies.DependenciesKt.*

plugins {
id("AndroidXPlugin")
id("com.android.application")
Expand All @@ -33,12 +31,12 @@ android {
dependencies {
implementation(project(":activity:activity-ktx"))
implementation(projectOrArtifact(":lifecycle:lifecycle-runtime-ktx"))
androidTestImplementation(KOTLIN_STDLIB)
androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
androidTestImplementation(ANDROIDX_TEST_CORE)
androidTestImplementation(ANDROIDX_TEST_RUNNER)
androidTestImplementation(ANDROIDX_TEST_RULES)
androidTestImplementation(ESPRESSO_CORE)
androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) // DexMaker has it's own MockMaker
androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) // DexMaker has it's own MockMaker
androidTestImplementation(libs.kotlinStdlib)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.espressoCore)
androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it's own MockMaker
androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it's own MockMaker
}
4 changes: 1 addition & 3 deletions development/versionCatalogMigrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
find -iname build.gradle | xargs sed -i "s/AGP_LATEST/libs.androidGradlePlugin/"
find -iname build.gradle | xargs sed -i "s/LINT_CORE/libs.androidLint/"
find -iname build.gradle | xargs sed -i "s/LINT_API_LATEST/libs.androidLintApi/"
find -iname build.gradle | xargs sed -i "s/LINT_API_MIN/libs.androidLintMinApi/"
find -iname build.gradle | xargs sed -i "s/LINT_TESTS/libs.androidLintTests/"
find -iname build.gradle | xargs sed -i "s/AUTO_COMMON/libs.autoCommon/"
find -iname build.gradle | xargs sed -i "s/AUTO_SERVICE_ANNOTATIONS/libs.autoServiceAnnotations/"
Expand Down Expand Up @@ -64,9 +65,6 @@ find -iname build.gradle | xargs sed -i "s/KOTLIN_TEST_JUNIT/libs.kotlinTestJuni
find -iname build.gradle | xargs sed -i "s/KOTLIN_TEST_JS/libs.kotlinTestJs/"
find -iname build.gradle | xargs sed -i "s/KOTLIN_TEST/libs.kotlinTest/"
find -iname build.gradle | xargs sed -i "s/KOTLIN_REFLECT/libs.kotlinReflect/"
find -iname build.gradle | xargs sed -i "s/KOTLINPOET_METADATA/libs.kotlinPoetMetadata/"
find -iname build.gradle | xargs sed -i "s/KOTLINPOET_METADATA_SPECS/libs.kotlinPoetMetadataSpecs/"
find -iname build.gradle | xargs sed -i "s/KOTLINPOET_CLASSINSPECTOR_ELEMENTS/libs.kotlinPoetClassinspector/"
find -iname build.gradle | xargs sed -i "s/KOTLINPOET/libs.kotlinPoet/"
find -iname build.gradle | xargs sed -i "s/LEAKCANARY_INSTRUMENTATION/libs.leakcanaryInstrumentation/"
find -iname build.gradle | xargs sed -i "s/LEAKCANARY/libs.leakcanary/"
Expand Down
16 changes: 7 additions & 9 deletions fragment/fragment-ktx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
* limitations under the License.
*/

import static androidx.build.dependencies.DependenciesKt.*
import androidx.build.LibraryGroups
import androidx.build.LibraryVersions
import androidx.build.Publish

plugins {
Expand All @@ -43,13 +41,13 @@ dependencies {
api("androidx.savedstate:savedstate-ktx:1.1.0") {
because 'Mirror fragment dependency graph for -ktx artifacts'
}
api(KOTLIN_STDLIB)
androidTestImplementation(JUNIT)
androidTestImplementation(TRUTH)
androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
androidTestImplementation(ANDROIDX_TEST_CORE)
androidTestImplementation(ANDROIDX_TEST_RUNNER)
androidTestImplementation(ANDROIDX_TEST_RULES)
api(libs.kotlinStdlib)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation(project(":internal-testutils-runtime"), {
exclude group: "androidx.fragment", module: "fragment"
})
Expand Down
14 changes: 7 additions & 7 deletions fragment/fragment-lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ plugins {
}

dependencies {
compileOnly(LINT_API_MIN)
compileOnly(KOTLIN_STDLIB)
compileOnly(libs.androidLintMinApi)
compileOnly(libs.kotlinStdlib)

testImplementation(KOTLIN_STDLIB)
testImplementation(LINT_CORE)
testImplementation(LINT_TESTS)
testImplementation(JUNIT)
testImplementation(TRUTH)
testImplementation(libs.kotlinStdlib)
testImplementation(libs.androidLint)
testImplementation(libs.androidLintTests)
testImplementation(libs.junit)
testImplementation(libs.truth)
}

androidx {
Expand Down
16 changes: 7 additions & 9 deletions fragment/fragment-testing-lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@
import androidx.build.LibraryGroups
import androidx.build.LibraryType

import static androidx.build.dependencies.DependenciesKt.*

plugins {
id("AndroidXPlugin")
id("kotlin")
}

dependencies {
compileOnly(LINT_API_MIN)
compileOnly(KOTLIN_STDLIB)
compileOnly(libs.androidLintMinApi)
compileOnly(libs.kotlinStdlib)

testImplementation(KOTLIN_STDLIB)
testImplementation(LINT_CORE)
testImplementation(LINT_TESTS)
testImplementation(JUNIT)
testImplementation(TRUTH)
testImplementation(libs.kotlinStdlib)
testImplementation(libs.androidLint)
testImplementation(libs.androidLintTests)
testImplementation(libs.junit)
testImplementation(libs.truth)
}

androidx {
Expand Down
24 changes: 11 additions & 13 deletions fragment/fragment-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
* limitations under the License.
*/

import static androidx.build.dependencies.DependenciesKt.*
import androidx.build.LibraryGroups
import androidx.build.LibraryVersions
import androidx.build.Publish

plugins {
Expand All @@ -27,17 +25,17 @@ plugins {

dependencies {
api(project(":fragment:fragment-ktx"))
api(ANDROIDX_TEST_CORE)
api(KOTLIN_STDLIB)
androidTestImplementation(KOTLIN_STDLIB)
androidTestImplementation(ESPRESSO_CORE)
androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
androidTestImplementation(ANDROIDX_TEST_CORE)
androidTestImplementation(ANDROIDX_TEST_RUNNER)
androidTestImplementation(ANDROIDX_TEST_RULES)
androidTestImplementation(TRUTH)
androidTestImplementation(MOCKITO_CORE, excludes.bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(DEXMAKER_MOCKITO, excludes.bytebuddy) // DexMaker has it"s own MockMaker
api(libs.testCore)
api(libs.kotlinStdlib)
androidTestImplementation(libs.kotlinStdlib)
androidTestImplementation(libs.espressoCore)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it"s own MockMaker

lintPublish(project(":fragment:fragment-testing-lint"))
}
Expand Down
18 changes: 8 additions & 10 deletions fragment/fragment-truth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
* limitations under the License.
*/

import static androidx.build.dependencies.DependenciesKt.*
import androidx.build.LibraryGroups
import androidx.build.LibraryVersions
import androidx.build.Publish

plugins {
Expand All @@ -27,14 +25,14 @@ plugins {

dependencies {
api(project(":fragment:fragment-ktx"))
api(TRUTH)
api(KOTLIN_STDLIB)
androidTestImplementation(JUNIT)
androidTestImplementation(TRUTH)
androidTestImplementation(ANDROIDX_TEST_CORE)
androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
androidTestImplementation(ANDROIDX_TEST_RULES)
androidTestImplementation(ANDROIDX_TEST_RUNNER)
api(libs.truth)
api(libs.kotlinStdlib)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.testRunner)
androidTestImplementation(project(":internal-testutils-truth"))
}

Expand Down
Loading

0 comments on commit bc1dbeb

Please sign in to comment.