diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0d08e261a..3b305926c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,17 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - +--- version: 2 updates: - - package-ecosystem: "github-actions" # See documentation for possible values - directory: "/" # Location of package manifests + + - package-ecosystem: gradle + directory: '/' + schedule: + interval: daily + time: '15:30' + target-branch: maim + + - package-ecosystem: github-actions + directory: '/' schedule: - interval: "weekly" + interval: daily + time: '15:30' + target-branch: main diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5124ef05..1d3c73b27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,23 +29,34 @@ jobs: timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - name: Checkout Cpde + uses: actions/checkout@v4 with: token: ${{ secrets.PAT || github.token }} + - name: set up Java 17 uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '17' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build Compose run: ./gradlew :compose:snippets:build + - name: Build recompose snippets run: ./gradlew :compose:recomposehighlighter:build + - name: Build kotlin snippets run: ./gradlew :kotlin:build + - name: Build Wear snippets run: ./gradlew :wear:build + - name: Build misc snippets run: ./gradlew :misc:build + - name: Build XR snippets run: ./gradlew :xr:build diff --git a/.github/workflows/deleteoldrus.yml b/.github/workflows/deleteoldrus.yml new file mode 100644 index 000000000..b1f05b7d1 --- /dev/null +++ b/.github/workflows/deleteoldrus.yml @@ -0,0 +1,26 @@ +name: Delete old runs + +on: + workflow_dispatch: + inputs: + days: + description: 'Number of retains days.' + required: true + default: '0' + minimum_runs: + description: 'The minimum runs to keep for each workflow.' + required: true + default: '0' + +jobs: + deleteWorkflowRuns: + name: Delete old workflow runs + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2.0.6 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: ${{ github.event.inputs.days }} + keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} diff --git a/.github/workflows/fork-sync.yml b/.github/workflows/fork-sync.yml new file mode 100644 index 000000000..0f77c84fc --- /dev/null +++ b/.github/workflows/fork-sync.yml @@ -0,0 +1,21 @@ +name: Sync Fork + +on: + schedule: + - cron: '*/30 * * * *' # every 30 minutes + workflow_dispatch: # on button click + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - uses: tgymnich/fork-sync@v2.0 + with: + token: ${{ github.token }} + #token: ${{ secrets.PAT_TOKEN }} + repo: snippets + owner: scto + base: main + head: main + merge_method: merge diff --git a/.github/workflows/gradle-wrapper-upgrade.yml b/.github/workflows/gradle-wrapper-upgrade.yml new file mode 100644 index 000000000..8748442cb --- /dev/null +++ b/.github/workflows/gradle-wrapper-upgrade.yml @@ -0,0 +1,28 @@ +name: Update Gradle Wrapper + +on: + schedule: + - cron: "46 15 * * *" + workflow_dispatch: + +jobs: + update-gradle-wrapper: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Change Gradle wrapper permissions + run: chmod +x ./gradlew + + #- name: Change Gradle wrapper permissions + # run: chmod +x build-logic/gradlew + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Update Gradle Wrapper + uses: gradle-update/update-gradle-wrapper-action@v2 + #with: + # paths: build-logic/**, */** diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 000000000..1d4914d04 --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,13 @@ +name: "Validate Gradle Wrapper" +on: [push, pull_request, workflow_dispatch] + +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Checkout repository + uses: gradle/actions/wrapper-validation@v4 diff --git a/gradle/init.gradle.kts b/gradle/init.gradle.kts index 8a852469a..f81066fe1 100644 --- a/gradle/init.gradle.kts +++ b/gradle/init.gradle.kts @@ -1,7 +1,7 @@ val ktlintVersion = "0.43.0" initscript { - val spotlessVersion = "6.11.0" + val spotlessVersion = "7.0.3" repositories { mavenCentral() diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f..1b33c55ba 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37f853b1c..247cf2a9f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionSha256Sum=61ad310d3c7d3e5da131b76bbf22b5a4c0786e9d892dae8c1658d4b484de3caa +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 983fb2e97..a89ae0d85 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -203,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For validator: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. @@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 7101f8e46..5eed7ee84 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -68,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..26457423a --- /dev/null +++ b/renovate.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>DanySK/renovate-config" + ], + "automerge": true, + "forkProcessing": "enabled", + "labels": [ + "dependencies" + ], + "osvVulnerabilityAlerts": true, + "packageRules": [ + { + "groupName": "Kotlin & KSP", + "matchPackageNames": [ + "com.google.devtools.ksp{/,}**", + "/org.jetbrains.kotlin.*/" + ] + }, + { + "groupName": "AndroidX Navigation", + "matchPackageNames": [ + "/androidx.navigation.*/" + ] + }, + { + "description": "Trigger a minor update on some dependencies", + "matchDepNames": [ + "/^org\\.apache\\.commons:commons-math3$/", + "/^org\\.danilopianini:listset$/" + ], + "semanticCommitScope": "api-deps" + }, + { + "description": "Some updates should have type docs", + "matchDepNames": [ + "/^org\\.jetbrains\\.dokka.*/", + "gohugoio/hugo" + ], + "semanticCommitType": "docs" + }, + { + "description": "Identify some updates as core", + "matchDepNames": [ + "/^it\\.unibo\\.scafi:.*/", + "/^org\\.jetbrains\\.kotlin:.*/", + "/^org\\.protelis:.*/" + ], + "semanticCommitScope": "core-deps" + }, + { + "description": "Updates to to the site should have type docs", + "matchFileNames": [ + "site/*" + ], + "semanticCommitType": "docs" + } + ], + "ignorePaths": [ + "testing/resources/**", + "gradle-plugin/src/test/resources/**" + ] +}