Skip to content

Commit bf40ffc

Browse files
committed
Extract dependency sorting configuration to a function
1 parent 810769d commit bf40ffc

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
package io.technoirlab.conventions.common
22

3-
import com.squareup.sort.SortDependenciesExtension
3+
import io.technoirlab.conventions.common.configuration.configureDependencySorting
44
import org.gradle.api.Plugin
55
import org.gradle.api.Project
6-
import org.gradle.kotlin.dsl.configure
76

87
class CommonConventionPlugin : Plugin<Project> {
98
override fun apply(project: Project) = with(project) {
10-
pluginManager.apply("com.squareup.sort-dependencies")
11-
12-
extensions.configure(SortDependenciesExtension::class) {
13-
check(false)
14-
}
9+
configureDependencySorting()
1510
}
1611
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package io.technoirlab.conventions.common.configuration
2+
3+
import com.squareup.sort.SortDependenciesExtension
4+
import org.gradle.api.Project
5+
import org.gradle.kotlin.dsl.configure
6+
7+
internal fun Project.configureDependencySorting() {
8+
pluginManager.apply("com.squareup.sort-dependencies")
9+
10+
extensions.configure(SortDependenciesExtension::class) {
11+
check(false)
12+
}
13+
}

0 commit comments

Comments
 (0)