diff --git a/application/build.gradle b/application/build.gradle index 05c38c46e4..d6d9a74377 100644 --- a/application/build.gradle +++ b/application/build.gradle @@ -106,16 +106,28 @@ tasks.named('jacocoTestReport', JacocoReport) { } } +ext.presetPluginUrls = [ + 'https://github.com/halo-dev/plugin-comment-widget/releases/download/v1.9.0/plugin-comment-widget-1.9.0.jar': 'plugin-comment-widget.jar', + 'https://github.com/halo-dev/plugin-search-widget/releases/download/v1.3.1/plugin-search-widget-1.3.1.jar': 'plugin-search-widget.jar', + 'https://github.com/halo-dev/plugin-sitemap/releases/download/v1.1.1/plugin-sitemap-1.1.1.jar': 'plugin-sitemap.jar', + 'https://github.com/halo-dev/plugin-feed/releases/download/v1.2.1/plugin-feed-1.2.1.jar': 'plugin-feed.jar', + + // Currently, plugin-app-store is not open source, so we need to download it from the official website. + // Please see https://github.com/halo-dev/plugin-app-store/issues/55 + // https://www.halo.run/store/apps/app-VYJbF + 'https://www.halo.run/store/apps/app-VYJbF/releases/download/app-release-cWbLS/assets/app-release-cWbLS-fZYSx': 'appstore.jar', +] + tasks.register('downloadPluginPresets', Download) { doFirst { delete 'src/main/resources/presets/plugins' } - src([ - 'https://github.com/halo-dev/plugin-comment-widget/releases/download/v1.8.0/plugin-comment-widget-1.8.0.jar', - 'https://github.com/halo-dev/plugin-search-widget/releases/download/v1.2.0/plugin-search-widget-1.2.0.jar', - 'https://github.com/halo-dev/plugin-sitemap/releases/download/v1.1.1/plugin-sitemap-1.1.1.jar', - 'https://github.com/halo-dev/plugin-feed/releases/download/v1.2.0/plugin-feed-1.2.0.jar', - 'https://github.com/halo-dev/plugin-app-store/releases/download/v1.0.0-beta.2/plugin-app-store-1.0.0-beta.2.jar' - ]) + + src presetPluginUrls.keySet() + dest 'src/main/resources/presets/plugins' + + eachFile { f -> + f.name = presetPluginUrls[f.sourceURL.toString()] + } }