From ebb0e9e340ef36fef165cee232f5ef658f34e54f Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Fri, 17 Jun 2022 13:21:08 +0200 Subject: [PATCH] Convert all samples to Groovy DSL --- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 2 +- .../{build.gradle.kts => build.gradle} | 2 +- .../my-project/data-model/build.gradle | 7 +++ .../my-project/data-model/build.gradle.kts | 7 --- .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../main/groovy/my-java-application.gradle | 11 ++++ .../my-java-library.gradle} | 4 +- .../kotlin/my-java-application.gradle.kts | 11 ---- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../main/groovy/my-java-application.gradle | 7 +++ .../src/main/groovy/my-java-library.gradle | 7 +++ .../kotlin/my-java-application.gradle.kts | 7 --- .../main/kotlin/my-java-library.gradle.kts | 7 --- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/build.gradle | 3 ++ .../my-build-logic/build.gradle.kts | 3 -- .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 2 +- .../my-java-base.gradle} | 14 ++--- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-other-project/build.gradle | 3 ++ .../my-other-project/build.gradle.kts | 3 -- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 05_Lifecycle_Tasks/my-project/build.gradle | 17 +++++++ .../my-project/build.gradle.kts | 17 ------- .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 6 +-- .../src/main/groovy/my-java-base.gradle | 7 +++ .../my-java-library.gradle} | 0 .../src/main/kotlin/my-java-base.gradle.kts | 7 --- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 8 +-- .../src/main/groovy/my-java-base.gradle | 7 +++ .../my-java-library.gradle} | 0 .../tasks/GenerateStartScript.groovy | 36 +++++++++++++ .../myproject/tasks/MyAppExtension.groovy} | 2 +- .../src/main/kotlin/my-java-base.gradle.kts | 7 --- .../myproject/tasks/GenerateStartScript.kt | 35 ------------- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 21 ++++---- .../my-java-library.gradle} | 0 .../my-root-project.gradle} | 2 +- .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 20 ++++---- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../src/main/groovy/metadata-rules.gradle | 6 +++ .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 4 +- .../my-java-library.gradle} | 0 .../metadatarules/Slf4JImplRule.groovy} | 7 +-- .../src/main/kotlin/metadata-rules.gradle.kts | 6 --- .../{settings.gradle.kts => settings.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../my-java-library.gradle} | 15 +++--- .../{settings.gradle.kts => settings.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 4 +- .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../main/groovy/my-java-application.gradle | 22 ++++++++ .../src/main/groovy/my-java-base.gradle | 26 ++++++++++ .../my-java-library.gradle} | 0 .../kotlin/my-java-application.gradle.kts | 22 -------- .../src/main/kotlin/my-java-base.gradle.kts | 26 ---------- .../{settings.gradle.kts => settings.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle | 12 ++--- .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../my-android-application.gradle} | 2 +- .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 4 +- .../my-java-base.gradle} | 29 +++++------ .../my-java-library.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../my-kotlin-multiplatform-lib.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle} | 12 ++--- .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 4 +- .../my-java-library.gradle} | 36 ++++++------- .../{settings.gradle.kts => settings.gradle} | 0 .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle | 12 ++--- .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 17 +++---- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle | 12 ++--- .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 9 ++-- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle | 12 ++--- .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../my-java-library.gradle} | 2 +- .../{settings.gradle.kts => settings.gradle} | 0 .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle | 20 ++++++++ .../my-project-structure.settings.gradle.kts | 20 -------- .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 26 +++++----- .../my-java-base.gradle} | 16 +++--- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle | 20 ++++++++ .../my-project-structure.settings.gradle.kts | 20 -------- .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 8 +-- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle | 20 ++++++++ .../my-project-structure.settings.gradle.kts | 20 -------- .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../my-java-library.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 12 ++--- .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../main/groovy/my-java-application.gradle | 4 ++ .../src/main/groovy/my-java-base.gradle | 23 +++++++++ .../src/main/groovy/my-java-library.gradle | 4 ++ .../src/main/kotlin/my-java-base.gradle.kts | 23 --------- .../my-build-logic/settings.gradle | 4 +- .../structure-plugins/build.gradle | 3 ++ .../structure-plugins/build.gradle.kts | 3 -- .../my-project-structure.settings.gradle | 20 ++++++++ .../my-project-structure.settings.gradle.kts | 20 -------- .../my-project/app/build.gradle | 11 ++++ .../my-project/app/build.gradle.kts | 11 ---- .../my-project/business-logic/build.gradle | 9 ++++ .../my-project/data-model/build.gradle | 3 ++ .../my-project/settings.gradle | 6 +++ .../{build.gradle.kts => build.gradle} | 0 .../my-build-logic/settings.gradle | 0 .../{build.gradle.kts => build.gradle} | 0 .../MyProjectStructureSettingsPlugin.java | 4 +- .../app/{build.gradle.kts => build.gradle} | 0 .../my-project/business-logic/build.gradle | 0 .../business-logic/build.gradle.kts | 9 ---- .../my-project/data-model/build.gradle | 0 .../my-project/data-model/build.gradle.kts | 3 -- .../my-project/settings.gradle | 0 .../my-project/settings.gradle.kts | 6 --- .../{build.gradle.kts => build.gradle} | 24 ++++----- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 20 ++++---- .../module/{build.gradle.kts => build.gradle} | 20 ++++---- .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../main/groovy/my-java-application.gradle | 0 .../src/main/groovy/my-java-base.gradle | 51 +++++++++++++++++++ .../src/main/groovy/my-java-library.gradle | 0 .../my-root.gradle} | 0 .../kotlin/my-java-application.gradle.kts | 4 -- .../src/main/kotlin/my-java-base.gradle.kts | 50 ------------------ .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../module/{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../src/main/groovy/my-java-library.gradle | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../module/{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../my-java-application.gradle} | 2 +- .../my-java-base.gradle} | 12 ++--- .../src/main/groovy/my-java-library.gradle | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../module/{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../src/main/groovy/my-java-library.gradle | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 8 +-- .../src/main/groovy/my-java-library.gradle | 0 .../org/example/JavaModuleTransform.groovy} | 30 ++++++----- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../{build.gradle.kts => build.gradle} | 2 +- .../my-java-application.gradle} | 0 .../my-java-base.gradle} | 2 +- .../src/main/groovy/my-java-library.gradle | 0 .../main/kotlin/my-java-library.gradle.kts | 4 -- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 12 ++--- .../org/example/ApplicationReportTask.groovy | 36 +++++++++++++ .../org/example/MyEnum.groovy} | 2 +- .../org/example/ApplicationReportTask.kt | 36 ------------- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../my-java-application.gradle} | 16 +++--- .../org/example/GenerateStartScript.groovy | 43 ++++++++++++++++ .../kotlin/org/example/GenerateStartScript.kt | 44 ---------------- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 .../my-build-logic/java-plugins/build.gradle | 3 ++ .../java-plugins/build.gradle.kts | 3 -- .../PrintVersion.groovy} | 8 +-- .../my-java-application.gradle} | 5 +- .../{settings.gradle.kts => settings.gradle} | 0 .../app/{build.gradle.kts => build.gradle} | 0 .../{settings.gradle.kts => settings.gradle} | 0 417 files changed, 803 insertions(+), 805 deletions(-) rename 01_The_Settings_File/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 02_The_Build_Files/my-project/app/{build.gradle.kts => build.gradle} (63%) rename 02_The_Build_Files/my-project/business-logic/{build.gradle.kts => build.gradle} (72%) create mode 100644 02_The_Build_Files/my-project/data-model/build.gradle delete mode 100644 02_The_Build_Files/my-project/data-model/build.gradle.kts rename 02_The_Build_Files/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 03_Plugins/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (76%) create mode 100644 03_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle rename 03_Plugins/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (61%) delete mode 100644 03_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename 03_Plugins/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 03_Plugins/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 03_Plugins/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 03_Plugins/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 03_Plugins/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 04_Tasks/my-build-logic/java-plugins/build.gradle delete mode 100644 04_Tasks/my-build-logic/java-plugins/build.gradle.kts create mode 100644 04_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle create mode 100644 04_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle delete mode 100644 04_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts delete mode 100644 04_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename 04_Tasks/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 04_Tasks/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 04_Tasks/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 04_Tasks/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 04_Tasks/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 05_Lifecycle_Tasks/my-build-logic/build.gradle delete mode 100644 05_Lifecycle_Tasks/my-build-logic/build.gradle.kts create mode 100644 05_Lifecycle_Tasks/my-build-logic/java-plugins/build.gradle delete mode 100644 05_Lifecycle_Tasks/my-build-logic/java-plugins/build.gradle.kts rename 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (73%) rename 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (86%) rename 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 05_Lifecycle_Tasks/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 05_Lifecycle_Tasks/my-other-project/build.gradle delete mode 100644 05_Lifecycle_Tasks/my-other-project/build.gradle.kts rename 05_Lifecycle_Tasks/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 05_Lifecycle_Tasks/my-project/app/{build.gradle.kts => build.gradle} (100%) create mode 100644 05_Lifecycle_Tasks/my-project/build.gradle delete mode 100644 05_Lifecycle_Tasks/my-project/build.gradle.kts rename 05_Lifecycle_Tasks/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 05_Lifecycle_Tasks/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 05_Lifecycle_Tasks/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/build.gradle delete mode 100644 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/build.gradle.kts rename 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (75%) create mode 100644 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle rename 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) delete mode 100644 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 06_Configuring_Task_Inputs_And_Outputs/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 06_Configuring_Task_Inputs_And_Outputs/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 06_Configuring_Task_Inputs_And_Outputs/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 06_Configuring_Task_Inputs_And_Outputs/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/build.gradle delete mode 100644 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/build.gradle.kts rename 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (70%) create mode 100644 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle rename 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) create mode 100644 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/myproject/tasks/GenerateStartScript.groovy rename 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/{kotlin/myproject/tasks/MyAppExtension.kt => groovy/myproject/tasks/MyAppExtension.groovy} (72%) delete mode 100644 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts delete mode 100644 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/myproject/tasks/GenerateStartScript.kt rename 07_Implementing_Tasks_and_Extensions/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 07_Implementing_Tasks_and_Extensions/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 07_Implementing_Tasks_and_Extensions/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 07_Implementing_Tasks_and_Extensions/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 07_Implementing_Tasks_and_Extensions/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 08_Declaring_Dependencis/my-build-logic/java-plugins/build.gradle delete mode 100644 08_Declaring_Dependencis/my-build-logic/java-plugins/build.gradle.kts rename 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (84%) rename 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 08_Declaring_Dependencis/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 08_Declaring_Dependencis/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 08_Declaring_Dependencis/my-other-project/shared-utils/{build.gradle.kts => build.gradle} (100%) rename 08_Declaring_Dependencis/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 08_Declaring_Dependencis/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 08_Declaring_Dependencis/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 08_Declaring_Dependencis/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/build.gradle delete mode 100644 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/build.gradle.kts rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (80%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/shared-utils/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (83%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (71%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/shared-utils/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/shared-platform/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/build.gradle delete mode 100644 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/build.gradle.kts rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (52%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/shared-utils/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/build.gradle delete mode 100644 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/build.gradle.kts rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (62%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/{kotlin/my-root-project.gradle.kts => groovy/my-root-project.gradle} (88%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/shared-utils/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/build.gradle delete mode 100644 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/build.gradle.kts rename 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (51%) rename 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 10_Dependency_Version_Conflicts/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 10_Dependency_Version_Conflicts/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 10_Dependency_Version_Conflicts/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 10_Dependency_Version_Conflicts/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 10_Dependency_Version_Conflicts/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 10_Dependency_Version_Conflicts/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 11_Capability_Conflicts/my-build-logic/java-plugins/build.gradle delete mode 100644 11_Capability_Conflicts/my-build-logic/java-plugins/build.gradle.kts create mode 100644 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/metadata-rules.gradle rename 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (90%) rename 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/{kotlin/myproject/metadatarules/Slf4JImplRule.kt => groovy/myproject/metadatarules/Slf4JImplRule.groovy} (67%) delete mode 100644 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/metadata-rules.gradle.kts rename 11_Capability_Conflicts/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 11_Capability_Conflicts/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 11_Capability_Conflicts/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 11_Capability_Conflicts/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 11_Capability_Conflicts/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 11_Capability_Conflicts/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 12_Publishing_Libraries/my-build-logic/java-plugins/build.gradle delete mode 100644 12_Publishing_Libraries/my-build-logic/java-plugins/build.gradle.kts rename 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (84%) rename 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (51%) rename 12_Publishing_Libraries/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 12_Publishing_Libraries/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 12_Publishing_Libraries/my-other-project/shared-utils/{build.gradle.kts => build.gradle} (100%) rename 12_Publishing_Libraries/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 12_Publishing_Libraries/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 12_Publishing_Libraries/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 12_Publishing_Libraries/my-project/{settings.gradle.kts => settings.gradle} (81%) create mode 100644 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/build.gradle delete mode 100644 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/build.gradle.kts create mode 100644 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle create mode 100644 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle rename 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) delete mode 100644 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts delete mode 100644 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename 13_Aggregating_Custom_Artifacts/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 13_Aggregating_Custom_Artifacts/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 13_Aggregating_Custom_Artifacts/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 13_Aggregating_Custom_Artifacts/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 13_Aggregating_Custom_Artifacts/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 13_Aggregating_Custom_Artifacts/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 14_Settings_Plugins/my-build-logic/java-plugins/build.gradle delete mode 100644 14_Settings_Plugins/my-build-logic/java-plugins/build.gradle.kts rename 14_Settings_Plugins/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 14_Settings_Plugins/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (73%) rename 14_Settings_Plugins/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 14_Settings_Plugins/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 14_Settings_Plugins/my-build-logic/structure-plugins/build.gradle delete mode 100644 14_Settings_Plugins/my-build-logic/structure-plugins/build.gradle.kts rename 18_Configuring_Testing/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts => 14_Settings_Plugins/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle (56%) rename 14_Settings_Plugins/my-other-project/{settings.gradle.kts => settings.gradle} (100%) rename 14_Settings_Plugins/my-other-project/shared-utils/{build.gradle.kts => build.gradle} (100%) rename 14_Settings_Plugins/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 14_Settings_Plugins/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 14_Settings_Plugins/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 14_Settings_Plugins/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 16_Source_Sets/my-android-project/app-android/{build.gradle.kts => build.gradle} (100%) rename 16_Source_Sets/my-android-project/{settings.gradle.kts => settings.gradle} (100%) rename 16_Source_Sets/my-build-logic/android-plugins/{build.gradle.kts => build.gradle} (75%) rename 16_Source_Sets/my-build-logic/android-plugins/src/main/{kotlin/my-android-application.gradle.kts => groovy/my-android-application.gradle} (88%) create mode 100644 16_Source_Sets/my-build-logic/java-plugins/build.gradle delete mode 100644 16_Source_Sets/my-build-logic/java-plugins/build.gradle.kts rename 16_Source_Sets/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (67%) rename 16_Source_Sets/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (51%) rename 16_Source_Sets/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 16_Source_Sets/my-build-logic/kotlin-plugins/{build.gradle.kts => build.gradle} (77%) rename 16_Source_Sets/my-build-logic/kotlin-plugins/src/main/{kotlin/my-kotlin-multiplatform-lib.gradle.kts => groovy/my-kotlin-multiplatform-lib.gradle} (100%) rename 16_Source_Sets/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 16_Source_Sets/my-build-logic/structure-plugins/build.gradle delete mode 100644 16_Source_Sets/my-build-logic/structure-plugins/build.gradle.kts rename 16_Source_Sets/my-build-logic/structure-plugins/src/main/{kotlin/my-project-structure.settings.gradle.kts => groovy/my-project-structure.settings.gradle} (64%) rename 16_Source_Sets/my-kotlin-multi-platform-project/{settings.gradle.kts => settings.gradle} (100%) rename 16_Source_Sets/my-kotlin-multi-platform-project/utils-kotlin/{build.gradle.kts => build.gradle} (100%) rename 16_Source_Sets/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 16_Source_Sets/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 16_Source_Sets/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 16_Source_Sets/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 17_Feature_Variants/my-build-logic/java-plugins/build.gradle delete mode 100644 17_Feature_Variants/my-build-logic/java-plugins/build.gradle.kts rename 17_Feature_Variants/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 17_Feature_Variants/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (66%) rename 17_Feature_Variants/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (69%) rename 17_Feature_Variants/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 17_Feature_Variants/my-build-logic/structure-plugins/build.gradle delete mode 100644 17_Feature_Variants/my-build-logic/structure-plugins/build.gradle.kts rename 19_The_Test_Task/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts => 17_Feature_Variants/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle (56%) rename 17_Feature_Variants/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 17_Feature_Variants/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 17_Feature_Variants/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 17_Feature_Variants/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 18_Configuring_Testing/my-build-logic/java-plugins/build.gradle delete mode 100644 18_Configuring_Testing/my-build-logic/java-plugins/build.gradle.kts rename 18_Configuring_Testing/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 18_Configuring_Testing/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (83%) rename 18_Configuring_Testing/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 18_Configuring_Testing/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 18_Configuring_Testing/my-build-logic/structure-plugins/build.gradle delete mode 100644 18_Configuring_Testing/my-build-logic/structure-plugins/build.gradle.kts rename 17_Feature_Variants/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts => 18_Configuring_Testing/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle (56%) rename 18_Configuring_Testing/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 18_Configuring_Testing/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 18_Configuring_Testing/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 18_Configuring_Testing/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 19_The_Test_Task/my-build-logic/java-plugins/build.gradle delete mode 100644 19_The_Test_Task/my-build-logic/java-plugins/build.gradle.kts rename 19_The_Test_Task/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 19_The_Test_Task/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (83%) rename 19_The_Test_Task/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 19_The_Test_Task/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 19_The_Test_Task/my-build-logic/structure-plugins/build.gradle delete mode 100644 19_The_Test_Task/my-build-logic/structure-plugins/build.gradle.kts rename 14_Settings_Plugins/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts => 19_The_Test_Task/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle (56%) rename 19_The_Test_Task/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 19_The_Test_Task/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 19_The_Test_Task/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 19_The_Test_Task/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 20_Test_Fixtures/my-build-logic/java-plugins/build.gradle delete mode 100644 20_Test_Fixtures/my-build-logic/java-plugins/build.gradle.kts rename 20_Test_Fixtures/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 20_Test_Fixtures/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (89%) rename 20_Test_Fixtures/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (81%) rename 20_Test_Fixtures/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 20_Test_Fixtures/my-build-logic/structure-plugins/build.gradle delete mode 100644 20_Test_Fixtures/my-build-logic/structure-plugins/build.gradle.kts create mode 100644 20_Test_Fixtures/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle delete mode 100644 20_Test_Fixtures/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts rename 20_Test_Fixtures/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 20_Test_Fixtures/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 20_Test_Fixtures/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 20_Test_Fixtures/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/build.gradle delete mode 100644 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/build.gradle.kts rename 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (63%) rename 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (71%) rename 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 21_Test_and_Code_Coverage_Reporting/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/build.gradle delete mode 100644 21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/build.gradle.kts create mode 100644 21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle delete mode 100644 21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts rename 21_Test_and_Code_Coverage_Reporting/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 21_Test_and_Code_Coverage_Reporting/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 21_Test_and_Code_Coverage_Reporting/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 21_Test_and_Code_Coverage_Reporting/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 22_The_JavaCompile_Task/my-build-logic/java-plugins/build.gradle delete mode 100644 22_The_JavaCompile_Task/my-build-logic/java-plugins/build.gradle.kts rename 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (87%) rename 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 22_The_JavaCompile_Task/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 22_The_JavaCompile_Task/my-build-logic/structure-plugins/build.gradle delete mode 100644 22_The_JavaCompile_Task/my-build-logic/structure-plugins/build.gradle.kts create mode 100644 22_The_JavaCompile_Task/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle delete mode 100644 22_The_JavaCompile_Task/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts rename 22_The_JavaCompile_Task/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 22_The_JavaCompile_Task/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 22_The_JavaCompile_Task/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 22_The_JavaCompile_Task/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 23_Caching/my-build-logic/java-plugins/build.gradle delete mode 100644 23_Caching/my-build-logic/java-plugins/build.gradle.kts rename 23_Caching/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 23_Caching/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (75%) rename 23_Caching/my-build-logic/java-plugins/src/main/{kotlin/my-java-library.gradle.kts => groovy/my-java-library.gradle} (100%) rename 23_Caching/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 23_Caching/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 23_Caching/my-project/business-logic/{build.gradle.kts => build.gradle} (100%) rename 23_Caching/my-project/data-model/{build.gradle.kts => build.gradle} (100%) rename 23_Caching/my-project/{settings.gradle.kts => settings.gradle} (55%) create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/build.gradle delete mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/build.gradle.kts create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle delete mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename 25_Using_Java_to_configure_builds/my-build-logic/settings.gradle.kts => 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/settings.gradle (58%) create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/build.gradle delete mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/build.gradle.kts create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle delete mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-project/app/build.gradle delete mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-project/app/build.gradle.kts create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-project/business-logic/build.gradle create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-project/data-model/build.gradle create mode 100644 24_Kotlin_DSL_and_Groovy_DSL/my-project/settings.gradle rename 25_Using_Java_to_configure_builds/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (100%) rename 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/settings.gradle.kts => 25_Using_Java_to_configure_builds/my-build-logic/settings.gradle (100%) rename 25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/{build.gradle.kts => build.gradle} (100%) rename 25_Using_Java_to_configure_builds/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 24_Kotlin_DSL_and_Groovy_DSL/my-project/business-logic/build.gradle.kts => 25_Using_Java_to_configure_builds/my-project/business-logic/build.gradle (100%) delete mode 100644 25_Using_Java_to_configure_builds/my-project/business-logic/build.gradle.kts rename 24_Kotlin_DSL_and_Groovy_DSL/my-project/data-model/build.gradle.kts => 25_Using_Java_to_configure_builds/my-project/data-model/build.gradle (100%) delete mode 100644 25_Using_Java_to_configure_builds/my-project/data-model/build.gradle.kts rename 24_Kotlin_DSL_and_Groovy_DSL/my-project/settings.gradle.kts => 25_Using_Java_to_configure_builds/my-project/settings.gradle (100%) delete mode 100644 25_Using_Java_to_configure_builds/my-project/settings.gradle.kts rename 26_The_Classpath/my-project/{build.gradle.kts => build.gradle} (55%) rename 26_The_Classpath/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 27_Multiple_Compile_Classpaths/my-project/app/{build.gradle.kts => build.gradle} (54%) rename 27_Multiple_Compile_Classpaths/my-project/module/{build.gradle.kts => build.gradle} (54%) rename 27_Multiple_Compile_Classpaths/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (78%) rename 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts => 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle (100%) create mode 100644 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle rename 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts => 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle (100%) rename 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/{kotlin/my-root.gradle.kts => groovy/my-root.gradle} (100%) delete mode 100644 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts delete mode 100644 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename 28_Dependency_Analysis_Plugin/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 28_Dependency_Analysis_Plugin/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 28_Dependency_Analysis_Plugin/my-project/{build.gradle.kts => build.gradle} (100%) rename 28_Dependency_Analysis_Plugin/my-project/module/{build.gradle.kts => build.gradle} (100%) rename 28_Dependency_Analysis_Plugin/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 29_Classpath_Collisions/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (86%) rename 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (65%) rename 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts => 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle (100%) rename 29_Classpath_Collisions/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 29_Classpath_Collisions/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 29_Classpath_Collisions/my-project/module/{build.gradle.kts => build.gradle} (100%) rename 29_Classpath_Collisions/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 30_Security_Vulnerabilities/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (74%) rename 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (66%) rename 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (53%) rename 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts => 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle (100%) rename 30_Security_Vulnerabilities/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 30_Security_Vulnerabilities/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 30_Security_Vulnerabilities/my-project/module/{build.gradle.kts => build.gradle} (100%) rename 30_Security_Vulnerabilities/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 31_The_Module_Path/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (75%) rename 31_The_Module_Path/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 31_The_Module_Path/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (92%) rename 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts => 31_The_Module_Path/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle (100%) rename 31_The_Module_Path/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 31_The_Module_Path/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 31_The_Module_Path/my-project/modulea/{build.gradle.kts => build.gradle} (100%) rename 31_The_Module_Path/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 32_Artifact_Transforms/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (74%) rename 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (79%) rename 31_The_Module_Path/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts => 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle (100%) rename 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/{kotlin/org/example/JavaModuleTransform.kt => groovy/org/example/JavaModuleTransform.groovy} (53%) rename 32_Artifact_Transforms/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 32_Artifact_Transforms/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 32_Artifact_Transforms/my-project/{settings.gradle.kts => settings.gradle} (100%) rename 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/{build.gradle.kts => build.gradle} (89%) rename 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (100%) rename 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/{kotlin/my-java-base.gradle.kts => groovy/my-java-base.gradle} (94%) rename 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts => 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle (100%) delete mode 100644 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename 33_Classpath_and_Module_Path_in_Testing/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 33_Classpath_and_Module_Path_in_Testing/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 33_Classpath_and_Module_Path_in_Testing/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 34_Properties_and_Providers/my-build-logic/java-plugins/build.gradle delete mode 100644 34_Properties_and_Providers/my-build-logic/java-plugins/build.gradle.kts rename 34_Properties_and_Providers/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (56%) create mode 100644 34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/org/example/ApplicationReportTask.groovy rename 34_Properties_and_Providers/my-build-logic/java-plugins/src/main/{kotlin/org/example/MyEnum.kt => groovy/org/example/MyEnum.groovy} (52%) delete mode 100644 34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/org/example/ApplicationReportTask.kt rename 34_Properties_and_Providers/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 34_Properties_and_Providers/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 34_Properties_and_Providers/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 35_Working_with_Files/my-build-logic/java-plugins/build.gradle delete mode 100644 35_Working_with_Files/my-build-logic/java-plugins/build.gradle.kts rename 35_Working_with_Files/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (68%) create mode 100644 35_Working_with_Files/my-build-logic/java-plugins/src/main/groovy/org/example/GenerateStartScript.groovy delete mode 100644 35_Working_with_Files/my-build-logic/java-plugins/src/main/kotlin/org/example/GenerateStartScript.kt rename 35_Working_with_Files/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 35_Working_with_Files/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 35_Working_with_Files/my-project/{settings.gradle.kts => settings.gradle} (100%) create mode 100644 36_Task_Actions/my-build-logic/java-plugins/build.gradle delete mode 100644 36_Task_Actions/my-build-logic/java-plugins/build.gradle.kts rename 36_Task_Actions/my-build-logic/java-plugins/src/main/{kotlin/PrintVersion.kt => groovy/PrintVersion.groovy} (64%) rename 36_Task_Actions/my-build-logic/java-plugins/src/main/{kotlin/my-java-application.gradle.kts => groovy/my-java-application.gradle} (88%) rename 36_Task_Actions/my-build-logic/{settings.gradle.kts => settings.gradle} (100%) rename 36_Task_Actions/my-project/app/{build.gradle.kts => build.gradle} (100%) rename 36_Task_Actions/my-project/{settings.gradle.kts => settings.gradle} (100%) diff --git a/01_The_Settings_File/my-project/settings.gradle.kts b/01_The_Settings_File/my-project/settings.gradle similarity index 100% rename from 01_The_Settings_File/my-project/settings.gradle.kts rename to 01_The_Settings_File/my-project/settings.gradle diff --git a/02_The_Build_Files/my-project/app/build.gradle.kts b/02_The_Build_Files/my-project/app/build.gradle similarity index 63% rename from 02_The_Build_Files/my-project/app/build.gradle.kts rename to 02_The_Build_Files/my-project/app/build.gradle index 2c0767d..577dde1 100644 --- a/02_The_Build_Files/my-project/app/build.gradle.kts +++ b/02_The_Build_Files/my-project/app/build.gradle @@ -3,7 +3,7 @@ plugins { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } dependencies { diff --git a/02_The_Build_Files/my-project/business-logic/build.gradle.kts b/02_The_Build_Files/my-project/business-logic/build.gradle similarity index 72% rename from 02_The_Build_Files/my-project/business-logic/build.gradle.kts rename to 02_The_Build_Files/my-project/business-logic/build.gradle index 46a842b..a023994 100644 --- a/02_The_Build_Files/my-project/business-logic/build.gradle.kts +++ b/02_The_Build_Files/my-project/business-logic/build.gradle @@ -3,7 +3,7 @@ plugins { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } dependencies { diff --git a/02_The_Build_Files/my-project/data-model/build.gradle b/02_The_Build_Files/my-project/data-model/build.gradle new file mode 100644 index 0000000..e322f17 --- /dev/null +++ b/02_The_Build_Files/my-project/data-model/build.gradle @@ -0,0 +1,7 @@ +plugins { + id("java-library") +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} diff --git a/02_The_Build_Files/my-project/data-model/build.gradle.kts b/02_The_Build_Files/my-project/data-model/build.gradle.kts deleted file mode 100644 index e9c66b8..0000000 --- a/02_The_Build_Files/my-project/data-model/build.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id("java-library") -} - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} diff --git a/02_The_Build_Files/my-project/settings.gradle.kts b/02_The_Build_Files/my-project/settings.gradle similarity index 100% rename from 02_The_Build_Files/my-project/settings.gradle.kts rename to 02_The_Build_Files/my-project/settings.gradle diff --git a/03_Plugins/my-build-logic/java-plugins/build.gradle.kts b/03_Plugins/my-build-logic/java-plugins/build.gradle similarity index 76% rename from 03_Plugins/my-build-logic/java-plugins/build.gradle.kts rename to 03_Plugins/my-build-logic/java-plugins/build.gradle index 0d16800..977d66b 100644 --- a/03_Plugins/my-build-logic/java-plugins/build.gradle.kts +++ b/03_Plugins/my-build-logic/java-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/03_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle b/03_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle new file mode 100644 index 0000000..6b681ff --- /dev/null +++ b/03_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -0,0 +1,11 @@ +plugins { + id("application") +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} + +tasks.named("test") { + useJUnitPlatform() +} diff --git a/03_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/03_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 61% rename from 03_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 03_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle index 836f00b..babee71 100644 --- a/03_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts +++ b/03_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle @@ -4,10 +4,10 @@ plugins { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } -tasks.test { +tasks.named("test") { useJUnitPlatform() } diff --git a/03_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/03_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts deleted file mode 100644 index bff7b22..0000000 --- a/03_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id("application") -} - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} - -tasks.test { - useJUnitPlatform() -} diff --git a/03_Plugins/my-build-logic/settings.gradle.kts b/03_Plugins/my-build-logic/settings.gradle similarity index 100% rename from 03_Plugins/my-build-logic/settings.gradle.kts rename to 03_Plugins/my-build-logic/settings.gradle diff --git a/03_Plugins/my-project/app/build.gradle.kts b/03_Plugins/my-project/app/build.gradle similarity index 100% rename from 03_Plugins/my-project/app/build.gradle.kts rename to 03_Plugins/my-project/app/build.gradle diff --git a/03_Plugins/my-project/business-logic/build.gradle.kts b/03_Plugins/my-project/business-logic/build.gradle similarity index 100% rename from 03_Plugins/my-project/business-logic/build.gradle.kts rename to 03_Plugins/my-project/business-logic/build.gradle diff --git a/03_Plugins/my-project/data-model/build.gradle.kts b/03_Plugins/my-project/data-model/build.gradle similarity index 100% rename from 03_Plugins/my-project/data-model/build.gradle.kts rename to 03_Plugins/my-project/data-model/build.gradle diff --git a/03_Plugins/my-project/settings.gradle.kts b/03_Plugins/my-project/settings.gradle similarity index 100% rename from 03_Plugins/my-project/settings.gradle.kts rename to 03_Plugins/my-project/settings.gradle diff --git a/04_Tasks/my-build-logic/java-plugins/build.gradle b/04_Tasks/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/04_Tasks/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/04_Tasks/my-build-logic/java-plugins/build.gradle.kts b/04_Tasks/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/04_Tasks/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/04_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle b/04_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle new file mode 100644 index 0000000..c4b0a1b --- /dev/null +++ b/04_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -0,0 +1,7 @@ +plugins { + id("application") +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} diff --git a/04_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle b/04_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle new file mode 100644 index 0000000..e322f17 --- /dev/null +++ b/04_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle @@ -0,0 +1,7 @@ +plugins { + id("java-library") +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} diff --git a/04_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/04_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts deleted file mode 100644 index ac430ba..0000000 --- a/04_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id("application") -} - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} diff --git a/04_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/04_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts deleted file mode 100644 index e9c66b8..0000000 --- a/04_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id("java-library") -} - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} diff --git a/04_Tasks/my-build-logic/settings.gradle.kts b/04_Tasks/my-build-logic/settings.gradle similarity index 100% rename from 04_Tasks/my-build-logic/settings.gradle.kts rename to 04_Tasks/my-build-logic/settings.gradle diff --git a/04_Tasks/my-project/app/build.gradle.kts b/04_Tasks/my-project/app/build.gradle similarity index 100% rename from 04_Tasks/my-project/app/build.gradle.kts rename to 04_Tasks/my-project/app/build.gradle diff --git a/04_Tasks/my-project/business-logic/build.gradle.kts b/04_Tasks/my-project/business-logic/build.gradle similarity index 100% rename from 04_Tasks/my-project/business-logic/build.gradle.kts rename to 04_Tasks/my-project/business-logic/build.gradle diff --git a/04_Tasks/my-project/data-model/build.gradle.kts b/04_Tasks/my-project/data-model/build.gradle similarity index 100% rename from 04_Tasks/my-project/data-model/build.gradle.kts rename to 04_Tasks/my-project/data-model/build.gradle diff --git a/04_Tasks/my-project/settings.gradle.kts b/04_Tasks/my-project/settings.gradle similarity index 100% rename from 04_Tasks/my-project/settings.gradle.kts rename to 04_Tasks/my-project/settings.gradle diff --git a/05_Lifecycle_Tasks/my-build-logic/build.gradle b/05_Lifecycle_Tasks/my-build-logic/build.gradle new file mode 100644 index 0000000..7793210 --- /dev/null +++ b/05_Lifecycle_Tasks/my-build-logic/build.gradle @@ -0,0 +1,3 @@ +tasks.register("checkAll") { + dependsOn(subprojects.collect { ":${it.name}:check" }) +} diff --git a/05_Lifecycle_Tasks/my-build-logic/build.gradle.kts b/05_Lifecycle_Tasks/my-build-logic/build.gradle.kts deleted file mode 100644 index 28b6c03..0000000 --- a/05_Lifecycle_Tasks/my-build-logic/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -tasks.register("checkAll") { - dependsOn(subprojects.map { ":${it.name}:check" }) -} diff --git a/05_Lifecycle_Tasks/my-build-logic/java-plugins/build.gradle b/05_Lifecycle_Tasks/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/05_Lifecycle_Tasks/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/05_Lifecycle_Tasks/my-build-logic/java-plugins/build.gradle.kts b/05_Lifecycle_Tasks/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/05_Lifecycle_Tasks/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 73% rename from 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index 59d0f64..f2f7c51 100644 --- a/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -3,7 +3,7 @@ plugins { id("application") } -val myBuildGroup = "my project build" +def myBuildGroup = "my project build" tasks.named("run") { group = myBuildGroup diff --git a/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 86% rename from 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 227a138..e658d07 100644 --- a/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -3,21 +3,21 @@ plugins { id("checkstyle") } -val myBuildGroup = "my project build" -tasks.named("tasks") { +def myBuildGroup = "my project build" +tasks.named("tasks") { displayGroup = myBuildGroup } -tasks.register("tasksAll") { +tasks.register("tasksAll", TaskReportTask) { group = myBuildGroup description = "Show additional tasks." setShowDetail(true) } -tasks.build { +tasks.named("build") { group = myBuildGroup } -tasks.check { +tasks.named("check") { group = myBuildGroup description = "Runs checks (including tests)." } @@ -49,10 +49,10 @@ tasks.register("lifecycleTasks") { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } -tasks.test { +tasks.named("test") { useJUnitPlatform() testLogging.showStandardStreams = true } diff --git a/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 05_Lifecycle_Tasks/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/05_Lifecycle_Tasks/my-build-logic/settings.gradle.kts b/05_Lifecycle_Tasks/my-build-logic/settings.gradle similarity index 100% rename from 05_Lifecycle_Tasks/my-build-logic/settings.gradle.kts rename to 05_Lifecycle_Tasks/my-build-logic/settings.gradle diff --git a/05_Lifecycle_Tasks/my-other-project/build.gradle b/05_Lifecycle_Tasks/my-other-project/build.gradle new file mode 100644 index 0000000..7793210 --- /dev/null +++ b/05_Lifecycle_Tasks/my-other-project/build.gradle @@ -0,0 +1,3 @@ +tasks.register("checkAll") { + dependsOn(subprojects.collect { ":${it.name}:check" }) +} diff --git a/05_Lifecycle_Tasks/my-other-project/build.gradle.kts b/05_Lifecycle_Tasks/my-other-project/build.gradle.kts deleted file mode 100644 index 28b6c03..0000000 --- a/05_Lifecycle_Tasks/my-other-project/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -tasks.register("checkAll") { - dependsOn(subprojects.map { ":${it.name}:check" }) -} diff --git a/05_Lifecycle_Tasks/my-other-project/settings.gradle.kts b/05_Lifecycle_Tasks/my-other-project/settings.gradle similarity index 100% rename from 05_Lifecycle_Tasks/my-other-project/settings.gradle.kts rename to 05_Lifecycle_Tasks/my-other-project/settings.gradle diff --git a/05_Lifecycle_Tasks/my-project/app/build.gradle.kts b/05_Lifecycle_Tasks/my-project/app/build.gradle similarity index 100% rename from 05_Lifecycle_Tasks/my-project/app/build.gradle.kts rename to 05_Lifecycle_Tasks/my-project/app/build.gradle diff --git a/05_Lifecycle_Tasks/my-project/build.gradle b/05_Lifecycle_Tasks/my-project/build.gradle new file mode 100644 index 0000000..a12deee --- /dev/null +++ b/05_Lifecycle_Tasks/my-project/build.gradle @@ -0,0 +1,17 @@ +def globalBuildGroup = "My global build" +def ciBuildGroup = "My CI build" + +tasks.named("tasks") { + displayGroup = globalBuildGroup +} + +tasks.register("qualityCheckAll") { + group = globalBuildGroup + dependsOn(subprojects.collect { ":${it.name}:qualityCheck" }) +} + +tasks.register("checkAll") { + group = ciBuildGroup + dependsOn(subprojects.collect { ":${it.name}:check" }) + dependsOn(gradle.includedBuilds.collect { it.task(":checkAll") }) +} diff --git a/05_Lifecycle_Tasks/my-project/build.gradle.kts b/05_Lifecycle_Tasks/my-project/build.gradle.kts deleted file mode 100644 index 2f30fc8..0000000 --- a/05_Lifecycle_Tasks/my-project/build.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -val globalBuildGroup = "My global build" -val ciBuildGroup = "My CI build" - -tasks.named("tasks") { - displayGroup = globalBuildGroup -} - -tasks.register("qualityCheckAll") { - group = globalBuildGroup - dependsOn(subprojects.map { ":${it.name}:qualityCheck" }) -} - -tasks.register("checkAll") { - group = ciBuildGroup - dependsOn(subprojects.map { ":${it.name}:check" }) - dependsOn(gradle.includedBuilds.map { it.task(":checkAll") }) -} diff --git a/05_Lifecycle_Tasks/my-project/business-logic/build.gradle.kts b/05_Lifecycle_Tasks/my-project/business-logic/build.gradle similarity index 100% rename from 05_Lifecycle_Tasks/my-project/business-logic/build.gradle.kts rename to 05_Lifecycle_Tasks/my-project/business-logic/build.gradle diff --git a/05_Lifecycle_Tasks/my-project/data-model/build.gradle.kts b/05_Lifecycle_Tasks/my-project/data-model/build.gradle similarity index 100% rename from 05_Lifecycle_Tasks/my-project/data-model/build.gradle.kts rename to 05_Lifecycle_Tasks/my-project/data-model/build.gradle diff --git a/05_Lifecycle_Tasks/my-project/settings.gradle.kts b/05_Lifecycle_Tasks/my-project/settings.gradle similarity index 100% rename from 05_Lifecycle_Tasks/my-project/settings.gradle.kts rename to 05_Lifecycle_Tasks/my-project/settings.gradle diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/build.gradle b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/build.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 75% rename from 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index 9e9a219..88a5dfb 100644 --- a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -2,9 +2,9 @@ plugins { id("my-java-base") } -val packageApp = tasks.register("packageApp") { +def packageApp = tasks.register("packageApp", Zip) { from(layout.projectDirectory.file("run.sh")) - from(tasks.jar) { + from(tasks.named("jar")) { into("libs") } from(configurations.runtimeClasspath) { @@ -15,7 +15,7 @@ val packageApp = tasks.register("packageApp") { archiveFileName.set("myApplication.zip") } -tasks.build { +tasks.named("build") { dependsOn(packageApp) } diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle new file mode 100644 index 0000000..6eea88c --- /dev/null +++ b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -0,0 +1,7 @@ +plugins { + id("java") +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts deleted file mode 100644 index 14a33d9..0000000 --- a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id("java") -} - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/settings.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-build-logic/settings.gradle similarity index 100% rename from 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/settings.gradle.kts rename to 06_Configuring_Task_Inputs_And_Outputs/my-build-logic/settings.gradle diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-project/app/build.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-project/app/build.gradle similarity index 100% rename from 06_Configuring_Task_Inputs_And_Outputs/my-project/app/build.gradle.kts rename to 06_Configuring_Task_Inputs_And_Outputs/my-project/app/build.gradle diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-project/business-logic/build.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-project/business-logic/build.gradle similarity index 100% rename from 06_Configuring_Task_Inputs_And_Outputs/my-project/business-logic/build.gradle.kts rename to 06_Configuring_Task_Inputs_And_Outputs/my-project/business-logic/build.gradle diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-project/data-model/build.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-project/data-model/build.gradle similarity index 100% rename from 06_Configuring_Task_Inputs_And_Outputs/my-project/data-model/build.gradle.kts rename to 06_Configuring_Task_Inputs_And_Outputs/my-project/data-model/build.gradle diff --git a/06_Configuring_Task_Inputs_And_Outputs/my-project/settings.gradle.kts b/06_Configuring_Task_Inputs_And_Outputs/my-project/settings.gradle similarity index 100% rename from 06_Configuring_Task_Inputs_And_Outputs/my-project/settings.gradle.kts rename to 06_Configuring_Task_Inputs_And_Outputs/my-project/settings.gradle diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/build.gradle b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/build.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 70% rename from 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index d2e5670..f4bb7b3 100644 --- a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -5,14 +5,14 @@ plugins { id("my-java-base") } -val myApp = extensions.create("myApp") +def myApp = extensions.create("myApp", MyAppExtension) -val generateStartScript = tasks.register("generateStartScript") { +def generateStartScript = tasks.register("generateStartScript", GenerateStartScript) { mainClass.convention(myApp.mainClass) scriptFile.set(layout.buildDirectory.file("run.sh")) } -val packageApp = tasks.register("packageApp") { +def packageApp = tasks.register("packageApp", Zip) { from(generateStartScript) from(tasks.jar) { into("libs") @@ -25,7 +25,7 @@ val packageApp = tasks.register("packageApp") { archiveFileName.set("myApplication.zip") } -tasks.build { +tasks.named("build") { dependsOn(packageApp) } diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle new file mode 100644 index 0000000..6eea88c --- /dev/null +++ b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -0,0 +1,7 @@ +plugins { + id("java") +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/myproject/tasks/GenerateStartScript.groovy b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/myproject/tasks/GenerateStartScript.groovy new file mode 100644 index 0000000..0555e64 --- /dev/null +++ b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/myproject/tasks/GenerateStartScript.groovy @@ -0,0 +1,36 @@ +package myproject.tasks + +import org.gradle.api.DefaultTask +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.TaskAction + +import java.nio.file.Files +import static java.nio.file.attribute.PosixFilePermission.* + +@CacheableTask +abstract class GenerateStartScript extends DefaultTask { + + @Input + abstract Property getMainClass() + + @OutputFile + abstract RegularFileProperty getScriptFile() + + @TaskAction + def generate() { + def main = mainClass.get() // String + def out = scriptFile.get().asFile // java.io.File + def script = "java -cp 'libs/*' $main" + + out.text = script + Files.setPosixFilePermissions(out.toPath(), [ + OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, + GROUP_READ, GROUP_EXECUTE, + OTHERS_EXECUTE, OTHERS_READ + ] as Set) + } +} \ No newline at end of file diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/myproject/tasks/MyAppExtension.kt b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/myproject/tasks/MyAppExtension.groovy similarity index 72% rename from 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/myproject/tasks/MyAppExtension.kt rename to 07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/myproject/tasks/MyAppExtension.groovy index 3e46a42..cbd663e 100644 --- a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/myproject/tasks/MyAppExtension.kt +++ b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/groovy/myproject/tasks/MyAppExtension.groovy @@ -3,5 +3,5 @@ package myproject.tasks import org.gradle.api.provider.Property interface MyAppExtension { - val mainClass: Property + Property getMainClass() } diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts deleted file mode 100644 index 14a33d9..0000000 --- a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id("java") -} - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/myproject/tasks/GenerateStartScript.kt b/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/myproject/tasks/GenerateStartScript.kt deleted file mode 100644 index fcf997f..0000000 --- a/07_Implementing_Tasks_and_Extensions/my-build-logic/java-plugins/src/main/kotlin/myproject/tasks/GenerateStartScript.kt +++ /dev/null @@ -1,35 +0,0 @@ -package myproject.tasks - -import org.gradle.api.DefaultTask -import org.gradle.api.file.RegularFileProperty -import org.gradle.api.provider.Property -import org.gradle.api.tasks.CacheableTask -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.OutputFile -import org.gradle.api.tasks.TaskAction -import java.nio.file.Files -import java.nio.file.attribute.PosixFilePermission.* - -@CacheableTask -abstract class GenerateStartScript : DefaultTask() { - - @get:Input - abstract val mainClass: Property - - @get:OutputFile - abstract val scriptFile: RegularFileProperty - - @TaskAction - fun generate() { - val main = mainClass.get() // String - val out = scriptFile.get().asFile // java.io.File - val script = "java -cp 'libs/*' $main" - - out.writeText(script) - Files.setPosixFilePermissions(out.toPath(), setOf( - OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, - GROUP_READ, GROUP_EXECUTE, - OTHERS_EXECUTE, OTHERS_READ - )) - } -} \ No newline at end of file diff --git a/07_Implementing_Tasks_and_Extensions/my-build-logic/settings.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-build-logic/settings.gradle similarity index 100% rename from 07_Implementing_Tasks_and_Extensions/my-build-logic/settings.gradle.kts rename to 07_Implementing_Tasks_and_Extensions/my-build-logic/settings.gradle diff --git a/07_Implementing_Tasks_and_Extensions/my-project/app/build.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-project/app/build.gradle similarity index 100% rename from 07_Implementing_Tasks_and_Extensions/my-project/app/build.gradle.kts rename to 07_Implementing_Tasks_and_Extensions/my-project/app/build.gradle diff --git a/07_Implementing_Tasks_and_Extensions/my-project/business-logic/build.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-project/business-logic/build.gradle similarity index 100% rename from 07_Implementing_Tasks_and_Extensions/my-project/business-logic/build.gradle.kts rename to 07_Implementing_Tasks_and_Extensions/my-project/business-logic/build.gradle diff --git a/07_Implementing_Tasks_and_Extensions/my-project/data-model/build.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-project/data-model/build.gradle similarity index 100% rename from 07_Implementing_Tasks_and_Extensions/my-project/data-model/build.gradle.kts rename to 07_Implementing_Tasks_and_Extensions/my-project/data-model/build.gradle diff --git a/07_Implementing_Tasks_and_Extensions/my-project/settings.gradle.kts b/07_Implementing_Tasks_and_Extensions/my-project/settings.gradle similarity index 100% rename from 07_Implementing_Tasks_and_Extensions/my-project/settings.gradle.kts rename to 07_Implementing_Tasks_and_Extensions/my-project/settings.gradle diff --git a/08_Declaring_Dependencis/my-build-logic/java-plugins/build.gradle b/08_Declaring_Dependencis/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/08_Declaring_Dependencis/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/08_Declaring_Dependencis/my-build-logic/java-plugins/build.gradle.kts b/08_Declaring_Dependencis/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/08_Declaring_Dependencis/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 84% rename from 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index b13effa..19fea26 100644 --- a/08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -12,6 +12,6 @@ dependencies.constraints { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } diff --git a/08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 08_Declaring_Dependencis/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/08_Declaring_Dependencis/my-build-logic/settings.gradle.kts b/08_Declaring_Dependencis/my-build-logic/settings.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-build-logic/settings.gradle.kts rename to 08_Declaring_Dependencis/my-build-logic/settings.gradle diff --git a/08_Declaring_Dependencis/my-other-project/settings.gradle.kts b/08_Declaring_Dependencis/my-other-project/settings.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-other-project/settings.gradle.kts rename to 08_Declaring_Dependencis/my-other-project/settings.gradle diff --git a/08_Declaring_Dependencis/my-other-project/shared-utils/build.gradle.kts b/08_Declaring_Dependencis/my-other-project/shared-utils/build.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-other-project/shared-utils/build.gradle.kts rename to 08_Declaring_Dependencis/my-other-project/shared-utils/build.gradle diff --git a/08_Declaring_Dependencis/my-project/app/build.gradle.kts b/08_Declaring_Dependencis/my-project/app/build.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-project/app/build.gradle.kts rename to 08_Declaring_Dependencis/my-project/app/build.gradle diff --git a/08_Declaring_Dependencis/my-project/business-logic/build.gradle.kts b/08_Declaring_Dependencis/my-project/business-logic/build.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-project/business-logic/build.gradle.kts rename to 08_Declaring_Dependencis/my-project/business-logic/build.gradle diff --git a/08_Declaring_Dependencis/my-project/data-model/build.gradle.kts b/08_Declaring_Dependencis/my-project/data-model/build.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-project/data-model/build.gradle.kts rename to 08_Declaring_Dependencis/my-project/data-model/build.gradle diff --git a/08_Declaring_Dependencis/my-project/settings.gradle.kts b/08_Declaring_Dependencis/my-project/settings.gradle similarity index 100% rename from 08_Declaring_Dependencis/my-project/settings.gradle.kts rename to 08_Declaring_Dependencis/my-project/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/build.gradle b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/build.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 80% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 6c014c1..725a9cc 100644 --- a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -5,7 +5,7 @@ plugins { group = "org.example.my-app" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } dependencies.constraints { diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/settings.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-build-logic/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/settings.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/shared-utils/build.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/shared-utils/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/shared-utils/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-other-project/shared-utils/build.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/app/build.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/app/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/app/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/app/build.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/business-logic/build.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/business-logic/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/business-logic/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/business-logic/build.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/data-model/build.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/data-model/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/data-model/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/data-model/build.gradle diff --git a/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/settings.gradle.kts b/09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/A_Dependency_Constrains_in_Convention_Plugin/my-project/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/build.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/build.gradle similarity index 83% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/build.gradle index 0ef01c2..6e6ad09 100644 --- a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/build.gradle.kts +++ b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 71% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index dbcc49d..97a3348 100644 --- a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -5,7 +5,7 @@ plugins { group = "org.example.my-app" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } dependencies { diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/settings.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-build-logic/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/settings.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/shared-utils/build.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/shared-utils/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/shared-utils/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-other-project/shared-utils/build.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/settings.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/shared-platform/build.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/shared-platform/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/shared-platform/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-platform/shared-platform/build.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/app/build.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/app/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/app/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/app/build.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/business-logic/build.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/business-logic/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/business-logic/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/business-logic/build.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/data-model/build.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/data-model/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/data-model/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/data-model/build.gradle diff --git a/09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/settings.gradle.kts b/09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/B_Platform_Project/my-project/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/build.gradle b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/build.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 52% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index e082874..87b30f6 100644 --- a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -5,7 +5,7 @@ plugins { group = "org.example.my-app" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/settings.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-build-logic/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/settings.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/shared-utils/build.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/shared-utils/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/shared-utils/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-other-project/shared-utils/build.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/app/build.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/app/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/app/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/app/build.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/business-logic/build.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/business-logic/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/business-logic/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/business-logic/build.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/data-model/build.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/data-model/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/data-model/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/data-model/build.gradle diff --git a/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/settings.gradle.kts b/09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/C_Version_Catalog/my-project/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/build.gradle b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/build.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 62% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 11b3528..e060a67 100644 --- a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -5,36 +5,36 @@ plugins { group = "org.example.my-app" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } configurations { compileClasspath { - useLatestVersionsAndLock() + useLatestVersionsAndLock(it) } runtimeClasspath { - useLatestVersionsAndLock() + useLatestVersionsAndLock(it) } testCompileClasspath { - useLatestVersionsAndLock() + useLatestVersionsAndLock(it) } testRuntimeClasspath { - useLatestVersionsAndLock() + useLatestVersionsAndLock(it) } } -fun Configuration.useLatestVersionsAndLock() { - resolutionStrategy { +void useLatestVersionsAndLock(Configuration conf) { + conf.resolutionStrategy { eachDependency { - if (requested.version.isNullOrEmpty()) { useVersion("latest.release") } + if (requested.version.isEmpty()) { useVersion("latest.release") } } activateDependencyLocking() } } dependencies.components.all { - val lcVersion = id.version.lowercase() + def lcVersion = id.version.toLowerCase() if (lcVersion.contains("alpha") || lcVersion.contains("-b") || lcVersion.contains("beta") @@ -47,6 +47,3 @@ dependencies.components.all { status = "integration" } } - - - diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-root-project.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-root-project.gradle similarity index 88% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-root-project.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-root-project.gradle index f74781d..9677eac 100644 --- a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/kotlin/my-root-project.gradle.kts +++ b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/java-plugins/src/main/groovy/my-root-project.gradle @@ -2,7 +2,7 @@ tasks.register("allDependencies") { group = "My project build" description = "Run ':allDependencies --write-locks' to update all the dependency lock files" // Resolve dependencies of all subprojects of 'this build' - dependsOn(subprojects.map { ":${it.name}:dependencies" }) + dependsOn(subprojects.collect { ":${it.name}:dependencies" }) // Resolve dependencies of all subprojects of included builds that are not 'this build' or the 'build-logic build' dependsOn(gradle.includedBuilds.filter { it.name !in listOf(project.name, "my-build-logic") diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/settings.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-build-logic/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/build.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/build.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/settings.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/settings.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/shared-utils/build.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/shared-utils/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/shared-utils/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-other-project/shared-utils/build.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/app/build.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/app/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/app/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/app/build.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/build.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/build.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/business-logic/build.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/business-logic/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/business-logic/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/business-logic/build.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/data-model/build.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/data-model/build.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/data-model/build.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/data-model/build.gradle diff --git a/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/settings.gradle.kts b/09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/settings.gradle similarity index 100% rename from 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/settings.gradle.kts rename to 09_Centralizing_Dependency_Versions/D_Dependency_Locking/my-project/settings.gradle diff --git a/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/build.gradle b/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/build.gradle.kts b/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 51% rename from 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index ee51231..69ecc88 100644 --- a/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -6,10 +6,10 @@ group = "org.example.my-app" version = "0.1" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } -tasks.test { +tasks.named("test") { useJUnitPlatform() testLogging.showStandardStreams = true } @@ -25,19 +25,19 @@ dependencies.constraints { implementation("org.apache.commons:commons-text:1.5") } -val applicationRuntimeClasspath = configurations.create("applicationRuntimeClasspath") { - isCanBeResolved = true - isCanBeConsumed = false +def appRuntimeClasspath = configurations.create("applicationRuntimeClasspath") { + canBeResolved = true + canBeConsumed = false attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) } } dependencies { applicationRuntimeClasspath("org.example.my-app:app") } configurations { - compileClasspath.get().shouldResolveConsistentlyWith(applicationRuntimeClasspath) - runtimeClasspath.get().shouldResolveConsistentlyWith(applicationRuntimeClasspath) - testCompileClasspath.get().shouldResolveConsistentlyWith(applicationRuntimeClasspath) - testRuntimeClasspath.get().shouldResolveConsistentlyWith(applicationRuntimeClasspath) + compileClasspath.shouldResolveConsistentlyWith(appRuntimeClasspath) + runtimeClasspath.shouldResolveConsistentlyWith(appRuntimeClasspath) + testCompileClasspath.shouldResolveConsistentlyWith(appRuntimeClasspath) + testRuntimeClasspath.shouldResolveConsistentlyWith(appRuntimeClasspath) } diff --git a/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 10_Dependency_Version_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/10_Dependency_Version_Conflicts/my-build-logic/settings.gradle.kts b/10_Dependency_Version_Conflicts/my-build-logic/settings.gradle similarity index 100% rename from 10_Dependency_Version_Conflicts/my-build-logic/settings.gradle.kts rename to 10_Dependency_Version_Conflicts/my-build-logic/settings.gradle diff --git a/10_Dependency_Version_Conflicts/my-other-project/settings.gradle.kts b/10_Dependency_Version_Conflicts/my-other-project/settings.gradle similarity index 100% rename from 10_Dependency_Version_Conflicts/my-other-project/settings.gradle.kts rename to 10_Dependency_Version_Conflicts/my-other-project/settings.gradle diff --git a/10_Dependency_Version_Conflicts/my-project/app/build.gradle.kts b/10_Dependency_Version_Conflicts/my-project/app/build.gradle similarity index 100% rename from 10_Dependency_Version_Conflicts/my-project/app/build.gradle.kts rename to 10_Dependency_Version_Conflicts/my-project/app/build.gradle diff --git a/10_Dependency_Version_Conflicts/my-project/business-logic/build.gradle.kts b/10_Dependency_Version_Conflicts/my-project/business-logic/build.gradle similarity index 100% rename from 10_Dependency_Version_Conflicts/my-project/business-logic/build.gradle.kts rename to 10_Dependency_Version_Conflicts/my-project/business-logic/build.gradle diff --git a/10_Dependency_Version_Conflicts/my-project/data-model/build.gradle.kts b/10_Dependency_Version_Conflicts/my-project/data-model/build.gradle similarity index 100% rename from 10_Dependency_Version_Conflicts/my-project/data-model/build.gradle.kts rename to 10_Dependency_Version_Conflicts/my-project/data-model/build.gradle diff --git a/10_Dependency_Version_Conflicts/my-project/settings.gradle.kts b/10_Dependency_Version_Conflicts/my-project/settings.gradle similarity index 100% rename from 10_Dependency_Version_Conflicts/my-project/settings.gradle.kts rename to 10_Dependency_Version_Conflicts/my-project/settings.gradle diff --git a/11_Capability_Conflicts/my-build-logic/java-plugins/build.gradle b/11_Capability_Conflicts/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/11_Capability_Conflicts/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/11_Capability_Conflicts/my-build-logic/java-plugins/build.gradle.kts b/11_Capability_Conflicts/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/11_Capability_Conflicts/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/metadata-rules.gradle b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/metadata-rules.gradle new file mode 100644 index 0000000..4e7bf46 --- /dev/null +++ b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/metadata-rules.gradle @@ -0,0 +1,6 @@ +import myproject.metadatarules.Slf4JImplRule + +dependencies.components { + withModule("org.slf4j:slf4j-simple", Slf4JImplRule) + withModule("ch.qos.logback:logback-classic", Slf4JImplRule) +} \ No newline at end of file diff --git a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 90% rename from 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 2fabd49..b803c9d 100644 --- a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -7,10 +7,10 @@ group = "org.example.my-app" version = "0.1" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } -tasks.test { +tasks.named("test") { useJUnitPlatform() testLogging.showStandardStreams = true } diff --git a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/myproject/metadatarules/Slf4JImplRule.kt b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/myproject/metadatarules/Slf4JImplRule.groovy similarity index 67% rename from 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/myproject/metadatarules/Slf4JImplRule.kt rename to 11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/myproject/metadatarules/Slf4JImplRule.groovy index 71e37a8..1cbdff8 100644 --- a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/myproject/metadatarules/Slf4JImplRule.kt +++ b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/groovy/myproject/metadatarules/Slf4JImplRule.groovy @@ -5,10 +5,11 @@ import org.gradle.api.artifacts.ComponentMetadataContext import org.gradle.api.artifacts.ComponentMetadataRule @CacheableRule -abstract class Slf4JImplRule : ComponentMetadataRule { +abstract class Slf4JImplRule implements ComponentMetadataRule { - override fun execute(context: ComponentMetadataContext) { - val version = context.details.id.version + @Override + void execute(ComponentMetadataContext context) { + def version = context.details.id.version context.details.allVariants { withCapabilities { addCapability("org.slf4j", "slf4j-impl", version) diff --git a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/metadata-rules.gradle.kts b/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/metadata-rules.gradle.kts deleted file mode 100644 index 0de0851..0000000 --- a/11_Capability_Conflicts/my-build-logic/java-plugins/src/main/kotlin/metadata-rules.gradle.kts +++ /dev/null @@ -1,6 +0,0 @@ -import myproject.metadatarules.Slf4JImplRule - -dependencies.components { - withModule("org.slf4j:slf4j-simple") - withModule("ch.qos.logback:logback-classic") -} \ No newline at end of file diff --git a/11_Capability_Conflicts/my-build-logic/settings.gradle.kts b/11_Capability_Conflicts/my-build-logic/settings.gradle similarity index 100% rename from 11_Capability_Conflicts/my-build-logic/settings.gradle.kts rename to 11_Capability_Conflicts/my-build-logic/settings.gradle diff --git a/11_Capability_Conflicts/my-other-project/settings.gradle.kts b/11_Capability_Conflicts/my-other-project/settings.gradle similarity index 100% rename from 11_Capability_Conflicts/my-other-project/settings.gradle.kts rename to 11_Capability_Conflicts/my-other-project/settings.gradle diff --git a/11_Capability_Conflicts/my-project/app/build.gradle.kts b/11_Capability_Conflicts/my-project/app/build.gradle similarity index 100% rename from 11_Capability_Conflicts/my-project/app/build.gradle.kts rename to 11_Capability_Conflicts/my-project/app/build.gradle diff --git a/11_Capability_Conflicts/my-project/business-logic/build.gradle.kts b/11_Capability_Conflicts/my-project/business-logic/build.gradle similarity index 100% rename from 11_Capability_Conflicts/my-project/business-logic/build.gradle.kts rename to 11_Capability_Conflicts/my-project/business-logic/build.gradle diff --git a/11_Capability_Conflicts/my-project/data-model/build.gradle.kts b/11_Capability_Conflicts/my-project/data-model/build.gradle similarity index 100% rename from 11_Capability_Conflicts/my-project/data-model/build.gradle.kts rename to 11_Capability_Conflicts/my-project/data-model/build.gradle diff --git a/11_Capability_Conflicts/my-project/settings.gradle.kts b/11_Capability_Conflicts/my-project/settings.gradle similarity index 100% rename from 11_Capability_Conflicts/my-project/settings.gradle.kts rename to 11_Capability_Conflicts/my-project/settings.gradle diff --git a/12_Publishing_Libraries/my-build-logic/java-plugins/build.gradle b/12_Publishing_Libraries/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/12_Publishing_Libraries/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/12_Publishing_Libraries/my-build-logic/java-plugins/build.gradle.kts b/12_Publishing_Libraries/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/12_Publishing_Libraries/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 84% rename from 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 67543e3..7efad5f 100644 --- a/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -14,6 +14,6 @@ dependencies.constraints { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } diff --git a/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 51% rename from 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 12_Publishing_Libraries/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle index 1e05927..f67ed82 100644 --- a/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts +++ b/12_Publishing_Libraries/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle @@ -5,22 +5,23 @@ plugins { } publishing { - publications.create("lib").from(components["java"]) + publications.create("lib", MavenPublication).from(components["java"]) - repositories.maven("/tmp/test-repo") + repositories.maven { url = "/tmp/test-repo" } } // The above more verbose if you need to customize published 'variants': // -// val javaComponent = components["java"] as AdhocComponentWithVariants -// javaComponent.withVariantsFromConfiguration(configurations.runtimeElements.get()) { +// def javaComponent = components["java"] +// javaComponent.withVariantsFromConfiguration(configurations.runtimeElements) { // // customize 'runtimeElements' variant here... // } // publishing { -// publications.create("lib").from(javaComponent) +// publications.create("lib", MavenPublication).from(javaComponent) // -// repositories.maven("/tmp/test-repo") { +// repositories.maven { +// url = "/tmp/test-repo" // name = "myRepo" -// credentials(PasswordCredentials::class) +// credentials(PasswordCredentials) // } // } \ No newline at end of file diff --git a/12_Publishing_Libraries/my-build-logic/settings.gradle.kts b/12_Publishing_Libraries/my-build-logic/settings.gradle similarity index 100% rename from 12_Publishing_Libraries/my-build-logic/settings.gradle.kts rename to 12_Publishing_Libraries/my-build-logic/settings.gradle diff --git a/12_Publishing_Libraries/my-other-project/settings.gradle.kts b/12_Publishing_Libraries/my-other-project/settings.gradle similarity index 100% rename from 12_Publishing_Libraries/my-other-project/settings.gradle.kts rename to 12_Publishing_Libraries/my-other-project/settings.gradle diff --git a/12_Publishing_Libraries/my-other-project/shared-utils/build.gradle.kts b/12_Publishing_Libraries/my-other-project/shared-utils/build.gradle similarity index 100% rename from 12_Publishing_Libraries/my-other-project/shared-utils/build.gradle.kts rename to 12_Publishing_Libraries/my-other-project/shared-utils/build.gradle diff --git a/12_Publishing_Libraries/my-project/app/build.gradle.kts b/12_Publishing_Libraries/my-project/app/build.gradle similarity index 100% rename from 12_Publishing_Libraries/my-project/app/build.gradle.kts rename to 12_Publishing_Libraries/my-project/app/build.gradle diff --git a/12_Publishing_Libraries/my-project/business-logic/build.gradle.kts b/12_Publishing_Libraries/my-project/business-logic/build.gradle similarity index 100% rename from 12_Publishing_Libraries/my-project/business-logic/build.gradle.kts rename to 12_Publishing_Libraries/my-project/business-logic/build.gradle diff --git a/12_Publishing_Libraries/my-project/data-model/build.gradle.kts b/12_Publishing_Libraries/my-project/data-model/build.gradle similarity index 100% rename from 12_Publishing_Libraries/my-project/data-model/build.gradle.kts rename to 12_Publishing_Libraries/my-project/data-model/build.gradle diff --git a/12_Publishing_Libraries/my-project/settings.gradle.kts b/12_Publishing_Libraries/my-project/settings.gradle similarity index 81% rename from 12_Publishing_Libraries/my-project/settings.gradle.kts rename to 12_Publishing_Libraries/my-project/settings.gradle index e1ef114..ebeadec 100644 --- a/12_Publishing_Libraries/my-project/settings.gradle.kts +++ b/12_Publishing_Libraries/my-project/settings.gradle @@ -1,14 +1,14 @@ // Locations of Gradle plugins pluginManagement { repositories.gradlePluginPortal() - repositories.maven("/tmp/test-repo") + repositories.maven { url = "/tmp/test-repo" } includeBuild("../my-build-logic") } // Location of other components dependencyResolutionManagement { repositories.mavenCentral() - repositories.maven("/tmp/test-repo") + repositories.maven { url = "/tmp/test-repo" } includeBuild("../my-other-project") // <-- remove includeBuild() to use published version includeBuild(".") } diff --git a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/build.gradle b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/build.gradle.kts b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle new file mode 100644 index 0000000..1800630 --- /dev/null +++ b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -0,0 +1,22 @@ +plugins { + id("my-java-base") + id("application") +} + +def sourcesPath = configurations.create("sourcesPath") { + canBeResolved = true + canBeConsumed = false + extendsFrom(configurations.implementation) + attributes { + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, "java-sources")) + } +} + +def fullJavadoc = tasks.register("fullJavadoc", Javadoc) { + classpath = configurations.runtimeClasspath + source = sourcesPath.incoming.artifactView { lenient(true) }.files.asFileTree +} + +tasks.named("build") { + dependsOn(fullJavadoc) +} diff --git a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle new file mode 100644 index 0000000..c4bea4e --- /dev/null +++ b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -0,0 +1,26 @@ +plugins { + id("java") +} + +group = "org.example.my-app" +version = "1.0" + +dependencies.constraints { + implementation("org.apache.commons:commons-lang3:3.9") +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} + +configurations.create("sourcesElements") { + canBeResolved = false + canBeConsumed = true + extendsFrom(configurations.implementation) + attributes { + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, "java-sources")) + } + sourceSets.main.java.srcDirs.forEach { + outgoing.artifact(it) + } +} diff --git a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts deleted file mode 100644 index aa01c23..0000000 --- a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ /dev/null @@ -1,22 +0,0 @@ -plugins { - id("my-java-base") - id("application") -} - -val sourcesPath = configurations.create("sourcesPath") { - isCanBeResolved = true - isCanBeConsumed = false - extendsFrom(configurations.implementation.get()) - attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named("java-sources")) - } -} - -val fullJavadoc = tasks.register("fullJavadoc") { - classpath = configurations.runtimeClasspath.get() - source = sourcesPath.incoming.artifactView { lenient(true) }.files.asFileTree -} - -tasks.build { - dependsOn(fullJavadoc) -} diff --git a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts deleted file mode 100644 index 75e63ef..0000000 --- a/13_Aggregating_Custom_Artifacts/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ /dev/null @@ -1,26 +0,0 @@ -plugins { - id("java") -} - -group = "org.example.my-app" -version = "1.0" - -dependencies.constraints { - implementation("org.apache.commons:commons-lang3:3.9") -} - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} - -configurations.create("sourcesElements") { - isCanBeResolved = false - isCanBeConsumed = true - extendsFrom(configurations.implementation.get()) - attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named("java-sources")) - } - sourceSets.main.get().java.srcDirs.forEach { - outgoing.artifact(it) - } -} diff --git a/13_Aggregating_Custom_Artifacts/my-build-logic/settings.gradle.kts b/13_Aggregating_Custom_Artifacts/my-build-logic/settings.gradle similarity index 100% rename from 13_Aggregating_Custom_Artifacts/my-build-logic/settings.gradle.kts rename to 13_Aggregating_Custom_Artifacts/my-build-logic/settings.gradle diff --git a/13_Aggregating_Custom_Artifacts/my-other-project/settings.gradle.kts b/13_Aggregating_Custom_Artifacts/my-other-project/settings.gradle similarity index 100% rename from 13_Aggregating_Custom_Artifacts/my-other-project/settings.gradle.kts rename to 13_Aggregating_Custom_Artifacts/my-other-project/settings.gradle diff --git a/13_Aggregating_Custom_Artifacts/my-project/app/build.gradle.kts b/13_Aggregating_Custom_Artifacts/my-project/app/build.gradle similarity index 100% rename from 13_Aggregating_Custom_Artifacts/my-project/app/build.gradle.kts rename to 13_Aggregating_Custom_Artifacts/my-project/app/build.gradle diff --git a/13_Aggregating_Custom_Artifacts/my-project/business-logic/build.gradle.kts b/13_Aggregating_Custom_Artifacts/my-project/business-logic/build.gradle similarity index 100% rename from 13_Aggregating_Custom_Artifacts/my-project/business-logic/build.gradle.kts rename to 13_Aggregating_Custom_Artifacts/my-project/business-logic/build.gradle diff --git a/13_Aggregating_Custom_Artifacts/my-project/data-model/build.gradle.kts b/13_Aggregating_Custom_Artifacts/my-project/data-model/build.gradle similarity index 100% rename from 13_Aggregating_Custom_Artifacts/my-project/data-model/build.gradle.kts rename to 13_Aggregating_Custom_Artifacts/my-project/data-model/build.gradle diff --git a/13_Aggregating_Custom_Artifacts/my-project/settings.gradle.kts b/13_Aggregating_Custom_Artifacts/my-project/settings.gradle similarity index 100% rename from 13_Aggregating_Custom_Artifacts/my-project/settings.gradle.kts rename to 13_Aggregating_Custom_Artifacts/my-project/settings.gradle diff --git a/14_Settings_Plugins/my-build-logic/java-plugins/build.gradle b/14_Settings_Plugins/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/14_Settings_Plugins/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/14_Settings_Plugins/my-build-logic/java-plugins/build.gradle.kts b/14_Settings_Plugins/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/14_Settings_Plugins/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/14_Settings_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/14_Settings_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 14_Settings_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 14_Settings_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/14_Settings_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/14_Settings_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 73% rename from 14_Settings_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 14_Settings_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 332939a..5527dc1 100644 --- a/14_Settings_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/14_Settings_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -10,5 +10,5 @@ dependencies.constraints { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } diff --git a/14_Settings_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/14_Settings_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 14_Settings_Plugins/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 14_Settings_Plugins/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/14_Settings_Plugins/my-build-logic/settings.gradle.kts b/14_Settings_Plugins/my-build-logic/settings.gradle similarity index 100% rename from 14_Settings_Plugins/my-build-logic/settings.gradle.kts rename to 14_Settings_Plugins/my-build-logic/settings.gradle diff --git a/14_Settings_Plugins/my-build-logic/structure-plugins/build.gradle b/14_Settings_Plugins/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/14_Settings_Plugins/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/14_Settings_Plugins/my-build-logic/structure-plugins/build.gradle.kts b/14_Settings_Plugins/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/14_Settings_Plugins/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/18_Configuring_Testing/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/14_Settings_Plugins/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle similarity index 56% rename from 18_Configuring_Testing/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts rename to 14_Settings_Plugins/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle index 39bca3e..7dc5613 100644 --- a/18_Configuring_Testing/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ b/14_Settings_Plugins/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -6,15 +6,15 @@ pluginManagement { // Location of other components dependencyResolutionManagement { repositories.mavenCentral() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() - }?.forEach { + rootDir.parentFile.listFiles()?.findAll { + new File(it, "settings.gradle").exists() + }?.each { includeBuild(it.path) } } -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() -}?.forEach { +rootDir.listFiles()?.findAll { + new File(it, "build.gradle").exists() +}?.each { include(it.name) } diff --git a/14_Settings_Plugins/my-other-project/settings.gradle.kts b/14_Settings_Plugins/my-other-project/settings.gradle similarity index 100% rename from 14_Settings_Plugins/my-other-project/settings.gradle.kts rename to 14_Settings_Plugins/my-other-project/settings.gradle diff --git a/14_Settings_Plugins/my-other-project/shared-utils/build.gradle.kts b/14_Settings_Plugins/my-other-project/shared-utils/build.gradle similarity index 100% rename from 14_Settings_Plugins/my-other-project/shared-utils/build.gradle.kts rename to 14_Settings_Plugins/my-other-project/shared-utils/build.gradle diff --git a/14_Settings_Plugins/my-project/app/build.gradle.kts b/14_Settings_Plugins/my-project/app/build.gradle similarity index 100% rename from 14_Settings_Plugins/my-project/app/build.gradle.kts rename to 14_Settings_Plugins/my-project/app/build.gradle diff --git a/14_Settings_Plugins/my-project/business-logic/build.gradle.kts b/14_Settings_Plugins/my-project/business-logic/build.gradle similarity index 100% rename from 14_Settings_Plugins/my-project/business-logic/build.gradle.kts rename to 14_Settings_Plugins/my-project/business-logic/build.gradle diff --git a/14_Settings_Plugins/my-project/data-model/build.gradle.kts b/14_Settings_Plugins/my-project/data-model/build.gradle similarity index 100% rename from 14_Settings_Plugins/my-project/data-model/build.gradle.kts rename to 14_Settings_Plugins/my-project/data-model/build.gradle diff --git a/14_Settings_Plugins/my-project/settings.gradle.kts b/14_Settings_Plugins/my-project/settings.gradle similarity index 100% rename from 14_Settings_Plugins/my-project/settings.gradle.kts rename to 14_Settings_Plugins/my-project/settings.gradle diff --git a/16_Source_Sets/my-android-project/app-android/build.gradle.kts b/16_Source_Sets/my-android-project/app-android/build.gradle similarity index 100% rename from 16_Source_Sets/my-android-project/app-android/build.gradle.kts rename to 16_Source_Sets/my-android-project/app-android/build.gradle diff --git a/16_Source_Sets/my-android-project/settings.gradle.kts b/16_Source_Sets/my-android-project/settings.gradle similarity index 100% rename from 16_Source_Sets/my-android-project/settings.gradle.kts rename to 16_Source_Sets/my-android-project/settings.gradle diff --git a/16_Source_Sets/my-build-logic/android-plugins/build.gradle.kts b/16_Source_Sets/my-build-logic/android-plugins/build.gradle similarity index 75% rename from 16_Source_Sets/my-build-logic/android-plugins/build.gradle.kts rename to 16_Source_Sets/my-build-logic/android-plugins/build.gradle index 191673c..6027c6b 100644 --- a/16_Source_Sets/my-build-logic/android-plugins/build.gradle.kts +++ b/16_Source_Sets/my-build-logic/android-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/16_Source_Sets/my-build-logic/android-plugins/src/main/kotlin/my-android-application.gradle.kts b/16_Source_Sets/my-build-logic/android-plugins/src/main/groovy/my-android-application.gradle similarity index 88% rename from 16_Source_Sets/my-build-logic/android-plugins/src/main/kotlin/my-android-application.gradle.kts rename to 16_Source_Sets/my-build-logic/android-plugins/src/main/groovy/my-android-application.gradle index 9b2d346..e024418 100644 --- a/16_Source_Sets/my-build-logic/android-plugins/src/main/kotlin/my-android-application.gradle.kts +++ b/16_Source_Sets/my-build-logic/android-plugins/src/main/groovy/my-android-application.gradle @@ -15,7 +15,7 @@ android { } applicationVariants.matching { it.name == "debug" }.all { - sourceSets.find { it.name == "debug" }!!.apply { + sourceSets.find { it.name == "debug" }.with { // get and configure an Android 'SourceProvider' (Build Type and Flavor specific) } } diff --git a/16_Source_Sets/my-build-logic/java-plugins/build.gradle b/16_Source_Sets/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/16_Source_Sets/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/16_Source_Sets/my-build-logic/java-plugins/build.gradle.kts b/16_Source_Sets/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/16_Source_Sets/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/16_Source_Sets/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/16_Source_Sets/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 67% rename from 16_Source_Sets/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 16_Source_Sets/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index e5407d9..01dad45 100644 --- a/16_Source_Sets/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/16_Source_Sets/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -3,8 +3,8 @@ plugins { id("application") } -tasks.register("runJava17") { - classpath = configurations.runtimeClasspath.get() + files(tasks.jar) +tasks.register("runJava17", JavaExec) { + classpath = configurations.runtimeClasspath + files(tasks.jar) javaLauncher.set(javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(17) }) diff --git a/16_Source_Sets/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/16_Source_Sets/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 51% rename from 16_Source_Sets/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 16_Source_Sets/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 857b728..d6f4be0 100644 --- a/16_Source_Sets/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/16_Source_Sets/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -1,6 +1,5 @@ import java.nio.file.Files import org.gradle.api.plugins.jvm.internal.JvmLanguageUtilities -import org.gradle.kotlin.dsl.support.serviceOf plugins { id("java") @@ -19,27 +18,27 @@ sourceSets.test { } -val extraFeature = sourceSets.create("extraFeature") -tasks.register(extraFeature.jarTaskName) { +def extraFeature = sourceSets.create("extraFeature") +tasks.register(extraFeature.jarTaskName, Jar) { from(extraFeature.output) archiveClassifier.set("extra-feature") } -val jvm = serviceOf() // if this does not compile, use 'serviceOf()' -jvm.registerJvmLanguageSourceDirectory(sourceSets.main.get(), "java17") { - compiledWithJava { +def jvm = services.get(JvmLanguageUtilities) +jvm.registerJvmLanguageSourceDirectory(sourceSets.main, "java17") { + it.compiledWithJava { javaCompiler.set(javaToolchains.compilerFor { - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion = JavaLanguageVersion.of(17) }) - classpath = sourceSets.main.get().compileClasspath + classpath = sourceSets.main.compileClasspath doLast { - val destRoot = destinationDirectory.get().asFile - val destVersions = File(destRoot, "META-INF/versions/17").also { it.mkdirs() } - destVersions.deleteRecursively() + def destRoot = destinationDirectory.get().asFile + def destVersions = new File(destRoot, "META-INF/versions/17") + destVersions.deleteDir() destVersions.mkdirs() - destRoot.listFiles()?.forEach { + destRoot.listFiles()?.each { if (it.name != "META-INF") { - Files.move(it.toPath(), File(destVersions, it.name).toPath()) + Files.move(it.toPath(), new File(destVersions, it.name).toPath()) } } } @@ -48,7 +47,7 @@ jvm.registerJvmLanguageSourceDirectory(sourceSets.main.get(), "java17") { tasks.jar { manifest { - attributes("Multi-Release" to true) + attributes("Multi-Release": true) } } @@ -62,6 +61,6 @@ dependencies { } java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } diff --git a/16_Source_Sets/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/16_Source_Sets/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 16_Source_Sets/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 16_Source_Sets/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/16_Source_Sets/my-build-logic/kotlin-plugins/build.gradle.kts b/16_Source_Sets/my-build-logic/kotlin-plugins/build.gradle similarity index 77% rename from 16_Source_Sets/my-build-logic/kotlin-plugins/build.gradle.kts rename to 16_Source_Sets/my-build-logic/kotlin-plugins/build.gradle index b34d438..ae49011 100644 --- a/16_Source_Sets/my-build-logic/kotlin-plugins/build.gradle.kts +++ b/16_Source_Sets/my-build-logic/kotlin-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/16_Source_Sets/my-build-logic/kotlin-plugins/src/main/kotlin/my-kotlin-multiplatform-lib.gradle.kts b/16_Source_Sets/my-build-logic/kotlin-plugins/src/main/groovy/my-kotlin-multiplatform-lib.gradle similarity index 100% rename from 16_Source_Sets/my-build-logic/kotlin-plugins/src/main/kotlin/my-kotlin-multiplatform-lib.gradle.kts rename to 16_Source_Sets/my-build-logic/kotlin-plugins/src/main/groovy/my-kotlin-multiplatform-lib.gradle diff --git a/16_Source_Sets/my-build-logic/settings.gradle.kts b/16_Source_Sets/my-build-logic/settings.gradle similarity index 100% rename from 16_Source_Sets/my-build-logic/settings.gradle.kts rename to 16_Source_Sets/my-build-logic/settings.gradle diff --git a/16_Source_Sets/my-build-logic/structure-plugins/build.gradle b/16_Source_Sets/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/16_Source_Sets/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/16_Source_Sets/my-build-logic/structure-plugins/build.gradle.kts b/16_Source_Sets/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/16_Source_Sets/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/16_Source_Sets/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/16_Source_Sets/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle similarity index 64% rename from 16_Source_Sets/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts rename to 16_Source_Sets/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle index f1751fc..3f4b784 100644 --- a/16_Source_Sets/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ b/16_Source_Sets/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -8,17 +8,17 @@ pluginManagement { dependencyResolutionManagement { repositories.mavenCentral() repositories.google() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() - }?.forEach { + rootDir.parentFile.listFiles()?.findAll { + new File(it, "settings.gradle").exists() + }?.each { if (it.path != rootDir.path) { includeBuild(it.path) } } } -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() -}?.forEach { +rootDir.listFiles()?.findAll { + new File(it, "build.gradle").exists() +}?.each { include(it.name) } diff --git a/16_Source_Sets/my-kotlin-multi-platform-project/settings.gradle.kts b/16_Source_Sets/my-kotlin-multi-platform-project/settings.gradle similarity index 100% rename from 16_Source_Sets/my-kotlin-multi-platform-project/settings.gradle.kts rename to 16_Source_Sets/my-kotlin-multi-platform-project/settings.gradle diff --git a/16_Source_Sets/my-kotlin-multi-platform-project/utils-kotlin/build.gradle.kts b/16_Source_Sets/my-kotlin-multi-platform-project/utils-kotlin/build.gradle similarity index 100% rename from 16_Source_Sets/my-kotlin-multi-platform-project/utils-kotlin/build.gradle.kts rename to 16_Source_Sets/my-kotlin-multi-platform-project/utils-kotlin/build.gradle diff --git a/16_Source_Sets/my-project/app/build.gradle.kts b/16_Source_Sets/my-project/app/build.gradle similarity index 100% rename from 16_Source_Sets/my-project/app/build.gradle.kts rename to 16_Source_Sets/my-project/app/build.gradle diff --git a/16_Source_Sets/my-project/business-logic/build.gradle.kts b/16_Source_Sets/my-project/business-logic/build.gradle similarity index 100% rename from 16_Source_Sets/my-project/business-logic/build.gradle.kts rename to 16_Source_Sets/my-project/business-logic/build.gradle diff --git a/16_Source_Sets/my-project/data-model/build.gradle.kts b/16_Source_Sets/my-project/data-model/build.gradle similarity index 100% rename from 16_Source_Sets/my-project/data-model/build.gradle.kts rename to 16_Source_Sets/my-project/data-model/build.gradle diff --git a/16_Source_Sets/my-project/settings.gradle.kts b/16_Source_Sets/my-project/settings.gradle similarity index 100% rename from 16_Source_Sets/my-project/settings.gradle.kts rename to 16_Source_Sets/my-project/settings.gradle diff --git a/17_Feature_Variants/my-build-logic/java-plugins/build.gradle b/17_Feature_Variants/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/17_Feature_Variants/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/17_Feature_Variants/my-build-logic/java-plugins/build.gradle.kts b/17_Feature_Variants/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/17_Feature_Variants/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/17_Feature_Variants/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/17_Feature_Variants/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 17_Feature_Variants/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 17_Feature_Variants/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/17_Feature_Variants/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/17_Feature_Variants/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 66% rename from 17_Feature_Variants/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 17_Feature_Variants/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index abf9b4b..d8f6c1e 100644 --- a/17_Feature_Variants/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/17_Feature_Variants/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -6,11 +6,11 @@ group = "org.example.my-app" version = "1.0" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } tasks.compileJava { - options.compilerArgs = listOf("-parameters") + options.compilerArgs = ["-parameters"] } // Centralized versions diff --git a/17_Feature_Variants/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/17_Feature_Variants/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 69% rename from 17_Feature_Variants/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 17_Feature_Variants/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle index 6e1983d..87583f0 100644 --- a/17_Feature_Variants/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts +++ b/17_Feature_Variants/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle @@ -3,8 +3,8 @@ plugins { id("java-library") } -val json = sourceSets.create("json") -val xml = sourceSets.create("xml") +def json = sourceSets.create("json") +def xml = sourceSets.create("xml") // java.registerFeature(json.name) { // usingSourceSet(json) @@ -13,19 +13,19 @@ val xml = sourceSets.create("xml") // } // Setting up what 'registerFeature(json.name)' ↑ would do step-by-step -tasks.register(json.jarTaskName) { +tasks.register(json.jarTaskName, Jar) { from(json.output) archiveClassifier.set(json.name) } -val apiElements = configurations.create(json.apiElementsConfigurationName) { - isCanBeResolved = false - isCanBeConsumed = true +def apiElements = configurations.create(json.apiElementsConfigurationName) { + canBeResolved = false + canBeConsumed = true attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_API)) - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY)) - attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR)) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_API)) + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.LIBRARY)) + attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR)) } extendsFrom(configurations.getByName(json.implementationConfigurationName)) @@ -36,14 +36,14 @@ val apiElements = configurations.create(json.apiElementsConfigurationName) { outgoing.capability("${project.group}:${project.name}-serialization:${project.version}") } -val runtimeElements = configurations.create(json.runtimeElementsConfigurationName) { - isCanBeResolved = false - isCanBeConsumed = true +def runtimeElements = configurations.create(json.runtimeElementsConfigurationName) { + canBeResolved = false + canBeConsumed = true attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY)) - attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR)) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.LIBRARY)) + attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR)) } extendsFrom(configurations.getByName(json.implementationConfigurationName)) @@ -54,7 +54,7 @@ val runtimeElements = configurations.create(json.runtimeElementsConfigurationNam outgoing.capability("${project.group}:${project.name}-serialization:${project.version}") } -val javaComponent = components["java"] as AdhocComponentWithVariants +def javaComponent = components["java"] javaComponent.addVariantsFromConfiguration(apiElements) { mapToOptional() } @@ -72,6 +72,6 @@ java.registerFeature(xml.name) { // Centralized versions dependencies { - "jsonImplementation"(platform("com.fasterxml.jackson:jackson-bom:2.13.3")) - "xmlImplementation"(platform("com.fasterxml.jackson:jackson-bom:2.13.3")) + jsonImplementation(platform("com.fasterxml.jackson:jackson-bom:2.13.3")) + xmlImplementation(platform("com.fasterxml.jackson:jackson-bom:2.13.3")) } diff --git a/17_Feature_Variants/my-build-logic/settings.gradle.kts b/17_Feature_Variants/my-build-logic/settings.gradle similarity index 100% rename from 17_Feature_Variants/my-build-logic/settings.gradle.kts rename to 17_Feature_Variants/my-build-logic/settings.gradle diff --git a/17_Feature_Variants/my-build-logic/structure-plugins/build.gradle b/17_Feature_Variants/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/17_Feature_Variants/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/17_Feature_Variants/my-build-logic/structure-plugins/build.gradle.kts b/17_Feature_Variants/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/17_Feature_Variants/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/19_The_Test_Task/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/17_Feature_Variants/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle similarity index 56% rename from 19_The_Test_Task/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts rename to 17_Feature_Variants/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle index 39bca3e..7dc5613 100644 --- a/19_The_Test_Task/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ b/17_Feature_Variants/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -6,15 +6,15 @@ pluginManagement { // Location of other components dependencyResolutionManagement { repositories.mavenCentral() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() - }?.forEach { + rootDir.parentFile.listFiles()?.findAll { + new File(it, "settings.gradle").exists() + }?.each { includeBuild(it.path) } } -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() -}?.forEach { +rootDir.listFiles()?.findAll { + new File(it, "build.gradle").exists() +}?.each { include(it.name) } diff --git a/17_Feature_Variants/my-project/app/build.gradle.kts b/17_Feature_Variants/my-project/app/build.gradle similarity index 100% rename from 17_Feature_Variants/my-project/app/build.gradle.kts rename to 17_Feature_Variants/my-project/app/build.gradle diff --git a/17_Feature_Variants/my-project/business-logic/build.gradle.kts b/17_Feature_Variants/my-project/business-logic/build.gradle similarity index 100% rename from 17_Feature_Variants/my-project/business-logic/build.gradle.kts rename to 17_Feature_Variants/my-project/business-logic/build.gradle diff --git a/17_Feature_Variants/my-project/data-model/build.gradle.kts b/17_Feature_Variants/my-project/data-model/build.gradle similarity index 100% rename from 17_Feature_Variants/my-project/data-model/build.gradle.kts rename to 17_Feature_Variants/my-project/data-model/build.gradle diff --git a/17_Feature_Variants/my-project/settings.gradle.kts b/17_Feature_Variants/my-project/settings.gradle similarity index 100% rename from 17_Feature_Variants/my-project/settings.gradle.kts rename to 17_Feature_Variants/my-project/settings.gradle diff --git a/18_Configuring_Testing/my-build-logic/java-plugins/build.gradle b/18_Configuring_Testing/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/18_Configuring_Testing/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/18_Configuring_Testing/my-build-logic/java-plugins/build.gradle.kts b/18_Configuring_Testing/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/18_Configuring_Testing/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/18_Configuring_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/18_Configuring_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 18_Configuring_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 18_Configuring_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/18_Configuring_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/18_Configuring_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 83% rename from 18_Configuring_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 18_Configuring_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 558b893..55431eb 100644 --- a/18_Configuring_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/18_Configuring_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -6,17 +6,17 @@ group = "org.example.my-app" version = "1.0" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } // === Setup without using Test Suites convenient API -tasks.test { +tasks.named("test") { useJUnitPlatform() // JUnit5 } -val integrationTest = sourceSets.create("integrationTest") +def integrationTest = sourceSets.create("integrationTest") -tasks.register(integrationTest.name) { +tasks.register(integrationTest.name, Test) { classpath = integrationTest.runtimeClasspath testClassesDirs = integrationTest.output.classesDirs @@ -28,10 +28,10 @@ tasks.register(integrationTest.name) { // === Alternative: use Test Suites API // testing { -// suites.getByName("test") { +// suites.getByName("test") { // useJUnitJupiter() // } -// suites.create("integrationTest") { +// suites.create("integrationTest", JvmTestSuite) { // // useJUnitJupiter() <- default for new suites // dependencies { // // Alternatives notation for "integrationTestImplementation(...)" @@ -42,9 +42,8 @@ tasks.register(integrationTest.name) { // // Source Set configuration // } // targets.all { -// testTask { +// testTask.configure { // options { -// this as JUnitPlatformOptions // excludeTags("slow") // } // } @@ -53,7 +52,7 @@ tasks.register(integrationTest.name) { // } // === -tasks.register("integrationTestSlow") { +tasks.register("integrationTestSlow", Test) { classpath = sourceSets["integrationTest"].runtimeClasspath testClassesDirs = sourceSets["integrationTest"].output.classesDirs diff --git a/18_Configuring_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/18_Configuring_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 18_Configuring_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 18_Configuring_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/18_Configuring_Testing/my-build-logic/settings.gradle.kts b/18_Configuring_Testing/my-build-logic/settings.gradle similarity index 100% rename from 18_Configuring_Testing/my-build-logic/settings.gradle.kts rename to 18_Configuring_Testing/my-build-logic/settings.gradle diff --git a/18_Configuring_Testing/my-build-logic/structure-plugins/build.gradle b/18_Configuring_Testing/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/18_Configuring_Testing/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/18_Configuring_Testing/my-build-logic/structure-plugins/build.gradle.kts b/18_Configuring_Testing/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/18_Configuring_Testing/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/17_Feature_Variants/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/18_Configuring_Testing/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle similarity index 56% rename from 17_Feature_Variants/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts rename to 18_Configuring_Testing/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle index 39bca3e..7dc5613 100644 --- a/17_Feature_Variants/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ b/18_Configuring_Testing/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -6,15 +6,15 @@ pluginManagement { // Location of other components dependencyResolutionManagement { repositories.mavenCentral() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() - }?.forEach { + rootDir.parentFile.listFiles()?.findAll { + new File(it, "settings.gradle").exists() + }?.each { includeBuild(it.path) } } -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() -}?.forEach { +rootDir.listFiles()?.findAll { + new File(it, "build.gradle").exists() +}?.each { include(it.name) } diff --git a/18_Configuring_Testing/my-project/app/build.gradle.kts b/18_Configuring_Testing/my-project/app/build.gradle similarity index 100% rename from 18_Configuring_Testing/my-project/app/build.gradle.kts rename to 18_Configuring_Testing/my-project/app/build.gradle diff --git a/18_Configuring_Testing/my-project/business-logic/build.gradle.kts b/18_Configuring_Testing/my-project/business-logic/build.gradle similarity index 100% rename from 18_Configuring_Testing/my-project/business-logic/build.gradle.kts rename to 18_Configuring_Testing/my-project/business-logic/build.gradle diff --git a/18_Configuring_Testing/my-project/data-model/build.gradle.kts b/18_Configuring_Testing/my-project/data-model/build.gradle similarity index 100% rename from 18_Configuring_Testing/my-project/data-model/build.gradle.kts rename to 18_Configuring_Testing/my-project/data-model/build.gradle diff --git a/18_Configuring_Testing/my-project/settings.gradle.kts b/18_Configuring_Testing/my-project/settings.gradle similarity index 100% rename from 18_Configuring_Testing/my-project/settings.gradle.kts rename to 18_Configuring_Testing/my-project/settings.gradle diff --git a/19_The_Test_Task/my-build-logic/java-plugins/build.gradle b/19_The_Test_Task/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/19_The_Test_Task/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/19_The_Test_Task/my-build-logic/java-plugins/build.gradle.kts b/19_The_Test_Task/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/19_The_Test_Task/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/19_The_Test_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/19_The_Test_Task/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 19_The_Test_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 19_The_Test_Task/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/19_The_Test_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/19_The_Test_Task/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 83% rename from 19_The_Test_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 19_The_Test_Task/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 65aa7fb..9a6c8b3 100644 --- a/19_The_Test_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/19_The_Test_Task/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -6,7 +6,7 @@ group = "org.example.my-app" version = "1.0" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } dependencies { @@ -25,15 +25,14 @@ tasks.test { minHeapSize = "1g" // aka -Xms // jvmArgs("-XX:+HeapDumpOnOutOfMemoryError") - jvmArgumentProviders.add(CommandLineArgumentProvider { - listOf("-XX:+HeapDumpOnOutOfMemoryError") - }) + jvmArgumentProviders.add({ + ["-XX:+HeapDumpOnOutOfMemoryError"] + } as CommandLineArgumentProvider) systemProperty("file.encoding", "UTF-8") systemProperty("java.awt.headless", "true") options { - this as JUnitPlatformOptions excludeTags("memoryHeavy") } diff --git a/19_The_Test_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/19_The_Test_Task/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 19_The_Test_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 19_The_Test_Task/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/19_The_Test_Task/my-build-logic/settings.gradle.kts b/19_The_Test_Task/my-build-logic/settings.gradle similarity index 100% rename from 19_The_Test_Task/my-build-logic/settings.gradle.kts rename to 19_The_Test_Task/my-build-logic/settings.gradle diff --git a/19_The_Test_Task/my-build-logic/structure-plugins/build.gradle b/19_The_Test_Task/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/19_The_Test_Task/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/19_The_Test_Task/my-build-logic/structure-plugins/build.gradle.kts b/19_The_Test_Task/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/19_The_Test_Task/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/14_Settings_Plugins/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/19_The_Test_Task/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle similarity index 56% rename from 14_Settings_Plugins/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts rename to 19_The_Test_Task/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle index 39bca3e..7dc5613 100644 --- a/14_Settings_Plugins/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ b/19_The_Test_Task/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -6,15 +6,15 @@ pluginManagement { // Location of other components dependencyResolutionManagement { repositories.mavenCentral() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() - }?.forEach { + rootDir.parentFile.listFiles()?.findAll { + new File(it, "settings.gradle").exists() + }?.each { includeBuild(it.path) } } -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() -}?.forEach { +rootDir.listFiles()?.findAll { + new File(it, "build.gradle").exists() +}?.each { include(it.name) } diff --git a/19_The_Test_Task/my-project/app/build.gradle.kts b/19_The_Test_Task/my-project/app/build.gradle similarity index 100% rename from 19_The_Test_Task/my-project/app/build.gradle.kts rename to 19_The_Test_Task/my-project/app/build.gradle diff --git a/19_The_Test_Task/my-project/business-logic/build.gradle.kts b/19_The_Test_Task/my-project/business-logic/build.gradle similarity index 100% rename from 19_The_Test_Task/my-project/business-logic/build.gradle.kts rename to 19_The_Test_Task/my-project/business-logic/build.gradle diff --git a/19_The_Test_Task/my-project/data-model/build.gradle.kts b/19_The_Test_Task/my-project/data-model/build.gradle similarity index 100% rename from 19_The_Test_Task/my-project/data-model/build.gradle.kts rename to 19_The_Test_Task/my-project/data-model/build.gradle diff --git a/19_The_Test_Task/my-project/settings.gradle.kts b/19_The_Test_Task/my-project/settings.gradle similarity index 100% rename from 19_The_Test_Task/my-project/settings.gradle.kts rename to 19_The_Test_Task/my-project/settings.gradle diff --git a/20_Test_Fixtures/my-build-logic/java-plugins/build.gradle b/20_Test_Fixtures/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/20_Test_Fixtures/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/20_Test_Fixtures/my-build-logic/java-plugins/build.gradle.kts b/20_Test_Fixtures/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/20_Test_Fixtures/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/20_Test_Fixtures/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/20_Test_Fixtures/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 20_Test_Fixtures/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 20_Test_Fixtures/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/20_Test_Fixtures/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/20_Test_Fixtures/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 89% rename from 20_Test_Fixtures/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 20_Test_Fixtures/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 9134435..f9e2c50 100644 --- a/20_Test_Fixtures/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/20_Test_Fixtures/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -6,7 +6,7 @@ group = "org.example.my-app" version = "1.0" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } tasks.test { diff --git a/20_Test_Fixtures/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/20_Test_Fixtures/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 81% rename from 20_Test_Fixtures/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 20_Test_Fixtures/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle index e6e5a41..6588a9a 100644 --- a/20_Test_Fixtures/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts +++ b/20_Test_Fixtures/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle @@ -4,7 +4,7 @@ plugins { id("java-test-fixtures") } -val test = sourceSets.test.get() +def test = sourceSets.test java.registerFeature(test.name) { usingSourceSet(test) } diff --git a/20_Test_Fixtures/my-build-logic/settings.gradle.kts b/20_Test_Fixtures/my-build-logic/settings.gradle similarity index 100% rename from 20_Test_Fixtures/my-build-logic/settings.gradle.kts rename to 20_Test_Fixtures/my-build-logic/settings.gradle diff --git a/20_Test_Fixtures/my-build-logic/structure-plugins/build.gradle b/20_Test_Fixtures/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/20_Test_Fixtures/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/20_Test_Fixtures/my-build-logic/structure-plugins/build.gradle.kts b/20_Test_Fixtures/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/20_Test_Fixtures/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/20_Test_Fixtures/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle b/20_Test_Fixtures/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle new file mode 100644 index 0000000..7dc5613 --- /dev/null +++ b/20_Test_Fixtures/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -0,0 +1,20 @@ +// Locations of Gradle plugins +pluginManagement { + repositories.gradlePluginPortal() +} + +// Location of other components +dependencyResolutionManagement { + repositories.mavenCentral() + rootDir.parentFile.listFiles()?.findAll { + new File(it, "settings.gradle").exists() + }?.each { + includeBuild(it.path) + } +} + +rootDir.listFiles()?.findAll { + new File(it, "build.gradle").exists() +}?.each { + include(it.name) +} diff --git a/20_Test_Fixtures/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/20_Test_Fixtures/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts deleted file mode 100644 index 39bca3e..0000000 --- a/20_Test_Fixtures/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ /dev/null @@ -1,20 +0,0 @@ -// Locations of Gradle plugins -pluginManagement { - repositories.gradlePluginPortal() -} - -// Location of other components -dependencyResolutionManagement { - repositories.mavenCentral() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() - }?.forEach { - includeBuild(it.path) - } -} - -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() -}?.forEach { - include(it.name) -} diff --git a/20_Test_Fixtures/my-project/app/build.gradle.kts b/20_Test_Fixtures/my-project/app/build.gradle similarity index 100% rename from 20_Test_Fixtures/my-project/app/build.gradle.kts rename to 20_Test_Fixtures/my-project/app/build.gradle diff --git a/20_Test_Fixtures/my-project/business-logic/build.gradle.kts b/20_Test_Fixtures/my-project/business-logic/build.gradle similarity index 100% rename from 20_Test_Fixtures/my-project/business-logic/build.gradle.kts rename to 20_Test_Fixtures/my-project/business-logic/build.gradle diff --git a/20_Test_Fixtures/my-project/data-model/build.gradle.kts b/20_Test_Fixtures/my-project/data-model/build.gradle similarity index 100% rename from 20_Test_Fixtures/my-project/data-model/build.gradle.kts rename to 20_Test_Fixtures/my-project/data-model/build.gradle diff --git a/20_Test_Fixtures/my-project/settings.gradle.kts b/20_Test_Fixtures/my-project/settings.gradle similarity index 100% rename from 20_Test_Fixtures/my-project/settings.gradle.kts rename to 20_Test_Fixtures/my-project/settings.gradle diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/build.gradle b/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/build.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 63% rename from 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index e7c1a71..779be31 100644 --- a/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -6,16 +6,16 @@ plugins { } // Integrate INTEGRATION_TEST results into the aggregated UNIT_TEST coverage results -tasks.testCodeCoverageReport { +tasks.named("testCodeCoverageReport") { executionData.from( - configurations.aggregateCodeCoverageReportResults.get() + configurations.aggregateCodeCoverageReportResults .incoming.artifactView { lenient(true) withVariantReselection() attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.VERIFICATION)) - attribute(TestSuiteType.TEST_SUITE_TYPE_ATTRIBUTE, objects.named(TestSuiteType.INTEGRATION_TEST)) - attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType.JACOCO_RESULTS)) + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.VERIFICATION)) + attribute(TestSuiteType.TEST_SUITE_TYPE_ATTRIBUTE, objects.named(TestSuiteType, TestSuiteType.INTEGRATION_TEST)) + attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType, VerificationType.JACOCO_RESULTS)) attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.BINARY_DATA_TYPE) } }.files @@ -23,22 +23,22 @@ tasks.testCodeCoverageReport { } // Integrate INTEGRATION_TEST results into the aggregated UNIT_TEST test results -tasks.testAggregateTestReport { +tasks.named("testAggregateTestReport") { testResults.from( - configurations.aggregateTestReportResults.get() + configurations.aggregateTestReportResults .incoming.artifactView { lenient(true) withVariantReselection() attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.VERIFICATION)) - attribute(TestSuiteType.TEST_SUITE_TYPE_ATTRIBUTE, objects.named(TestSuiteType.INTEGRATION_TEST)) - attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType.TEST_RESULTS)) + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.VERIFICATION)) + attribute(TestSuiteType.TEST_SUITE_TYPE_ATTRIBUTE, objects.named(TestSuiteType, TestSuiteType.INTEGRATION_TEST)) + attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType, VerificationType.TEST_RESULTS)) } }.files ) } -tasks.check { - dependsOn(tasks.testAggregateTestReport) - dependsOn(tasks.testCodeCoverageReport) +tasks.named("check") { + dependsOn(tasks.named("testAggregateTestReport")) + dependsOn(tasks.named("testCodeCoverageReport")) } diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 71% rename from 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 000627a..1ca440e 100644 --- a/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -7,13 +7,13 @@ group = "org.example.my-app" version = "1.0" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } -testing.suites.register("integrationTest") { - testType.set(TestSuiteType.INTEGRATION_TEST) +testing.suites.register("integrationTest", JvmTestSuite) { + testType = TestSuiteType.INTEGRATION_TEST configurations[sources.implementationConfigurationName].extendsFrom( - configurations.implementation.get() + configurations.implementation ) } @@ -21,7 +21,7 @@ jacoco { // ... } -tasks.test { +tasks.named("test") { useJUnitPlatform { // JUnit5 excludeTags("slow") } @@ -30,9 +30,9 @@ tasks.test { } } -val testSlow = tasks.register("testSlow") { - testClassesDirs = sourceSets.test.get().output.classesDirs - classpath = sourceSets.test.get().runtimeClasspath +def testSlow = tasks.register("testSlow", Test) { + testClassesDirs = sourceSets.test.output.classesDirs + classpath = sourceSets.test.runtimeClasspath useJUnitPlatform { includeTags("slow") } diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 21_Test_and_Code_Coverage_Reporting/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/settings.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-build-logic/settings.gradle similarity index 100% rename from 21_Test_and_Code_Coverage_Reporting/my-build-logic/settings.gradle.kts rename to 21_Test_and_Code_Coverage_Reporting/my-build-logic/settings.gradle diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/build.gradle b/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/build.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle b/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle new file mode 100644 index 0000000..7dc5613 --- /dev/null +++ b/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -0,0 +1,20 @@ +// Locations of Gradle plugins +pluginManagement { + repositories.gradlePluginPortal() +} + +// Location of other components +dependencyResolutionManagement { + repositories.mavenCentral() + rootDir.parentFile.listFiles()?.findAll { + new File(it, "settings.gradle").exists() + }?.each { + includeBuild(it.path) + } +} + +rootDir.listFiles()?.findAll { + new File(it, "build.gradle").exists() +}?.each { + include(it.name) +} diff --git a/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts deleted file mode 100644 index 39bca3e..0000000 --- a/21_Test_and_Code_Coverage_Reporting/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ /dev/null @@ -1,20 +0,0 @@ -// Locations of Gradle plugins -pluginManagement { - repositories.gradlePluginPortal() -} - -// Location of other components -dependencyResolutionManagement { - repositories.mavenCentral() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() - }?.forEach { - includeBuild(it.path) - } -} - -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() -}?.forEach { - include(it.name) -} diff --git a/21_Test_and_Code_Coverage_Reporting/my-project/app/build.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-project/app/build.gradle similarity index 100% rename from 21_Test_and_Code_Coverage_Reporting/my-project/app/build.gradle.kts rename to 21_Test_and_Code_Coverage_Reporting/my-project/app/build.gradle diff --git a/21_Test_and_Code_Coverage_Reporting/my-project/business-logic/build.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-project/business-logic/build.gradle similarity index 100% rename from 21_Test_and_Code_Coverage_Reporting/my-project/business-logic/build.gradle.kts rename to 21_Test_and_Code_Coverage_Reporting/my-project/business-logic/build.gradle diff --git a/21_Test_and_Code_Coverage_Reporting/my-project/data-model/build.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-project/data-model/build.gradle similarity index 100% rename from 21_Test_and_Code_Coverage_Reporting/my-project/data-model/build.gradle.kts rename to 21_Test_and_Code_Coverage_Reporting/my-project/data-model/build.gradle diff --git a/21_Test_and_Code_Coverage_Reporting/my-project/settings.gradle.kts b/21_Test_and_Code_Coverage_Reporting/my-project/settings.gradle similarity index 100% rename from 21_Test_and_Code_Coverage_Reporting/my-project/settings.gradle.kts rename to 21_Test_and_Code_Coverage_Reporting/my-project/settings.gradle diff --git a/22_The_JavaCompile_Task/my-build-logic/java-plugins/build.gradle b/22_The_JavaCompile_Task/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..3eca95a --- /dev/null +++ b/22_The_JavaCompile_Task/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} \ No newline at end of file diff --git a/22_The_JavaCompile_Task/my-build-logic/java-plugins/build.gradle.kts b/22_The_JavaCompile_Task/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/22_The_JavaCompile_Task/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 87% rename from 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 89696ad..8da3918 100644 --- a/22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -6,11 +6,11 @@ group = "org.example.my-app" version = "1.0" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } -tasks.withType().configureEach { - options.isFork = true +tasks.withType(JavaCompile).configureEach { + options.fork = true // options.forkOptions.jvmArgumentProviders.add { listOf("-Xmx4g") } options.forkOptions.memoryMaximumSize = "4g" @@ -24,7 +24,7 @@ tasks.withType().configureEach { } -tasks.test { +tasks.named("test") { useJUnitPlatform() // JUnit5 } diff --git a/22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 22_The_JavaCompile_Task/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/22_The_JavaCompile_Task/my-build-logic/settings.gradle.kts b/22_The_JavaCompile_Task/my-build-logic/settings.gradle similarity index 100% rename from 22_The_JavaCompile_Task/my-build-logic/settings.gradle.kts rename to 22_The_JavaCompile_Task/my-build-logic/settings.gradle diff --git a/22_The_JavaCompile_Task/my-build-logic/structure-plugins/build.gradle b/22_The_JavaCompile_Task/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/22_The_JavaCompile_Task/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/22_The_JavaCompile_Task/my-build-logic/structure-plugins/build.gradle.kts b/22_The_JavaCompile_Task/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/22_The_JavaCompile_Task/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/22_The_JavaCompile_Task/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle b/22_The_JavaCompile_Task/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle new file mode 100644 index 0000000..5526075 --- /dev/null +++ b/22_The_JavaCompile_Task/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -0,0 +1,20 @@ +// Locations of Gradle plugins +pluginManagement { + repositories.gradlePluginPortal() +} + +// Location of other components +dependencyResolutionManagement { + repositories.mavenCentral() + rootDir.parentFile.listFiles()?.findAll { + new File(it, "settings.gradle").exists() + }?.each { + includeBuild(it.path) + } +} + +rootDir.listFiles()?.findAll { + new File(it, "build.gradle").exists() +}?.each { + include(it.name) +} \ No newline at end of file diff --git a/22_The_JavaCompile_Task/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/22_The_JavaCompile_Task/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts deleted file mode 100644 index 39bca3e..0000000 --- a/22_The_JavaCompile_Task/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ /dev/null @@ -1,20 +0,0 @@ -// Locations of Gradle plugins -pluginManagement { - repositories.gradlePluginPortal() -} - -// Location of other components -dependencyResolutionManagement { - repositories.mavenCentral() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() - }?.forEach { - includeBuild(it.path) - } -} - -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() -}?.forEach { - include(it.name) -} diff --git a/22_The_JavaCompile_Task/my-project/app/build.gradle.kts b/22_The_JavaCompile_Task/my-project/app/build.gradle similarity index 100% rename from 22_The_JavaCompile_Task/my-project/app/build.gradle.kts rename to 22_The_JavaCompile_Task/my-project/app/build.gradle diff --git a/22_The_JavaCompile_Task/my-project/business-logic/build.gradle.kts b/22_The_JavaCompile_Task/my-project/business-logic/build.gradle similarity index 100% rename from 22_The_JavaCompile_Task/my-project/business-logic/build.gradle.kts rename to 22_The_JavaCompile_Task/my-project/business-logic/build.gradle diff --git a/22_The_JavaCompile_Task/my-project/data-model/build.gradle.kts b/22_The_JavaCompile_Task/my-project/data-model/build.gradle similarity index 100% rename from 22_The_JavaCompile_Task/my-project/data-model/build.gradle.kts rename to 22_The_JavaCompile_Task/my-project/data-model/build.gradle diff --git a/22_The_JavaCompile_Task/my-project/settings.gradle.kts b/22_The_JavaCompile_Task/my-project/settings.gradle similarity index 100% rename from 22_The_JavaCompile_Task/my-project/settings.gradle.kts rename to 22_The_JavaCompile_Task/my-project/settings.gradle diff --git a/23_Caching/my-build-logic/java-plugins/build.gradle b/23_Caching/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/23_Caching/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/23_Caching/my-build-logic/java-plugins/build.gradle.kts b/23_Caching/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/23_Caching/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/23_Caching/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/23_Caching/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 23_Caching/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 23_Caching/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/23_Caching/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/23_Caching/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 75% rename from 23_Caching/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 23_Caching/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 3e4844d..db0e08a 100644 --- a/23_Caching/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/23_Caching/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -6,7 +6,7 @@ group = "org.example.my-app" version = "1.0" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } // Centralized versions diff --git a/23_Caching/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/23_Caching/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 23_Caching/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 23_Caching/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/23_Caching/my-build-logic/settings.gradle.kts b/23_Caching/my-build-logic/settings.gradle similarity index 100% rename from 23_Caching/my-build-logic/settings.gradle.kts rename to 23_Caching/my-build-logic/settings.gradle diff --git a/23_Caching/my-project/app/build.gradle.kts b/23_Caching/my-project/app/build.gradle similarity index 100% rename from 23_Caching/my-project/app/build.gradle.kts rename to 23_Caching/my-project/app/build.gradle diff --git a/23_Caching/my-project/business-logic/build.gradle.kts b/23_Caching/my-project/business-logic/build.gradle similarity index 100% rename from 23_Caching/my-project/business-logic/build.gradle.kts rename to 23_Caching/my-project/business-logic/build.gradle diff --git a/23_Caching/my-project/data-model/build.gradle.kts b/23_Caching/my-project/data-model/build.gradle similarity index 100% rename from 23_Caching/my-project/data-model/build.gradle.kts rename to 23_Caching/my-project/data-model/build.gradle diff --git a/23_Caching/my-project/settings.gradle.kts b/23_Caching/my-project/settings.gradle similarity index 55% rename from 23_Caching/my-project/settings.gradle.kts rename to 23_Caching/my-project/settings.gradle index dba363a..83b00c5 100644 --- a/23_Caching/my-project/settings.gradle.kts +++ b/23_Caching/my-project/settings.gradle @@ -5,20 +5,20 @@ dependencyResolutionManagement { repositories.mavenCentral() } -rootDir.listFiles()?.filter { File(it, "build.gradle.kts").exists() }?.forEach { +rootDir.listFiles().findAll { new File(it, "build.gradle").exists() }.each { include(it.name) } -val runsOnCI = providers.environmentVariable("CI").getOrElse("false").toBoolean() +def runsOnCI = providers.environmentVariable("CI").getOrElse("false").toBoolean() buildCache { - remote { - isEnabled = false // because this example cache does not actually exist :) - url = uri("https://onepiece.software/cache/") + remote(HttpBuildCache) { + enabled = false // because this example cache does not actually exist :) + url = "https://onepiece.software/cache/" credentials { username = "jendrik" password = "..." } - isPush = runsOnCI + push = runsOnCI } local { // isEnabled = false diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/build.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..6784052 --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id 'groovy-gradle-plugin' +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/build.gradle.kts b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle new file mode 100644 index 0000000..69394c5 --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -0,0 +1,4 @@ +plugins { + id 'my-java-base' + id 'application' +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle new file mode 100644 index 0000000..c75f7ba --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -0,0 +1,23 @@ +plugins { + id 'java' +} + +group = 'org.example.my-app' +version = '1.0' + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} + +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' +} + +tasks.named('test') { // tasks.test -> tasks.getByName('test') -- only in Groovy DSL + useJUnitPlatform() +} + +// Centralized versions +dependencies.constraints { + implementation 'org.apache.commons:commons-lang3:3.9' +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle new file mode 100644 index 0000000..27b8520 --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle @@ -0,0 +1,4 @@ +plugins { + id 'my-java-base' + id 'java-library' +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts deleted file mode 100644 index b8a5d7a..0000000 --- a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id("java") -} - -group = "org.example.my-app" -version = "1.0" - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} - -tasks.withType().configureEach { - options.encoding = "UTF-8" -} - -tasks.test { - useJUnitPlatform() -} - -// Centralized versions -dependencies.constraints { - implementation("org.apache.commons:commons-lang3:3.9") -} diff --git a/25_Using_Java_to_configure_builds/my-build-logic/settings.gradle.kts b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/settings.gradle similarity index 58% rename from 25_Using_Java_to_configure_builds/my-build-logic/settings.gradle.kts rename to 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/settings.gradle index a0a7f16..3f6e2c1 100644 --- a/25_Using_Java_to_configure_builds/my-build-logic/settings.gradle.kts +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/settings.gradle @@ -2,5 +2,5 @@ dependencyResolutionManagement { repositories.gradlePluginPortal() } -include("structure-plugins") -include("java-plugins") +include 'structure-plugins' +include 'java-plugins' diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/build.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/build.gradle new file mode 100644 index 0000000..6784052 --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id 'groovy-gradle-plugin' +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/build.gradle.kts b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle new file mode 100644 index 0000000..1067a96 --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/src/main/groovy/my-project-structure.settings.gradle @@ -0,0 +1,20 @@ +// Locations of Gradle plugins +pluginManagement { + repositories.gradlePluginPortal() +} + +// Location of other components +dependencyResolutionManagement { + repositories.mavenCentral() + rootDir.parentFile.listFiles().findAll { + new File(it, 'settings.gradle.kts').exists() || new File(it, 'settings.gradle').exists() + }.each { + includeBuild it.path + } +} + +rootDir.listFiles().findAll { + new File(it, 'build.gradle.kts').exists() || new File(it, 'build.gradle').exists() +}.each { + include it.name +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts b/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts deleted file mode 100644 index c370fd1..0000000 --- a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/structure-plugins/src/main/kotlin/my-project-structure.settings.gradle.kts +++ /dev/null @@ -1,20 +0,0 @@ -// Locations of Gradle plugins -pluginManagement { - repositories.gradlePluginPortal() -} - -// Location of other components -dependencyResolutionManagement { - repositories.mavenCentral() - rootDir.parentFile.listFiles()?.filter { - File(it, "settings.gradle.kts").exists() || File(it, "settings.gradle").exists() - }?.forEach { - includeBuild(it.path) - } -} - -rootDir.listFiles()?.filter { - File(it, "build.gradle.kts").exists() || File(it, "build.gradle").exists() -}?.forEach { - include(it.name) -} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-project/app/build.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-project/app/build.gradle new file mode 100644 index 0000000..9a5696d --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-project/app/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'my-java-application' +} + +application { + mainClass = 'myproject.MyApplication' +} + +dependencies { + implementation 'org.example.my-app:business-logic' +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-project/app/build.gradle.kts b/24_Kotlin_DSL_and_Groovy_DSL/my-project/app/build.gradle.kts deleted file mode 100644 index de679b3..0000000 --- a/24_Kotlin_DSL_and_Groovy_DSL/my-project/app/build.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id("my-java-application") -} - -application { - mainClass.set("myproject.MyApplication") -} - -dependencies { - implementation("org.example.my-app:business-logic") -} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-project/business-logic/build.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-project/business-logic/build.gradle new file mode 100644 index 0000000..ae1f16a --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-project/business-logic/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'my-java-library' +} + +dependencies { + implementation 'org.apache.commons:commons-lang3' + + api 'org.example.my-app:data-model' +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-project/data-model/build.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-project/data-model/build.gradle new file mode 100644 index 0000000..488b88a --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-project/data-model/build.gradle @@ -0,0 +1,3 @@ +plugins { + id 'my-java-library' +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-project/settings.gradle b/24_Kotlin_DSL_and_Groovy_DSL/my-project/settings.gradle new file mode 100644 index 0000000..cb68412 --- /dev/null +++ b/24_Kotlin_DSL_and_Groovy_DSL/my-project/settings.gradle @@ -0,0 +1,6 @@ +pluginManagement { + includeBuild '../my-build-logic' +} +plugins { + id 'my-project-structure' +} diff --git a/25_Using_Java_to_configure_builds/my-build-logic/java-plugins/build.gradle.kts b/25_Using_Java_to_configure_builds/my-build-logic/java-plugins/build.gradle similarity index 100% rename from 25_Using_Java_to_configure_builds/my-build-logic/java-plugins/build.gradle.kts rename to 25_Using_Java_to_configure_builds/my-build-logic/java-plugins/build.gradle diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/settings.gradle.kts b/25_Using_Java_to_configure_builds/my-build-logic/settings.gradle similarity index 100% rename from 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/settings.gradle.kts rename to 25_Using_Java_to_configure_builds/my-build-logic/settings.gradle diff --git a/25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/build.gradle.kts b/25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/build.gradle similarity index 100% rename from 25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/build.gradle.kts rename to 25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/build.gradle diff --git a/25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/src/main/java/myproject/gradle/MyProjectStructureSettingsPlugin.java b/25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/src/main/java/myproject/gradle/MyProjectStructureSettingsPlugin.java index 6e3cb66..f924918 100644 --- a/25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/src/main/java/myproject/gradle/MyProjectStructureSettingsPlugin.java +++ b/25_Using_Java_to_configure_builds/my-build-logic/structure-plugins/src/main/java/myproject/gradle/MyProjectStructureSettingsPlugin.java @@ -22,13 +22,13 @@ public void apply(Settings settings) { // Location of other components dependencyResolutionManagement.getRepositories().mavenCentral(); for (File folder: rootDir.getParentFile().listFiles()) { - if (new File(folder, "settings.gradle.kts").exists()) { + if (new File(folder, "settings.gradle").exists()) { settings.includeBuild(folder.getPath()); } } for (File folder: rootDir.listFiles()) { - if (new File(folder, "build.gradle.kts").exists()) { + if (new File(folder, "build.gradle").exists()) { settings.include(folder.getName()); } } diff --git a/25_Using_Java_to_configure_builds/my-project/app/build.gradle.kts b/25_Using_Java_to_configure_builds/my-project/app/build.gradle similarity index 100% rename from 25_Using_Java_to_configure_builds/my-project/app/build.gradle.kts rename to 25_Using_Java_to_configure_builds/my-project/app/build.gradle diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-project/business-logic/build.gradle.kts b/25_Using_Java_to_configure_builds/my-project/business-logic/build.gradle similarity index 100% rename from 24_Kotlin_DSL_and_Groovy_DSL/my-project/business-logic/build.gradle.kts rename to 25_Using_Java_to_configure_builds/my-project/business-logic/build.gradle diff --git a/25_Using_Java_to_configure_builds/my-project/business-logic/build.gradle.kts b/25_Using_Java_to_configure_builds/my-project/business-logic/build.gradle.kts deleted file mode 100644 index 87d9971..0000000 --- a/25_Using_Java_to_configure_builds/my-project/business-logic/build.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -plugins { - id("my-java-library") -} - -dependencies { - implementation("org.apache.commons:commons-lang3") - - api("org.example.my-app:data-model") -} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-project/data-model/build.gradle.kts b/25_Using_Java_to_configure_builds/my-project/data-model/build.gradle similarity index 100% rename from 24_Kotlin_DSL_and_Groovy_DSL/my-project/data-model/build.gradle.kts rename to 25_Using_Java_to_configure_builds/my-project/data-model/build.gradle diff --git a/25_Using_Java_to_configure_builds/my-project/data-model/build.gradle.kts b/25_Using_Java_to_configure_builds/my-project/data-model/build.gradle.kts deleted file mode 100644 index 2cdc125..0000000 --- a/25_Using_Java_to_configure_builds/my-project/data-model/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - id("my-java-library") -} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-project/settings.gradle.kts b/25_Using_Java_to_configure_builds/my-project/settings.gradle similarity index 100% rename from 24_Kotlin_DSL_and_Groovy_DSL/my-project/settings.gradle.kts rename to 25_Using_Java_to_configure_builds/my-project/settings.gradle diff --git a/25_Using_Java_to_configure_builds/my-project/settings.gradle.kts b/25_Using_Java_to_configure_builds/my-project/settings.gradle.kts deleted file mode 100644 index e410bea..0000000 --- a/25_Using_Java_to_configure_builds/my-project/settings.gradle.kts +++ /dev/null @@ -1,6 +0,0 @@ -pluginManagement { - includeBuild("../my-build-logic") -} -plugins { - id("my-project-structure") -} diff --git a/26_The_Classpath/my-project/build.gradle.kts b/26_The_Classpath/my-project/build.gradle similarity index 55% rename from 26_The_Classpath/my-project/build.gradle.kts rename to 26_The_Classpath/my-project/build.gradle index bc018cd..d115493 100644 --- a/26_The_Classpath/my-project/build.gradle.kts +++ b/26_The_Classpath/my-project/build.gradle @@ -1,12 +1,12 @@ repositories.mavenCentral() -val implementation = configurations.create("implementation") -val runtimeOnly = configurations.create("runtimeOnly") -val compileClasspath = configurations.create("compileClasspath") { - extendsFrom(implementation) +configurations.create("implementation") +configurations.create("runtimeOnly") +configurations.create("compileClasspath") { + extendsFrom(configurations.implementation) } -val runtimeClasspath = configurations.create("runtimeClasspath") { - extendsFrom(implementation, runtimeOnly) +configurations.create("runtimeClasspath") { + extendsFrom(configurations.implementation, configurations.runtimeOnly) } // Other classpath configurations we should have: @@ -19,22 +19,22 @@ dependencies { runtimeOnly("org.slf4j:slf4j-simple:2.0.3") } -val compileJava = tasks.register("compileJava") { +def compileJava = tasks.register("compileJava", JavaCompile) { destinationDirectory.set(layout.buildDirectory.dir("classes")) source(layout.projectDirectory.dir("src")) sourceCompatibility = "11" targetCompatibility = "11" - classpath = files(compileClasspath) + classpath = files(configurations.compileClasspath) } -tasks.register("run") { +tasks.register("run", JavaExec) { mainClass.set("mypackage.App") - classpath = files(compileJava, runtimeClasspath) + classpath = files(compileJava, configurations.runtimeClasspath) } -tasks.register("test") { +tasks.register("test", Test) { testClassesDirs = files(compileJava) - classpath = files(compileJava, runtimeClasspath) + classpath = files(compileJava, configurations.runtimeClasspath) binaryResultsDirectory.set(layout.buildDirectory.dir("test-results")) reports.junitXml.required.set(false) reports.html.required.set(false) diff --git a/26_The_Classpath/my-project/settings.gradle.kts b/26_The_Classpath/my-project/settings.gradle similarity index 100% rename from 26_The_Classpath/my-project/settings.gradle.kts rename to 26_The_Classpath/my-project/settings.gradle diff --git a/27_Multiple_Compile_Classpaths/my-project/app/build.gradle.kts b/27_Multiple_Compile_Classpaths/my-project/app/build.gradle similarity index 54% rename from 27_Multiple_Compile_Classpaths/my-project/app/build.gradle.kts rename to 27_Multiple_Compile_Classpaths/my-project/app/build.gradle index c3b0440..d84732b 100644 --- a/27_Multiple_Compile_Classpaths/my-project/app/build.gradle.kts +++ b/27_Multiple_Compile_Classpaths/my-project/app/build.gradle @@ -1,15 +1,15 @@ -val implementation = configurations.create("implementation") -val runtimeOnly = configurations.create("runtimeOnly") -val compileClasspath = configurations.create("compileClasspath") { - extendsFrom(implementation) +configurations.create("implementation") +configurations.create("runtimeOnly") +def compileClasspath = configurations.create("compileClasspath") { + extendsFrom(configurations.implementation) attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_API)) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_API)) } } -val runtimeClasspath = configurations.create("runtimeClasspath") { - extendsFrom(implementation, runtimeOnly) +def runtimeClasspath = configurations.create("runtimeClasspath") { + extendsFrom(configurations.implementation, configurations.runtimeOnly) attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) } } @@ -19,7 +19,7 @@ dependencies { runtimeOnly("org.slf4j:slf4j-simple:2.0.3") } -val compileJava = tasks.register("compileJava") { +def compileJava = tasks.register("compileJava", JavaCompile) { destinationDirectory.set(layout.buildDirectory.dir("classes")) source(layout.projectDirectory.dir("src")) sourceCompatibility = "11" @@ -30,7 +30,7 @@ val compileJava = tasks.register("compileJava") { } } -tasks.register("run") { +tasks.register("run", JavaExec) { mainClass.set("mypackage.App") classpath = files(compileJava.flatMap { it.destinationDirectory }, runtimeClasspath) doLast { diff --git a/27_Multiple_Compile_Classpaths/my-project/module/build.gradle.kts b/27_Multiple_Compile_Classpaths/my-project/module/build.gradle similarity index 54% rename from 27_Multiple_Compile_Classpaths/my-project/module/build.gradle.kts rename to 27_Multiple_Compile_Classpaths/my-project/module/build.gradle index 2106c9a..b12107f 100644 --- a/27_Multiple_Compile_Classpaths/my-project/module/build.gradle.kts +++ b/27_Multiple_Compile_Classpaths/my-project/module/build.gradle @@ -1,8 +1,8 @@ -val implementation = configurations.create("implementation") -val api = configurations.create("api") -val runtimeOnly = configurations.create("runtimeOnly") -val compileClasspath = configurations.create("compileClasspath") { - extendsFrom(implementation, api) +configurations.create("implementation") +configurations.create("api") +configurations.create("runtimeOnly") +def compileClasspath = configurations.create("compileClasspath") { + extendsFrom(configurations.implementation, configurations.api) } dependencies { @@ -10,7 +10,7 @@ dependencies { implementation("commons-io:commons-io:2.6") } -val compileJava = tasks.register("compileJava") { +def compileJava = tasks.register("compileJava", JavaCompile) { destinationDirectory.set(layout.buildDirectory.dir("classes")) source(layout.projectDirectory.dir("src")) sourceCompatibility = "11" @@ -22,20 +22,20 @@ val compileJava = tasks.register("compileJava") { } configurations.create("apiElements") { - extendsFrom(api) + extendsFrom(configurations.api) outgoing { artifact(compileJava.flatMap { it.destinationDirectory }) } attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_API)) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_API)) } } configurations.create("runtimeElements") { - extendsFrom(implementation, runtimeOnly,api) + extendsFrom(configurations.implementation, configurations.runtimeOnly, configurations.api) outgoing { artifact(compileJava.flatMap { it.destinationDirectory }) } attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) } } diff --git a/27_Multiple_Compile_Classpaths/my-project/settings.gradle.kts b/27_Multiple_Compile_Classpaths/my-project/settings.gradle similarity index 100% rename from 27_Multiple_Compile_Classpaths/my-project/settings.gradle.kts rename to 27_Multiple_Compile_Classpaths/my-project/settings.gradle diff --git a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/build.gradle.kts b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/build.gradle similarity index 78% rename from 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/build.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/build.gradle index 3c766ac..3853081 100644 --- a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/build.gradle.kts +++ b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle new file mode 100644 index 0000000..45905aa --- /dev/null +++ b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -0,0 +1,51 @@ +import com.autonomousapps.AbstractPostProcessingTask +import com.autonomousapps.DependencyAnalysisSubExtension +import com.autonomousapps.model.Advice +import com.autonomousapps.model.ProjectCoordinates + +plugins { + id("java") +} + +group = "org.example.my-app" + +java { + toolchain.languageVersion = JavaLanguageVersion.of(17) +} + +def checkDependencyScopes = tasks.register("checkDependencyScopes", AbstractPostProcessingTask) { + group = LifecycleBasePlugin.VERIFICATION_GROUP + doLast { + def advices = projectAdvice().dependencyAdvice + if (!advices.isEmpty()) { + def toAdd = advices.findAll { it.toConfiguration != null && + it.toConfiguration != "runtimeOnly" }.collect { + declaration(it, it.toConfiguration) }.sort() + def toRemove = advices.findAll { it.fromConfiguration != null }.collect { + declaration(it, it.fromConfiguration) }.sort() + + throw new RuntimeException(""" + ${projectAdvice().projectPath.substring(1)}/build.gradle + + Please add the following dependency declarations: + ${toAdd.join("\n ")} + + Please remove the following dependency declarations: + ${toRemove.join("\n ")} + """.stripIndent()) + } + } +} + +static declaration(Advice advice, String conf) { + if (advice.coordinates instanceof ProjectCoordinates) return "${conf}(project(\"${advice.coordinates.identifier}\"))" + return "${conf}(\"${advice.coordinates.identifier}\")" +} + +extensions.findByType(DependencyAnalysisSubExtension)?.registerPostProcessingTask( + checkDependencyScopes) + +// Add checkDependencyScopes to 'check' lifecycle +tasks.named("check") { + dependsOn(checkDependencyScopes) +} diff --git a/24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 24_Kotlin_DSL_and_Groovy_DSL/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-root.gradle.kts b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-root.gradle similarity index 100% rename from 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-root.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/groovy/my-root.gradle diff --git a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts deleted file mode 100644 index 37a3503..0000000 --- a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ -plugins { - id("my-java-base") - id("application") -} diff --git a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts deleted file mode 100644 index ab4b569..0000000 --- a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ /dev/null @@ -1,50 +0,0 @@ -import com.autonomousapps.AbstractPostProcessingTask -import com.autonomousapps.DependencyAnalysisSubExtension -import com.autonomousapps.model.Advice -import com.autonomousapps.model.ProjectCoordinates - -plugins { - id("java") -} - -group = "org.example.my-app" - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) -} - -val checkDependencyScopes = tasks.register("checkDependencyScopes") { - group = LifecycleBasePlugin.VERIFICATION_GROUP - doLast { - val advices = projectAdvice().dependencyAdvice - if (advices.isNotEmpty()) { - val toAdd = advices.filter { it.toConfiguration != null && - it.toConfiguration != "runtimeOnly" }.map { - it.declaration(it.toConfiguration) }.sorted() - val toRemove = advices.filter { it.fromConfiguration != null }.map { - it.declaration(it.fromConfiguration) }.sorted() - - throw RuntimeException(""" - ${projectAdvice().projectPath.substring(1)}/build.gradle.kts - - Please add the following dependency declarations: - ${toAdd.joinToString("\n ") { it }} - - Please remove the following dependency declarations: - ${toRemove.joinToString("\n ") { it }} - """.trimIndent()) - } - } -} - -fun Advice.declaration(conf: String?) = - if (coordinates is ProjectCoordinates) "${conf}(project(\"${coordinates.identifier}\"))" - else "${conf}(\"${coordinates.identifier}\")" - -extensions.findByType()?.registerPostProcessingTask( - checkDependencyScopes) - -// Add checkDependencyScopes to 'check' lifecycle -tasks.check { - dependsOn(checkDependencyScopes) -} diff --git a/28_Dependency_Analysis_Plugin/my-build-logic/settings.gradle.kts b/28_Dependency_Analysis_Plugin/my-build-logic/settings.gradle similarity index 100% rename from 28_Dependency_Analysis_Plugin/my-build-logic/settings.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-build-logic/settings.gradle diff --git a/28_Dependency_Analysis_Plugin/my-project/app/build.gradle.kts b/28_Dependency_Analysis_Plugin/my-project/app/build.gradle similarity index 100% rename from 28_Dependency_Analysis_Plugin/my-project/app/build.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-project/app/build.gradle diff --git a/28_Dependency_Analysis_Plugin/my-project/build.gradle.kts b/28_Dependency_Analysis_Plugin/my-project/build.gradle similarity index 100% rename from 28_Dependency_Analysis_Plugin/my-project/build.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-project/build.gradle diff --git a/28_Dependency_Analysis_Plugin/my-project/module/build.gradle.kts b/28_Dependency_Analysis_Plugin/my-project/module/build.gradle similarity index 100% rename from 28_Dependency_Analysis_Plugin/my-project/module/build.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-project/module/build.gradle diff --git a/28_Dependency_Analysis_Plugin/my-project/settings.gradle.kts b/28_Dependency_Analysis_Plugin/my-project/settings.gradle similarity index 100% rename from 28_Dependency_Analysis_Plugin/my-project/settings.gradle.kts rename to 28_Dependency_Analysis_Plugin/my-project/settings.gradle diff --git a/29_Classpath_Collisions/my-build-logic/java-plugins/build.gradle.kts b/29_Classpath_Collisions/my-build-logic/java-plugins/build.gradle similarity index 86% rename from 29_Classpath_Collisions/my-build-logic/java-plugins/build.gradle.kts rename to 29_Classpath_Collisions/my-build-logic/java-plugins/build.gradle index d3840bd..9027bea 100644 --- a/29_Classpath_Collisions/my-build-logic/java-plugins/build.gradle.kts +++ b/29_Classpath_Collisions/my-build-logic/java-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/29_Classpath_Collisions/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/29_Classpath_Collisions/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/29_Classpath_Collisions/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/29_Classpath_Collisions/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 65% rename from 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 110ba3c..f896752 100644 --- a/29_Classpath_Collisions/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/29_Classpath_Collisions/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -6,5 +6,5 @@ plugins { group = "org.example.my-app" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } diff --git a/28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/29_Classpath_Collisions/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 28_Dependency_Analysis_Plugin/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/29_Classpath_Collisions/my-build-logic/settings.gradle.kts b/29_Classpath_Collisions/my-build-logic/settings.gradle similarity index 100% rename from 29_Classpath_Collisions/my-build-logic/settings.gradle.kts rename to 29_Classpath_Collisions/my-build-logic/settings.gradle diff --git a/29_Classpath_Collisions/my-project/app/build.gradle.kts b/29_Classpath_Collisions/my-project/app/build.gradle similarity index 100% rename from 29_Classpath_Collisions/my-project/app/build.gradle.kts rename to 29_Classpath_Collisions/my-project/app/build.gradle diff --git a/29_Classpath_Collisions/my-project/module/build.gradle.kts b/29_Classpath_Collisions/my-project/module/build.gradle similarity index 100% rename from 29_Classpath_Collisions/my-project/module/build.gradle.kts rename to 29_Classpath_Collisions/my-project/module/build.gradle diff --git a/29_Classpath_Collisions/my-project/settings.gradle.kts b/29_Classpath_Collisions/my-project/settings.gradle similarity index 100% rename from 29_Classpath_Collisions/my-project/settings.gradle.kts rename to 29_Classpath_Collisions/my-project/settings.gradle diff --git a/30_Security_Vulnerabilities/my-build-logic/java-plugins/build.gradle.kts b/30_Security_Vulnerabilities/my-build-logic/java-plugins/build.gradle similarity index 74% rename from 30_Security_Vulnerabilities/my-build-logic/java-plugins/build.gradle.kts rename to 30_Security_Vulnerabilities/my-build-logic/java-plugins/build.gradle index 8ec7d15..03ecc92 100644 --- a/30_Security_Vulnerabilities/my-build-logic/java-plugins/build.gradle.kts +++ b/30_Security_Vulnerabilities/my-build-logic/java-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 66% rename from 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index de5be36..f5c4bdb 100644 --- a/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -5,7 +5,7 @@ plugins { } dependencyCheck { - scanConfigurations = listOf(configurations.runtimeClasspath.get().name) + scanConfigurations = [configurations.runtimeClasspath.name] autoUpdate = false // ... } diff --git a/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 53% rename from 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index 00f1201..ef70072 100644 --- a/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -5,22 +5,22 @@ plugins { group = "org.example.my-app" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } // Setup for consistent resolution with the application runtime classpath: -val applicationRuntimeClasspath = configurations.create("applicationRuntimeClasspath") { - isCanBeConsumed = false - isCanBeResolved = true +def applicationRuntimeClasspath = configurations.create("applicationRuntimeClasspath") { + canBeConsumed = false + canBeResolved = true attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) } withDependencies { add(project.dependencies.create(project(":app"))) } } configurations.all { - if (this != applicationRuntimeClasspath && isCanBeResolved()) { + if (it != applicationRuntimeClasspath && it.canBeResolved) { shouldResolveConsistentlyWith(applicationRuntimeClasspath) } } diff --git a/29_Classpath_Collisions/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 29_Classpath_Collisions/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/30_Security_Vulnerabilities/my-build-logic/settings.gradle.kts b/30_Security_Vulnerabilities/my-build-logic/settings.gradle similarity index 100% rename from 30_Security_Vulnerabilities/my-build-logic/settings.gradle.kts rename to 30_Security_Vulnerabilities/my-build-logic/settings.gradle diff --git a/30_Security_Vulnerabilities/my-project/app/build.gradle.kts b/30_Security_Vulnerabilities/my-project/app/build.gradle similarity index 100% rename from 30_Security_Vulnerabilities/my-project/app/build.gradle.kts rename to 30_Security_Vulnerabilities/my-project/app/build.gradle diff --git a/30_Security_Vulnerabilities/my-project/module/build.gradle.kts b/30_Security_Vulnerabilities/my-project/module/build.gradle similarity index 100% rename from 30_Security_Vulnerabilities/my-project/module/build.gradle.kts rename to 30_Security_Vulnerabilities/my-project/module/build.gradle diff --git a/30_Security_Vulnerabilities/my-project/settings.gradle.kts b/30_Security_Vulnerabilities/my-project/settings.gradle similarity index 100% rename from 30_Security_Vulnerabilities/my-project/settings.gradle.kts rename to 30_Security_Vulnerabilities/my-project/settings.gradle diff --git a/31_The_Module_Path/my-build-logic/java-plugins/build.gradle.kts b/31_The_Module_Path/my-build-logic/java-plugins/build.gradle similarity index 75% rename from 31_The_Module_Path/my-build-logic/java-plugins/build.gradle.kts rename to 31_The_Module_Path/my-build-logic/java-plugins/build.gradle index 2725fdc..aa489c5 100644 --- a/31_The_Module_Path/my-build-logic/java-plugins/build.gradle.kts +++ b/31_The_Module_Path/my-build-logic/java-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/31_The_Module_Path/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/31_The_Module_Path/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 31_The_Module_Path/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 31_The_Module_Path/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/31_The_Module_Path/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/31_The_Module_Path/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 92% rename from 31_The_Module_Path/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 31_The_Module_Path/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index f1fa0d0..a31202d 100644 --- a/31_The_Module_Path/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/31_The_Module_Path/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -14,7 +14,7 @@ javaModuleDependencies { group = "org.example" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } dependencies.constraints { diff --git a/30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/31_The_Module_Path/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 30_Security_Vulnerabilities/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 31_The_Module_Path/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/31_The_Module_Path/my-build-logic/settings.gradle.kts b/31_The_Module_Path/my-build-logic/settings.gradle similarity index 100% rename from 31_The_Module_Path/my-build-logic/settings.gradle.kts rename to 31_The_Module_Path/my-build-logic/settings.gradle diff --git a/31_The_Module_Path/my-project/app/build.gradle.kts b/31_The_Module_Path/my-project/app/build.gradle similarity index 100% rename from 31_The_Module_Path/my-project/app/build.gradle.kts rename to 31_The_Module_Path/my-project/app/build.gradle diff --git a/31_The_Module_Path/my-project/modulea/build.gradle.kts b/31_The_Module_Path/my-project/modulea/build.gradle similarity index 100% rename from 31_The_Module_Path/my-project/modulea/build.gradle.kts rename to 31_The_Module_Path/my-project/modulea/build.gradle diff --git a/31_The_Module_Path/my-project/settings.gradle.kts b/31_The_Module_Path/my-project/settings.gradle similarity index 100% rename from 31_The_Module_Path/my-project/settings.gradle.kts rename to 31_The_Module_Path/my-project/settings.gradle diff --git a/32_Artifact_Transforms/my-build-logic/java-plugins/build.gradle.kts b/32_Artifact_Transforms/my-build-logic/java-plugins/build.gradle similarity index 74% rename from 32_Artifact_Transforms/my-build-logic/java-plugins/build.gradle.kts rename to 32_Artifact_Transforms/my-build-logic/java-plugins/build.gradle index d4c2165..a07ba8a 100644 --- a/32_Artifact_Transforms/my-build-logic/java-plugins/build.gradle.kts +++ b/32_Artifact_Transforms/my-build-logic/java-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 79% rename from 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index f520e81..ec7f55c 100644 --- a/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -1,5 +1,5 @@ import org.example.JavaModuleTransform -import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE +import static org.gradle.api.artifacts.type.ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE plugins { id("java") @@ -17,7 +17,7 @@ plugins { // } // } -val javaModuleAttribute = Attribute.of("javaModule", Boolean::class.javaObjectType) +def javaModuleAttribute = Attribute.of("javaModule", Boolean) configurations.compileClasspath { attributes.attribute(javaModuleAttribute, true) } @@ -27,7 +27,7 @@ configurations.runtimeClasspath { dependencies.artifactTypes.maybeCreate("jar").attributes.attribute(javaModuleAttribute, false) -dependencies.registerTransform(JavaModuleTransform::class) { +dependencies.registerTransform(JavaModuleTransform) { from.attributes.attribute(ARTIFACT_TYPE_ATTRIBUTE, "jar").attribute(javaModuleAttribute, false) to.attributes.attribute(ARTIFACT_TYPE_ATTRIBUTE, "jar").attribute(javaModuleAttribute, true) } @@ -36,7 +36,7 @@ dependencies.registerTransform(JavaModuleTransform::class) { group = "org.example" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) + toolchain.languageVersion = JavaLanguageVersion.of(17) } dependencies.constraints { diff --git a/31_The_Module_Path/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 31_The_Module_Path/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/org/example/JavaModuleTransform.kt b/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/org/example/JavaModuleTransform.groovy similarity index 53% rename from 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/org/example/JavaModuleTransform.kt rename to 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/org/example/JavaModuleTransform.groovy index c302db2..31bb1db 100644 --- a/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/org/example/JavaModuleTransform.kt +++ b/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/groovy/org/example/JavaModuleTransform.groovy @@ -13,24 +13,26 @@ import java.util.jar.JarOutputStream import javax.inject.Inject // @CacheableTransform - if transform results should also be shared via remote build cache -abstract class JavaModuleTransform : TransformAction { +abstract class JavaModuleTransform implements TransformAction { - @get:InputArtifact - abstract val inputArtifact : Provider + @InputArtifact + abstract Provider getInputArtifact() - @get:Inject - abstract val archiveOperations : ArchiveOperations + @Inject + abstract ArchiveOperations getArchiveOperations() - override fun transform(outputs: TransformOutputs) { - val isModule = archiveOperations.zipTree(inputArtifact).any { it.name == "module-info.class" } + @Override + void transform(TransformOutputs outputs) { + def isModule = archiveOperations.zipTree(inputArtifact).any { it.name == "module-info.class" } if (isModule) { outputs.file(inputArtifact) } else { - val originalJar = inputArtifact.get().asFile - val target = outputs.file(originalJar.nameWithoutExtension + "-module.jar") + def originalJar = getInputArtifact().get().asFile + def originalJarName = originalJar.name.substring(0, originalJar.name.lastIndexOf('.')) + def target = outputs.file(originalJarName + "-module.jar") - JarInputStream(originalJar.inputStream()).use { input -> - JarOutputStream(target.outputStream(), input.manifest).use { output -> + new JarInputStream(new FileInputStream(originalJar)).withStream { input -> + new JarOutputStream(new FileOutputStream(target), input.manifest).withStream { output -> var jarEntry = input.nextJarEntry while (jarEntry != null) { output.putNextEntry(jarEntry) @@ -39,9 +41,9 @@ abstract class JavaModuleTransform : TransformAction { jarEntry = input.nextJarEntry } - output.putNextEntry(JarEntry("module-info.class")) - output.write(this::class.java.getResourceAsStream( - "${originalJar.nameWithoutExtension}/module-info.class")!!.readAllBytes()) + output.putNextEntry(new JarEntry("module-info.class")) + output.write(this.class.getResourceAsStream( + "${originalJarName}/module-info.class").readAllBytes()) output.closeEntry() } } diff --git a/32_Artifact_Transforms/my-build-logic/settings.gradle.kts b/32_Artifact_Transforms/my-build-logic/settings.gradle similarity index 100% rename from 32_Artifact_Transforms/my-build-logic/settings.gradle.kts rename to 32_Artifact_Transforms/my-build-logic/settings.gradle diff --git a/32_Artifact_Transforms/my-project/app/build.gradle.kts b/32_Artifact_Transforms/my-project/app/build.gradle similarity index 100% rename from 32_Artifact_Transforms/my-project/app/build.gradle.kts rename to 32_Artifact_Transforms/my-project/app/build.gradle diff --git a/32_Artifact_Transforms/my-project/settings.gradle.kts b/32_Artifact_Transforms/my-project/settings.gradle similarity index 100% rename from 32_Artifact_Transforms/my-project/settings.gradle.kts rename to 32_Artifact_Transforms/my-project/settings.gradle diff --git a/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/build.gradle.kts b/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/build.gradle similarity index 89% rename from 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/build.gradle.kts rename to 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/build.gradle index ac3ef45..1d82cc8 100644 --- a/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/build.gradle.kts +++ b/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/build.gradle @@ -1,5 +1,5 @@ plugins { - `kotlin-dsl` + id("groovy-gradle-plugin") } dependencies { diff --git a/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 100% rename from 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle diff --git a/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts b/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle similarity index 94% rename from 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts rename to 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle index d289082..8b94a75 100644 --- a/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-base.gradle.kts +++ b/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-base.gradle @@ -15,6 +15,6 @@ javaModuleTesting.whitebox(testing.suites.getByName("test")) { opensTo.add("org.junit.platform.commons") } -tasks.test { +tasks.named("test") { useJUnitPlatform() // JUnit5 } diff --git a/32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle similarity index 100% rename from 32_Artifact_Transforms/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts rename to 33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/groovy/my-java-library.gradle diff --git a/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts b/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts deleted file mode 100644 index c4bbec4..0000000 --- a/33_Classpath_and_Module_Path_in_Testing/my-build-logic/java-plugins/src/main/kotlin/my-java-library.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ -plugins { - id("my-java-base") - id("java-library") -} diff --git a/33_Classpath_and_Module_Path_in_Testing/my-build-logic/settings.gradle.kts b/33_Classpath_and_Module_Path_in_Testing/my-build-logic/settings.gradle similarity index 100% rename from 33_Classpath_and_Module_Path_in_Testing/my-build-logic/settings.gradle.kts rename to 33_Classpath_and_Module_Path_in_Testing/my-build-logic/settings.gradle diff --git a/33_Classpath_and_Module_Path_in_Testing/my-project/app/build.gradle.kts b/33_Classpath_and_Module_Path_in_Testing/my-project/app/build.gradle similarity index 100% rename from 33_Classpath_and_Module_Path_in_Testing/my-project/app/build.gradle.kts rename to 33_Classpath_and_Module_Path_in_Testing/my-project/app/build.gradle diff --git a/33_Classpath_and_Module_Path_in_Testing/my-project/settings.gradle.kts b/33_Classpath_and_Module_Path_in_Testing/my-project/settings.gradle similarity index 100% rename from 33_Classpath_and_Module_Path_in_Testing/my-project/settings.gradle.kts rename to 33_Classpath_and_Module_Path_in_Testing/my-project/settings.gradle diff --git a/34_Properties_and_Providers/my-build-logic/java-plugins/build.gradle b/34_Properties_and_Providers/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..849db8a --- /dev/null +++ b/34_Properties_and_Providers/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id('groovy-gradle-plugin') +} diff --git a/34_Properties_and_Providers/my-build-logic/java-plugins/build.gradle.kts b/34_Properties_and_Providers/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/34_Properties_and_Providers/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 56% rename from 34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index 74d7620..edc618d 100644 --- a/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -6,25 +6,25 @@ plugins { tasks.named("assemble") // access existing task tasks.register("checkAll") // register new task -tasks.withType().configureEach { } // configure all of a certain type +tasks.withType(JavaCompile).configureEach { } // configure all of a certain type layout.projectDirectory layout.buildDirectory -providers.environmentVariable("CI").orElse("false").get().toBoolean() +providers.environmentVariable("CI").orElse("false").get().asBoolean() providers.gradleProperty("foo") // pass to build via -Pfoo=bar providers.systemProperty("file.encoding") version = providers.fileContents(layout.projectDirectory.file("version.txt")) .asText.get() -val fileCollection: FileCollection = configurations.runtimeClasspath.get() +FileCollection fileCollection = configurations.runtimeClasspath fileCollection.elements.map { it.first().asFile } -val main = application.mainClass.map { "$it-report.txt" } +def main = application.mainClass.map { "$it-report.txt" } -tasks.register("applicationReport") { - classesDir.set(tasks.compileJava.flatMap { it.destinationDirectory }) +tasks.register("applicationReport", ApplicationReportTask) { + classesDir.set(tasks.named("compileJava").flatMap { it.destinationDirectory }) reportFile.set(layout.buildDirectory.file(main)) } diff --git a/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/org/example/ApplicationReportTask.groovy b/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/org/example/ApplicationReportTask.groovy new file mode 100644 index 0000000..bc6e492 --- /dev/null +++ b/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/org/example/ApplicationReportTask.groovy @@ -0,0 +1,36 @@ +package org.example + +import org.gradle.api.DefaultTask +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.TaskAction + +abstract class ApplicationReportTask extends DefaultTask { + + //abstract Property getP1() + //abstract Property getP2() + //abstract Property getP3() + + //abstract SetProperty getP4() + //abstract ListProperty getP5() + //abstract MapProperty getP6() + + @InputDirectory + abstract DirectoryProperty getClassesDir() + + @OutputFile + abstract RegularFileProperty getReportFile() + + @TaskAction + void report() { + reportFile.get().asFile.text = + """ + Application report: + =================== + Class File Count: ${classesDir.get().asFileTree.size()} + """.stripIndent().trim() + } + +} diff --git a/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/org/example/MyEnum.kt b/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/org/example/MyEnum.groovy similarity index 52% rename from 34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/org/example/MyEnum.kt rename to 34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/org/example/MyEnum.groovy index 9262371..87556a9 100644 --- a/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/org/example/MyEnum.kt +++ b/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/groovy/org/example/MyEnum.groovy @@ -1,4 +1,4 @@ package org.example -enum class MyEnum { +enum MyEnum { } \ No newline at end of file diff --git a/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/org/example/ApplicationReportTask.kt b/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/org/example/ApplicationReportTask.kt deleted file mode 100644 index e275e70..0000000 --- a/34_Properties_and_Providers/my-build-logic/java-plugins/src/main/kotlin/org/example/ApplicationReportTask.kt +++ /dev/null @@ -1,36 +0,0 @@ -package org.example - -import org.gradle.api.DefaultTask -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.file.RegularFileProperty -import org.gradle.api.tasks.InputDirectory -import org.gradle.api.tasks.OutputFile -import org.gradle.api.tasks.TaskAction - -abstract class ApplicationReportTask : DefaultTask() { - - //abstract val p1: Property - //abstract val p2: Property - //abstract val p3: Property - - //abstract val p4: SetProperty - //abstract val p5: ListProperty - //abstract val p6: MapProperty - - @get:InputDirectory - abstract val classesDir: DirectoryProperty - - @get:OutputFile - abstract val reportFile: RegularFileProperty - - @TaskAction - fun report() { - reportFile.get().asFile.writeText( - """ - Application report: - =================== - Class File Count: ${classesDir.get().asFileTree.count()} - """.trimIndent()) - } - -} diff --git a/34_Properties_and_Providers/my-build-logic/settings.gradle.kts b/34_Properties_and_Providers/my-build-logic/settings.gradle similarity index 100% rename from 34_Properties_and_Providers/my-build-logic/settings.gradle.kts rename to 34_Properties_and_Providers/my-build-logic/settings.gradle diff --git a/34_Properties_and_Providers/my-project/app/build.gradle.kts b/34_Properties_and_Providers/my-project/app/build.gradle similarity index 100% rename from 34_Properties_and_Providers/my-project/app/build.gradle.kts rename to 34_Properties_and_Providers/my-project/app/build.gradle diff --git a/34_Properties_and_Providers/my-project/settings.gradle.kts b/34_Properties_and_Providers/my-project/settings.gradle similarity index 100% rename from 34_Properties_and_Providers/my-project/settings.gradle.kts rename to 34_Properties_and_Providers/my-project/settings.gradle diff --git a/35_Working_with_Files/my-build-logic/java-plugins/build.gradle b/35_Working_with_Files/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/35_Working_with_Files/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/35_Working_with_Files/my-build-logic/java-plugins/build.gradle.kts b/35_Working_with_Files/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/35_Working_with_Files/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/35_Working_with_Files/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/35_Working_with_Files/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 68% rename from 35_Working_with_Files/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 35_Working_with_Files/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index 6863e35..61c70cf 100644 --- a/35_Working_with_Files/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/35_Working_with_Files/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -4,16 +4,16 @@ plugins { id("java") } -val generateStartScript = tasks.register("generateStartScript") { +def generateStartScript = tasks.register("generateStartScript", GenerateStartScript) { mainClass = "org.example.app.App" scriptFile = layout.buildDirectory.file("tmp/scripts/run") } -val installSpec = copySpec { +def installSpec = copySpec { from(generateStartScript) into("app") { - from(tasks.jar) + from(tasks.named("jar")) } into("libs") { from(configurations.runtimeClasspath) { @@ -22,13 +22,13 @@ val installSpec = copySpec { it.substring(0, it.lastIndexOf("-")) + ".jar" } } - // from(configurations.runtimeClasspath.get().elements.map { it.map { jar -> zipTree(jar) } }) { + // from(configurations.runtimeClasspath.elements.map { it.collect { jar -> zipTree(jar) } }) { // exclude("META-INF/**") // } } } -val packageSpec = copySpec { +def packageSpec = copySpec { with(installSpec) into("meta") { @@ -36,17 +36,17 @@ val packageSpec = copySpec { } } -tasks.register("install") { // in special cases: as alternative +tasks.register("install", Sync) { // in special cases: as alternative with(installSpec) destinationDir = layout.buildDirectory.dir("install").get().asFile } -tasks.register("package") { +tasks.register("package", Zip) { with(packageSpec) destinationDirectory = layout.buildDirectory.dir("dist") } -tasks.build { +tasks.named("build") { dependsOn(tasks.named("install")) dependsOn(tasks.named("package")) } diff --git a/35_Working_with_Files/my-build-logic/java-plugins/src/main/groovy/org/example/GenerateStartScript.groovy b/35_Working_with_Files/my-build-logic/java-plugins/src/main/groovy/org/example/GenerateStartScript.groovy new file mode 100644 index 0000000..a2efa28 --- /dev/null +++ b/35_Working_with_Files/my-build-logic/java-plugins/src/main/groovy/org/example/GenerateStartScript.groovy @@ -0,0 +1,43 @@ +package org.example + +import org.gradle.api.DefaultTask +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.TaskAction + +import java.nio.file.Files +import static java.nio.file.attribute.PosixFilePermission.* + +@CacheableTask +abstract class GenerateStartScript extends DefaultTask { + + @Input + abstract Property getMainClass() + + @OutputFile + abstract RegularFileProperty getScriptFile() + + // @Inject + // abstract FileOperations getFiles() + + @TaskAction + def generate() { + def main = mainClass.get() // String + def out = scriptFile.get().asFile // java.io.File + def script = "java -cp 'libs/*:app/*' $main" + + out.text = script + Files.setPosixFilePermissions(out.toPath(), [ + OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, + GROUP_READ, GROUP_EXECUTE, + OTHERS_EXECUTE, OTHERS_READ + ] as Set) + + // files.sync { + // ... + // } + } +} \ No newline at end of file diff --git a/35_Working_with_Files/my-build-logic/java-plugins/src/main/kotlin/org/example/GenerateStartScript.kt b/35_Working_with_Files/my-build-logic/java-plugins/src/main/kotlin/org/example/GenerateStartScript.kt deleted file mode 100644 index c66a378..0000000 --- a/35_Working_with_Files/my-build-logic/java-plugins/src/main/kotlin/org/example/GenerateStartScript.kt +++ /dev/null @@ -1,44 +0,0 @@ -package org.example; - -import org.gradle.api.DefaultTask -import org.gradle.api.file.RegularFileProperty -import org.gradle.api.internal.file.FileOperations -import org.gradle.api.provider.Property -import org.gradle.api.tasks.CacheableTask -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.OutputFile -import org.gradle.api.tasks.TaskAction -import java.nio.file.Files -import java.nio.file.attribute.PosixFilePermission.* -import javax.inject.Inject - -@CacheableTask -abstract class GenerateStartScript : DefaultTask() { - - @get:Input - abstract val mainClass: Property - - @get:OutputFile - abstract val scriptFile: RegularFileProperty - - // @get:Inject - // abstract val files: FileOperations - - @TaskAction - fun generate() { - val main = mainClass.get() // String - val out = scriptFile.get().asFile // java.io.File - val script = "java -cp 'libs/*:app/*' $main" - - out.writeText(script) - Files.setPosixFilePermissions(out.toPath(), setOf( - OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, - GROUP_READ, GROUP_EXECUTE, - OTHERS_EXECUTE, OTHERS_READ - )) - - // files.sync { - // ... - // } - } -} \ No newline at end of file diff --git a/35_Working_with_Files/my-build-logic/settings.gradle.kts b/35_Working_with_Files/my-build-logic/settings.gradle similarity index 100% rename from 35_Working_with_Files/my-build-logic/settings.gradle.kts rename to 35_Working_with_Files/my-build-logic/settings.gradle diff --git a/35_Working_with_Files/my-project/app/build.gradle.kts b/35_Working_with_Files/my-project/app/build.gradle similarity index 100% rename from 35_Working_with_Files/my-project/app/build.gradle.kts rename to 35_Working_with_Files/my-project/app/build.gradle diff --git a/35_Working_with_Files/my-project/settings.gradle.kts b/35_Working_with_Files/my-project/settings.gradle similarity index 100% rename from 35_Working_with_Files/my-project/settings.gradle.kts rename to 35_Working_with_Files/my-project/settings.gradle diff --git a/36_Task_Actions/my-build-logic/java-plugins/build.gradle b/36_Task_Actions/my-build-logic/java-plugins/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/36_Task_Actions/my-build-logic/java-plugins/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/36_Task_Actions/my-build-logic/java-plugins/build.gradle.kts b/36_Task_Actions/my-build-logic/java-plugins/build.gradle.kts deleted file mode 100644 index bc0172f..0000000 --- a/36_Task_Actions/my-build-logic/java-plugins/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} diff --git a/36_Task_Actions/my-build-logic/java-plugins/src/main/kotlin/PrintVersion.kt b/36_Task_Actions/my-build-logic/java-plugins/src/main/groovy/PrintVersion.groovy similarity index 64% rename from 36_Task_Actions/my-build-logic/java-plugins/src/main/kotlin/PrintVersion.kt rename to 36_Task_Actions/my-build-logic/java-plugins/src/main/groovy/PrintVersion.groovy index 8db2d2a..8a8af0f 100644 --- a/36_Task_Actions/my-build-logic/java-plugins/src/main/kotlin/PrintVersion.kt +++ b/36_Task_Actions/my-build-logic/java-plugins/src/main/groovy/PrintVersion.groovy @@ -3,13 +3,13 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.Input import org.gradle.api.tasks.TaskAction -abstract class PrintVersion : DefaultTask() { +abstract class PrintVersion extends DefaultTask { - @get:Input - abstract val version: Property + @Input + abstract Property getVersion() @TaskAction - fun print() { + void print() { println("Version: ${version.get()}") } } diff --git a/36_Task_Actions/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts b/36_Task_Actions/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle similarity index 88% rename from 36_Task_Actions/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts rename to 36_Task_Actions/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle index cf541e5..c1f1f5c 100644 --- a/36_Task_Actions/my-build-logic/java-plugins/src/main/kotlin/my-java-application.gradle.kts +++ b/36_Task_Actions/my-build-logic/java-plugins/src/main/groovy/my-java-application.gradle @@ -2,20 +2,19 @@ plugins { id("application") } -tasks.compileJava { +tasks.named("compileJava") { actions.clear() // Remove compile action from JavaCompile task doFirst { println("Number of task actions: " + actions.size) } doLast { - this as JavaCompile Runtime.getRuntime().exec( // Add our own 'java compile' implementation "javac ${source.asPath} -d ${destinationDirectory.get().asFile}").waitFor() println("Compilation finished: ${inputs.sourceFiles.asPath}") } } -tasks.register("printVersion") { +tasks.register("printVersion", PrintVersion) { version = project.version as String } diff --git a/36_Task_Actions/my-build-logic/settings.gradle.kts b/36_Task_Actions/my-build-logic/settings.gradle similarity index 100% rename from 36_Task_Actions/my-build-logic/settings.gradle.kts rename to 36_Task_Actions/my-build-logic/settings.gradle diff --git a/36_Task_Actions/my-project/app/build.gradle.kts b/36_Task_Actions/my-project/app/build.gradle similarity index 100% rename from 36_Task_Actions/my-project/app/build.gradle.kts rename to 36_Task_Actions/my-project/app/build.gradle diff --git a/36_Task_Actions/my-project/settings.gradle.kts b/36_Task_Actions/my-project/settings.gradle similarity index 100% rename from 36_Task_Actions/my-project/settings.gradle.kts rename to 36_Task_Actions/my-project/settings.gradle