Skip to content

Commit 8ac703d

Browse files
authored
Merge pull request #80 from piloudu/Type-safe-Gradle-projects
Implement type-safe accessors for the project implementations in Gradle files
2 parents 1b3e0a1 + 034c485 commit 8ac703d

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

app/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ android {
7777

7878
dependencies {
7979
// modules
80-
implementation(project(":core-data"))
80+
implementation(projects.coreData)
8181

8282
// modules for unit test
83-
testImplementation(project(":core-network"))
84-
testImplementation(project(":core-database"))
85-
testImplementation(project(":core-test"))
86-
androidTestImplementation(project(":core-test"))
83+
testImplementation(projects.coreNetwork)
84+
testImplementation(projects.coreDatabase)
85+
testImplementation(projects.coreTest)
86+
androidTestImplementation(projects.coreTest)
8787

8888
// androidx
8989
implementation(libs.material)

core-data/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ android {
3232
}
3333

3434
dependencies {
35-
api(project(":core-model"))
36-
implementation(project(":core-network"))
37-
implementation(project(":core-database"))
38-
testImplementation(project(":core-test"))
35+
api(projects.coreModel)
36+
implementation(projects.coreNetwork)
37+
implementation(projects.coreDatabase)
38+
testImplementation(projects.coreTest)
3939

4040
// coroutines
4141
implementation(libs.coroutines)

core-database/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ android {
4343
}
4444

4545
dependencies {
46-
implementation(project(":core-model"))
47-
testImplementation(project(":core-test"))
46+
implementation(projects.coreModel)
47+
testImplementation(projects.coreTest)
4848

4949
// coroutines
5050
implementation(libs.coroutines)

core-network/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ android {
3333
}
3434

3535
dependencies {
36-
implementation(project(":core-model"))
37-
testImplementation(project(":core-test"))
36+
implementation(projects.coreModel)
37+
testImplementation(projects.coreTest)
3838

3939
// coroutines
4040
implementation(libs.coroutines)

core-test/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ android {
3131
}
3232

3333
dependencies {
34-
implementation(project(":core-model"))
34+
implementation(projects.coreModel)
3535
implementation(libs.coroutines)
3636
implementation(libs.coroutines.test)
3737
implementation(libs.junit)

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//See the License for the specific language governing permissions and
1515
//limitations under the License.
1616

17+
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
18+
1719
pluginManagement {
1820
repositories {
1921
google()

0 commit comments

Comments
 (0)