From 565ac9c7b1b9a086b9bbd2a75b8ef94a5357dd5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AA=E3=82=B9?= Date: Mon, 2 Aug 2021 14:19:40 +0900 Subject: [PATCH] fix: fall back to project root repositories.gradle (#1300) --- framework/build.gradle | 8 +++++++- templates/project/app/build.gradle | 8 +++++++- templates/project/build.gradle | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/framework/build.gradle b/framework/build.gradle index 8ee8ca09..38cd42d7 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -29,7 +29,13 @@ buildscript { } allprojects { - apply from: 'repositories.gradle' + def hasRepositoriesGradle = file('repositories.gradle').exists() + if (hasRepositoriesGradle) { + apply from: 'repositories.gradle' + } else { + apply from: "${project.rootDir}/repositories.gradle" + } + repositories repos } diff --git a/templates/project/app/build.gradle b/templates/project/app/build.gradle index f1b41d70..08959e08 100644 --- a/templates/project/app/build.gradle +++ b/templates/project/app/build.gradle @@ -60,7 +60,13 @@ buildscript { // Allow plugins to declare Maven dependencies via build-extras.gradle. allprojects { - apply from: 'repositories.gradle' + def hasRepositoriesGradle = file('repositories.gradle').exists() + if (hasRepositoriesGradle) { + apply from: 'repositories.gradle' + } else { + apply from: "${project.rootDir}/repositories.gradle" + } + repositories repos } diff --git a/templates/project/build.gradle b/templates/project/build.gradle index 1e01f06e..949bc3fa 100644 --- a/templates/project/build.gradle +++ b/templates/project/build.gradle @@ -30,7 +30,13 @@ buildscript { } allprojects { - apply from: 'repositories.gradle' + def hasRepositoriesGradle = file('repositories.gradle').exists() + if (hasRepositoriesGradle) { + apply from: 'repositories.gradle' + } else { + apply from: "${project.rootDir}/repositories.gradle" + } + repositories repos }