From: aescling Date: Tue, 21 Mar 2023 03:51:49 +0000 (-0400) Subject: Enhance asset precompilation to prebuild app icons X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=a4022c2d7584cfcae33045904d05d9e6fc233968;p=mastodon.git Enhance asset precompilation to prebuild app icons This removes a requirement to add a line to our build scripts --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 56cf82aef..7a20909a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,7 +101,6 @@ diff: build: stage: build script: - - ./bin/rails branding:generate_app_icons # ew - ./bin/rails assets:precompile artifacts: name: assets diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 5931aae61..dc1a5eb4a 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -19,7 +19,10 @@ namespace :assets do end if Rake::Task.task_defined?('assets:precompile') - Rake::Task['assets:precompile'].enhance do + # Rake::Task.enhance accepts prerequisites as an argument, and postrequisites + # as a block; this will cause 'branding:generate_app_icons' to run *before* + # 'assets:precompile', and the code in the block to run *after* + Rake::Task['assets:precompile'].enhance ['branding:generate_app_icons'] do Webpacker.manifest.refresh Rake::Task['assets:generate_static_pages'].invoke end