From 7ffd3183d3339227219b3ebcb8596d0fafff2508 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Mon, 25 Apr 2022 18:47:14 +0200 Subject: [PATCH 1/5] fix(java): cache common files --- .github/actions/cache/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 54ff04f120..390be680bf 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -380,7 +380,7 @@ runs: if: ${{ inputs.job == 'cts' || inputs.job == 'codegen' || (inputs.job == 'client' && inputs.language == 'java') }} uses: actions/cache@v2 with: - path: clients/algoliasearch-client-java-2/gradle.properties + path: clients/algoliasearch-client-java-2/gradle* key: | ${{ env.CACHE_VERSION }}-${{ hashFiles( From 296b373adeef3f07f9895ed37d95205b428d2b55 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Mon, 25 Apr 2022 18:49:12 +0200 Subject: [PATCH 2/5] bump cache --- .github/.cache_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/.cache_version b/.github/.cache_version index b93692a052..dd98ee6cb6 100644 --- a/.github/.cache_version +++ b/.github/.cache_version @@ -1 +1 @@ -8.0.10.0.8 +9.0 From 97b130c5efaec64d8cc33ebbc38230575ea4e568 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Tue, 26 Apr 2022 14:28:15 +0200 Subject: [PATCH 3/5] remove gitgnore from mustache --- .../algolia/codegen/AlgoliaJavaGenerator.java | 3 ++- templates/java/gitignore.mustache | 19 ------------------- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 templates/java/gitignore.mustache diff --git a/generators/src/main/java/com/algolia/codegen/AlgoliaJavaGenerator.java b/generators/src/main/java/com/algolia/codegen/AlgoliaJavaGenerator.java index 4831df2527..b11b5bdefa 100644 --- a/generators/src/main/java/com/algolia/codegen/AlgoliaJavaGenerator.java +++ b/generators/src/main/java/com/algolia/codegen/AlgoliaJavaGenerator.java @@ -238,7 +238,8 @@ public void processOpts() { supportingFiles.removeIf(file -> file.getTemplateFile().equals("build.gradle.mustache") || - file.getTemplateFile().equals("settings.gradle.mustache") + file.getTemplateFile().equals("settings.gradle.mustache") || + file.getTemplateFile().equals("gitignore.mustache") ); } diff --git a/templates/java/gitignore.mustache b/templates/java/gitignore.mustache deleted file mode 100644 index ca4ac1f99c..0000000000 --- a/templates/java/gitignore.mustache +++ /dev/null @@ -1,19 +0,0 @@ -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.war -*.ear - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -# build files -**/target -target -.gradle -build - -.openapi-generator From 80139ec9fd9a9fed09a5fc14ff90c4a02bbed602 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Tue, 26 Apr 2022 14:45:23 +0200 Subject: [PATCH 4/5] special cache key --- .github/actions/cache/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 390be680bf..58ede1fc3e 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -382,9 +382,8 @@ runs: with: path: clients/algoliasearch-client-java-2/gradle* key: | - ${{ env.CACHE_VERSION }}-${{ + ${{ env.CACHE_VERSION }}-java-common-${{ hashFiles( - 'specs/bundled/search.yml', 'templates/java/**', 'generators/src/**' )}} From ae3c1276081e1077b3b1c002c7a21ab4b63cf0d0 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Tue, 26 Apr 2022 20:26:00 +0200 Subject: [PATCH 5/5] * doesn't seem to work --- .github/actions/cache/action.yml | 6 ++++-- config/generation.config.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 58ede1fc3e..14e452c969 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -376,11 +376,13 @@ runs: )}} # Restore Java clients: used during 'cts' or 'codegen' - - name: Restore Java client gradle properties + - name: Restore Java client gradle files if: ${{ inputs.job == 'cts' || inputs.job == 'codegen' || (inputs.job == 'client' && inputs.language == 'java') }} uses: actions/cache@v2 with: - path: clients/algoliasearch-client-java-2/gradle* + path: | + clients/algoliasearch-client-java-2/gradle* + clients/algoliasearch-client-java-2/gradle/* key: | ${{ env.CACHE_VERSION }}-java-common-${{ hashFiles( diff --git a/config/generation.config.js b/config/generation.config.js index a8e813ff72..a3e0ebac10 100644 --- a/config/generation.config.js +++ b/config/generation.config.js @@ -11,6 +11,7 @@ module.exports = { // Java '!clients/algoliasearch-client-java-2/*.gradle', + '!clients/algoliasearch-client-java-2/.gitignore', '!clients/algoliasearch-client-java-2/algoliasearch-core/build.gradle', '!clients/algoliasearch-client-java-2/algoliasearch-core/src/com/algolia/exceptions/*', '!clients/algoliasearch-client-java-2/algoliasearch-core/src/com/algolia/utils/*',