diff --git a/.editorconfig b/.editorconfig index b2cb281e..4fc5be91 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,11 @@ charset = latin1 indent_style = tab indent_size = 4 +[{*.yaml,*.yml}] +end_of_line = lf +indent_style = space +indent_size = 2 + [*.java] indent_style = tab ij_continuation_indent_size = 4 diff --git a/.github/actions/cache-gradle/action.yml b/.github/actions/cache-gradle/action.yml new file mode 100644 index 00000000..48102196 --- /dev/null +++ b/.github/actions/cache-gradle/action.yml @@ -0,0 +1,32 @@ +# https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action#creating-a-composite-action-within-the-same-repository + +# cache uses two files: +# +# - gradle-wrapper---: +# contains the Gradle wrapper/distribution (~/.gradle/wrapper) +# and is updated when the Gradle version changed +# - gradle-caches---: +# contains the Gradle caches (~/.gradle/caches), buildSrc/build and buildSrc/.gradle +# and is updated when Gradle related files were changed +# buildSrc/.gradle is needed so that buildSrc tasks are UP-TO-DATE + +name: 'Cache Gradle' +runs: + using: "composite" + steps: + + - name: Cache '.gradle/wrapper' + uses: actions/cache@v4 + with: + key: gradle-wrapper-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles( 'gradle/wrapper/gradle-wrapper.properties' ) }} + path: | + ~/.gradle/wrapper + + - name: Cache '.gradle/caches' and 'buildSrc/build' + uses: actions/cache@v4 + with: + key: gradle-caches-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles( '**/*.gradle*', 'gradle/**', 'gradle.properties', 'buildSrc/src/**' ) }} + path: | + ~/.gradle/caches + buildSrc/build + buildSrc/.gradle diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 391e612a..80ce1a30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ on: - '.*' - '**/.settings/**' - 'flatlaf-core/svg/**' + - 'flatlaf-natives/**' - 'flatlaf-testing/dumps/**' - 'flatlaf-testing/misc/**' - 'images/**' @@ -32,7 +33,9 @@ jobs: with: java-version: 21 distribution: temurin # pre-installed on ubuntu-latest - cache: gradle + + - name: Cache Gradle + uses: ./.github/actions/cache-gradle # test against @@ -100,7 +103,9 @@ jobs: with: java-version: 21 distribution: temurin # pre-installed on ubuntu-latest - cache: gradle + + - name: Cache Gradle + uses: ./.github/actions/cache-gradle - name: Release a new stable version to Maven Central run: ./gradlew publishToSonatype closeSonatypeStagingRepository :flatlaf-demo:build :flatlaf-theme-editor:build -PskipFonts -Prelease -Dorg.gradle.parallel=false diff --git a/.github/workflows/error-prone.yml b/.github/workflows/error-prone.yml index d2ef3b9a..719b4757 100644 --- a/.github/workflows/error-prone.yml +++ b/.github/workflows/error-prone.yml @@ -14,6 +14,7 @@ on: - '.*' - '**/.settings/**' - 'flatlaf-core/svg/**' + - 'flatlaf-natives/**' - 'flatlaf-testing/dumps/**' - 'flatlaf-testing/misc/**' - 'images/**' @@ -31,7 +32,9 @@ jobs: with: java-version: 21 distribution: temurin # pre-installed on ubuntu-latest - cache: gradle + + - name: Cache Gradle + uses: ./.github/actions/cache-gradle - name: Check with Error Prone run: ./gradlew errorprone diff --git a/.github/workflows/fonts.yml b/.github/workflows/fonts.yml index b6167524..300364bd 100644 --- a/.github/workflows/fonts.yml +++ b/.github/workflows/fonts.yml @@ -39,7 +39,9 @@ jobs: with: java-version: 21 distribution: temurin # pre-installed on ubuntu-latest - cache: gradle + + - name: Cache Gradle + uses: ./.github/actions/cache-gradle - name: Build with Gradle run: ./gradlew :flatlaf-fonts-${{ matrix.font }}:build diff --git a/.github/workflows/natives.yml b/.github/workflows/natives.yml index df8175cd..3c434036 100644 --- a/.github/workflows/natives.yml +++ b/.github/workflows/natives.yml @@ -63,7 +63,9 @@ jobs: with: java-version: 21 distribution: temurin - cache: gradle + + - name: Cache Gradle + uses: ./.github/actions/cache-gradle - name: Build with Gradle # --no-daemon is necessary on Windows otherwise caching Gradle would fail with: diff --git a/.github/workflows/pr-snapshots.yml b/.github/workflows/pr-snapshots.yml index a44445a0..8bd339e3 100644 --- a/.github/workflows/pr-snapshots.yml +++ b/.github/workflows/pr-snapshots.yml @@ -26,7 +26,9 @@ jobs: with: java-version: 21 distribution: temurin # pre-installed on ubuntu-latest - cache: gradle + + - name: Cache Gradle + uses: ./.github/actions/cache-gradle - name: Publish PR snapshot to Sonatype Central run: >