From eabd63027729ca4e0feea8104ee59f705ffaa1f8 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Thu, 7 Mar 2024 14:45:46 +0300 Subject: [PATCH] chore: use TYPESAFE_PROJECT_ACCESSORS --- build.gradle.kts | 2 +- cache-action-entrypoint/build.gradle.kts | 12 ++++++------ cache-proxy/build.gradle.kts | 8 ++++---- cache-service-mock/build.gradle.kts | 6 +++--- gradle-launcher/build.gradle.kts | 8 ++++---- hashing/build.gradle.kts | 6 +++--- layered-cache/build.gradle.kts | 14 +++++++------- settings.gradle.kts | 2 ++ test-library/build.gradle.kts | 2 +- wrappers/actions-cache/build.gradle.kts | 2 +- wrappers/actions-toolkit/build.gradle.kts | 2 +- wrappers/nodejs/build.gradle.kts | 2 +- wrappers/octokit-request-error/build.gradle.kts | 2 +- wrappers/octokit-types/build.gradle.kts | 2 +- wrappers/octokit-webhooks/build.gradle.kts | 4 ++-- 15 files changed, 38 insertions(+), 36 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e3d5675..21dec58 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -74,7 +74,7 @@ allprojects { "commonMainApi"(platform("org.jetbrains.kotlinx:kotlinx-serialization-bom:1.6.3")) "jsMainImplementation"(enforcedPlatform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:1.0.0-pre.709")) if (project.path != ":test-library") { - "jsTestImplementation"(project(":test-library")) + "jsTestImplementation"(rootProject.projects.testLibrary) } } } diff --git a/cache-action-entrypoint/build.gradle.kts b/cache-action-entrypoint/build.gradle.kts index c6493f2..0f423dd 100644 --- a/cache-action-entrypoint/build.gradle.kts +++ b/cache-action-entrypoint/build.gradle.kts @@ -18,12 +18,12 @@ kotlin { sourceSets { jsMain { dependencies { - implementation(project(":cache-proxy")) - implementation(project(":gradle-launcher")) - implementation(project(":layered-cache")) - implementation(project(":wrappers:actions-toolkit")) - implementation(project(":wrappers:nodejs")) - implementation(project(":wrappers:octokit-webhooks")) + implementation(projects.cacheProxy) + implementation(projects.gradleLauncher) + implementation(projects.layeredCache) + implementation(projects.wrappers.actionsToolkit) + implementation(projects.wrappers.nodejs) + implementation(projects.wrappers.octokitWebhooks) implementation(npm("string-argv", "0.3.1")) } } diff --git a/cache-proxy/build.gradle.kts b/cache-proxy/build.gradle.kts index 1189050..1877972 100644 --- a/cache-proxy/build.gradle.kts +++ b/cache-proxy/build.gradle.kts @@ -21,10 +21,10 @@ kotlin { sourceSets { jsMain { dependencies { - implementation(project(":cache-service-mock")) - implementation(project(":wrappers:actions-cache")) - implementation(project(":wrappers:actions-toolkit")) - implementation(project(":wrappers:nodejs")) + implementation(projects.cacheServiceMock) + implementation(projects.wrappers.actionsCache) + implementation(projects.wrappers.actionsToolkit) + implementation(projects.wrappers.nodejs) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") implementation("org.jetbrains.kotlinx:kotlinx-serialization-core") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json") diff --git a/cache-service-mock/build.gradle.kts b/cache-service-mock/build.gradle.kts index aa4f95f..bffb40b 100644 --- a/cache-service-mock/build.gradle.kts +++ b/cache-service-mock/build.gradle.kts @@ -18,9 +18,9 @@ kotlin { sourceSets { jsMain { dependencies { - implementation(project(":wrappers:actions-cache")) - implementation(project(":wrappers:actions-toolkit")) - implementation(project(":wrappers:nodejs")) + implementation(projects.wrappers.actionsCache) + implementation(projects.wrappers.actionsToolkit) + implementation(projects.wrappers.nodejs) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") implementation("org.jetbrains.kotlinx:kotlinx-serialization-core") } diff --git a/gradle-launcher/build.gradle.kts b/gradle-launcher/build.gradle.kts index 97a3e1c..bbbeedf 100644 --- a/gradle-launcher/build.gradle.kts +++ b/gradle-launcher/build.gradle.kts @@ -18,10 +18,10 @@ kotlin { sourceSets { jsMain { dependencies { - implementation(project(":hashing")) - implementation(project(":wrappers:actions-toolkit")) - implementation(project(":wrappers:java-properties")) - implementation(project(":wrappers:nodejs")) + implementation(projects.hashing) + implementation(projects.wrappers.actionsToolkit) + implementation(projects.wrappers.javaProperties) + implementation(projects.wrappers.nodejs) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") implementation("org.jetbrains.kotlinx:kotlinx-serialization-core") } diff --git a/hashing/build.gradle.kts b/hashing/build.gradle.kts index e7d788f..04b9012 100644 --- a/hashing/build.gradle.kts +++ b/hashing/build.gradle.kts @@ -21,9 +21,9 @@ kotlin { sourceSets { jsMain { dependencies { - implementation(project(":wrappers:actions-toolkit")) - implementation(project(":wrappers:js")) - implementation(project(":wrappers:nodejs")) + implementation(projects.wrappers.actionsToolkit) + implementation(projects.wrappers.js) + implementation(projects.wrappers.nodejs) implementation("org.jetbrains.kotlinx:kotlinx-serialization-core") } } diff --git a/layered-cache/build.gradle.kts b/layered-cache/build.gradle.kts index 91c154b..5862740 100644 --- a/layered-cache/build.gradle.kts +++ b/layered-cache/build.gradle.kts @@ -22,12 +22,12 @@ kotlin { sourceSets { jsMain { dependencies { - implementation(project(":gradle-launcher")) - implementation(project(":hashing")) - implementation(project(":wrappers:actions-cache")) - implementation(project(":wrappers:actions-toolkit")) - implementation(project(":wrappers:nodejs")) - implementation(project(":wrappers:octokit-webhooks")) + implementation(projects.gradleLauncher) + implementation(projects.hashing) + implementation(projects.wrappers.actionsCache) + implementation(projects.wrappers.actionsToolkit) + implementation(projects.wrappers.nodejs) + implementation(projects.wrappers.octokitWebhooks) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") implementation("org.jetbrains.kotlinx:kotlinx-serialization-core") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json") @@ -35,7 +35,7 @@ kotlin { } jsTest { dependencies { - implementation(project(":cache-service-mock")) + implementation(projects.cacheServiceMock) } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 1e149f0..85443b0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,6 +29,8 @@ dependencyResolutionManagement { rootProject.name = "gradle-cache-action" +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + include( "cache-service-mock", "cache-proxy", diff --git a/test-library/build.gradle.kts b/test-library/build.gradle.kts index 5e328f5..6599831 100644 --- a/test-library/build.gradle.kts +++ b/test-library/build.gradle.kts @@ -19,7 +19,7 @@ kotlin { jsMain { dependencies { api(kotlin("test-js")) - implementation(project(":wrappers:nodejs")) + implementation(projects.wrappers.nodejs) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") } } diff --git a/wrappers/actions-cache/build.gradle.kts b/wrappers/actions-cache/build.gradle.kts index 6a03632..3137c40 100644 --- a/wrappers/actions-cache/build.gradle.kts +++ b/wrappers/actions-cache/build.gradle.kts @@ -19,7 +19,7 @@ kotlin { jsMain { dependencies { implementation("org.jetbrains.kotlin-wrappers:kotlin-actions-toolkit") - implementation(project(":wrappers:actions-toolkit")) + implementation(projects.wrappers.actionsToolkit) } } } diff --git a/wrappers/actions-toolkit/build.gradle.kts b/wrappers/actions-toolkit/build.gradle.kts index ef6fdda..5cec787 100644 --- a/wrappers/actions-toolkit/build.gradle.kts +++ b/wrappers/actions-toolkit/build.gradle.kts @@ -18,7 +18,7 @@ kotlin { sourceSets { jsMain { dependencies { - api(project(":wrappers:nodejs")) + api(projects.wrappers.nodejs) api("org.jetbrains.kotlin-wrappers:kotlin-actions-toolkit") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") } diff --git a/wrappers/nodejs/build.gradle.kts b/wrappers/nodejs/build.gradle.kts index f139e31..8a989f1 100644 --- a/wrappers/nodejs/build.gradle.kts +++ b/wrappers/nodejs/build.gradle.kts @@ -18,7 +18,7 @@ kotlin { sourceSets { jsMain { dependencies { - api(project(":wrappers:js")) + api(projects.wrappers.js) api("org.jetbrains.kotlin-wrappers:kotlin-node") } } diff --git a/wrappers/octokit-request-error/build.gradle.kts b/wrappers/octokit-request-error/build.gradle.kts index 9821e2b..06f4859 100644 --- a/wrappers/octokit-request-error/build.gradle.kts +++ b/wrappers/octokit-request-error/build.gradle.kts @@ -18,7 +18,7 @@ kotlin { sourceSets { jsMain { dependencies { - api(project(":wrappers:octokit-types")) + api(projects.wrappers.octokitTypes) api("org.jetbrains.kotlin-wrappers:kotlin-actions-toolkit") } } diff --git a/wrappers/octokit-types/build.gradle.kts b/wrappers/octokit-types/build.gradle.kts index 69c56c9..f2dd790 100644 --- a/wrappers/octokit-types/build.gradle.kts +++ b/wrappers/octokit-types/build.gradle.kts @@ -18,7 +18,7 @@ kotlin { sourceSets { jsMain { dependencies { - api(project(":wrappers:nodejs")) + api(projects.wrappers.nodejs) api("org.jetbrains.kotlin-wrappers:kotlin-actions-toolkit") } } diff --git a/wrappers/octokit-webhooks/build.gradle.kts b/wrappers/octokit-webhooks/build.gradle.kts index e71de22..0ce316e 100644 --- a/wrappers/octokit-webhooks/build.gradle.kts +++ b/wrappers/octokit-webhooks/build.gradle.kts @@ -18,9 +18,9 @@ kotlin { sourceSets { jsMain { dependencies { - api(project(":wrappers:octokit-request-error")) + api(projects.wrappers.octokitRequestError) api(npm("@octokit/webhooks", "10.0.8")) - implementation(project(":wrappers:actions-toolkit")) + implementation(projects.wrappers.actionsToolkit) } } }