Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize Gradle configuration #626

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ jobs:
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.sample-kotlin == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-kotlin/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-kotlin
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-kotlin"
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.sample-kotlin == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-kotlin/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-kotlin
arguments: check --stacktrace --configuration-cache --daemon
- name: "Configure JDK back for new Gradle"
Expand All @@ -133,63 +133,63 @@ jobs:
if: ${{ github.event.inputs.sample-groovy == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-groovy/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-groovy
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-groovy"
if: ${{ github.event.inputs.sample-groovy == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-groovy/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-groovy
arguments: check --stacktrace --daemon
- name: "Check buildSrc of sample-groovy (simulates IDE Gradle sync)"
if: ${{ github.event.inputs.sample-groovy == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-groovy/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-groovy/buildSrc
arguments: help --stacktrace --daemon
- name: "Run refreshVersions on sample-multi-modules"
if: ${{ github.event.inputs.sample-multi-modules == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-multi-modules/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-multi-modules
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-multi-modules"
if: ${{ github.event.inputs.sample-multi-modules == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-multi-modules/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-multi-modules
arguments: check --stacktrace --daemon
- name: "Run refreshVersions on sample-kotlin-js"
if: ${{ github.event.inputs.sample-kotlin-js == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-kotlin-js/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-kotlin-js
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-kotlin-js"
if: ${{ github.event.inputs.sample-kotlin-js == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-kotlin-js/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-kotlin-js
arguments: check --stacktrace --daemon
- name: "Run refreshVersions on sample-android"
if: ${{ github.event.inputs.sample-android == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-android/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-android
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-android"
if: ${{ github.event.inputs.sample-android == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-android/gradlew
gradle-executable: plugins/gradlew
build-root-directory: sample-android
arguments: check --stacktrace --daemon
- name: "Stop Gradle daemon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,8 @@ tasks.register<DefaultTask>("hello") {
group = "Custom"
description = "Minimal task that do nothing. Useful to debug a failing build"
}

tasks.wrapper {
val versionFile = rootDir.parentFile.resolve("plugins/gradle-version.txt")
gradleVersion = versionFile.readLines().first()
}
1 change: 1 addition & 0 deletions plugins/gradle-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.5.1
3 changes: 3 additions & 0 deletions sample-android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gradlew
gradlew.bat
gradle/wrapper/gradle-wrapper.jar
2 changes: 1 addition & 1 deletion sample-android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
implementation(AndroidX.constraintLayout)
implementation(Google.android.material)
implementation(AndroidX.lifecycle.runtime)
implementation(AndroidX.lifecycle.runtimeKtx)
implementation(AndroidX.lifecycle.runtime.ktx)
implementation(AndroidX.lifecycle.viewModel)
testImplementation(Testing.junit4)
androidTestImplementation(AndroidX.test.core)
Expand Down
5 changes: 5 additions & 0 deletions sample-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ buildScan {
setTermsOfServiceAgree("yes")
publishAlways()
}

tasks.wrapper {
val versionFile = rootDir.parentFile.resolve("plugins/gradle-version.txt")
gradleVersion = versionFile.readLines().first()
}
Binary file removed sample-android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
240 changes: 0 additions & 240 deletions sample-android/gradlew

This file was deleted.