diff --git a/config/git/hooks/pre-commit b/config/git/hooks/pre-commit index e7e2ae584..f574ed59e 100755 --- a/config/git/hooks/pre-commit +++ b/config/git/hooks/pre-commit @@ -64,20 +64,21 @@ original_partially_staged_chksum=$(partially_staged_chksum) original_partially_staged_filenames=$(echo "$original_partially_staged_chksum" | grep -oE '[^ ]+$') #### Sort Dependencies section +# Enable this if you use gradle-dependency-sorter # Get a list of staged build.gradle.kts files -kts_files_list="$(git diff --cached --name-only --diff-filter=ACMR "-G.*" | grep -Ei "build\.gradle\.kts$" )" -if [[ ! -z ${kts_files_list} ]]; then - # We have some build files! Join them to a string delimited on space. We'll pass these to sortDependencies - kts_files_list="$(echo ${kts_files_list} | paste -sd " " -)" - "${REPO_ROOT_DIR}/config/bin/sort-dependencies" ${kts_files_list} &> /dev/null - if [[ $? != 0 ]]; then - # Something it couldn't handle came up. Show the command and run verbosely for local debugging. - echo -e "${RED}sort-dependencies failed, re-running verbosely. Alternatively, you can run the command locally" >&2 - echo -e "Running format command: './config/bin/sort-dependencies --verbose ${kts_files_list}'${NC}" >&2 - "${REPO_ROOT_DIR}/config/bin/sort-dependencies --verbose" ${kts_files_list} >&2 - exit $? - fi -fi +#kts_files_list="$(git diff --cached --name-only --diff-filter=ACMR "-G.*" | grep -Ei "build\.gradle\.kts$" )" +#if [[ ! -z ${kts_files_list} ]]; then +# # We have some build files! Join them to a string delimited on space. We'll pass these to sortDependencies +# kts_files_list="$(echo ${kts_files_list} | paste -sd " " -)" +# "${REPO_ROOT_DIR}/config/bin/sort-dependencies" ${kts_files_list} &> /dev/null +# if [[ $? != 0 ]]; then +# # Something it couldn't handle came up. Show the command and run verbosely for local debugging. +# echo -e "${RED}sort-dependencies failed, re-running verbosely. Alternatively, you can run the command locally" >&2 +# echo -e "Running format command: './config/bin/sort-dependencies --verbose ${kts_files_list}'${NC}" >&2 +# "${REPO_ROOT_DIR}/config/bin/sort-dependencies --verbose" ${kts_files_list} >&2 +# exit $? +# fi +#fi # TODO eventually support detekt here too once we can wire baseline and config files #### ktfmt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 285335a4f..a6df22d3a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -39,7 +39,7 @@ okhttp = "5.0.0-alpha.12" okio = "3.9.1" retrofit = "2.11.0" slack-lint = "0.8.2" -sortDependencies = "0.7" +sortDependencies = "0.12" spotless = "7.0.0.BETA4" sqldelight = "2.0.2" versionsPlugin = "0.51.0" diff --git a/platforms/gradle/agp-handlers/agp-handler-api/build.gradle.kts b/platforms/gradle/agp-handlers/agp-handler-api/build.gradle.kts index 30ec00960..37e85e812 100644 --- a/platforms/gradle/agp-handlers/agp-handler-api/build.gradle.kts +++ b/platforms/gradle/agp-handlers/agp-handler-api/build.gradle.kts @@ -20,7 +20,6 @@ plugins { } dependencies { - lintChecks(libs.gradleLints) implementation(projects.tools.versionNumber) compileOnly(gradleApi()) @@ -30,4 +29,6 @@ dependencies { testImplementation(libs.agp) testImplementation(libs.junit) testImplementation(libs.truth) + + lintChecks(libs.gradleLints) } diff --git a/platforms/gradle/foundry-gradle-plugin/build.gradle.kts b/platforms/gradle/foundry-gradle-plugin/build.gradle.kts index 3840725dd..c985c8ccc 100644 --- a/platforms/gradle/foundry-gradle-plugin/build.gradle.kts +++ b/platforms/gradle/foundry-gradle-plugin/build.gradle.kts @@ -69,8 +69,6 @@ dependencies.constraints { } dependencies { - lintChecks(libs.gradleLints) - api(platform(libs.okhttp.bom)) api(libs.okhttp) // Better I/O @@ -134,4 +132,6 @@ dependencies { testImplementation(libs.junit) testImplementation(libs.okio.fakefilesystem) testImplementation(libs.truth) + + lintChecks(libs.gradleLints) } diff --git a/platforms/intellij/skate/build.gradle.kts b/platforms/intellij/skate/build.gradle.kts index 9a11fd5b5..f02a4447e 100644 --- a/platforms/intellij/skate/build.gradle.kts +++ b/platforms/intellij/skate/build.gradle.kts @@ -118,19 +118,6 @@ configurations .configureEach { attributes { attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) } } dependencies { - lintChecks(libs.composeLints) - - compileOnly(libs.coroutines.core.ij) - - implementation(libs.bugsnag) - implementation(libs.okio) - implementation(libs.kaml) - implementation(libs.kotlinx.serialization.core) - implementation(libs.okhttp) - implementation(libs.okhttp.loggingInterceptor) - implementation(projects.platforms.intellij.compose, exclusions) - implementation(projects.tools.tracing, exclusions) - intellijPlatform { // https://plugins.jetbrains.com/docs/intellij/android-studio.html#open-source-plugins-for-android-studio // https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html @@ -151,6 +138,20 @@ dependencies { testFramework(TestFrameworkType.Bundled) } + implementation(projects.platforms.intellij.compose, exclusions) + implementation(projects.tools.tracing, exclusions) + + implementation(libs.bugsnag) + implementation(libs.kaml) + implementation(libs.kotlinx.serialization.core) + implementation(libs.okhttp) + implementation(libs.okhttp.loggingInterceptor) + implementation(libs.okio) + + compileOnly(libs.coroutines.core.ij) + testImplementation(libs.junit) testImplementation(libs.truth) + + lintChecks(libs.composeLints) } diff --git a/tools/cli/build.gradle.kts b/tools/cli/build.gradle.kts index ff52f41ac..71400a506 100644 --- a/tools/cli/build.gradle.kts +++ b/tools/cli/build.gradle.kts @@ -43,8 +43,6 @@ if (System.getenv("CI") != null) { } dependencies { - ksp(libs.autoService.ksp) - api(libs.clikt) implementation(libs.autoService.annotations) @@ -63,4 +61,6 @@ dependencies { testImplementation(libs.junit) testImplementation(libs.truth) + + ksp(libs.autoService.ksp) }