From 11364918b25b45432c05d8e52d3e33b6b0ff4c40 Mon Sep 17 00:00:00 2001 From: Norman Breau Date: Sat, 27 Mar 2021 12:11:56 -0300 Subject: [PATCH] add repositories support (#1179) Authored-by: Engin Diri --- bin/templates/project/app/build.gradle | 13 ++++--------- bin/templates/project/app/repositories.gradle | 5 +++++ bin/templates/project/build.gradle | 13 +++++-------- bin/templates/project/repositories.gradle | 4 ++++ framework/build.gradle | 12 ++++-------- framework/repositories.gradle | 4 ++++ 6 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 bin/templates/project/app/repositories.gradle create mode 100644 bin/templates/project/repositories.gradle create mode 100644 framework/repositories.gradle diff --git a/bin/templates/project/app/build.gradle b/bin/templates/project/app/build.gradle index a9d6cac1..16cfe01d 100644 --- a/bin/templates/project/app/build.gradle +++ b/bin/templates/project/app/build.gradle @@ -44,11 +44,8 @@ buildscript { ext.kotlin_version = gradlePluginKotlinVersion } - repositories { - mavenCentral() - google() - jcenter() - } + apply from: 'repositories.gradle' + repositories repos dependencies { apply from: '../CordovaLib/cordova.gradle' @@ -82,10 +79,8 @@ buildscript { // Allow plugins to declare Maven dependencies via build-extras.gradle. allprojects { - repositories { - mavenCentral() - jcenter() - } + apply from: 'repositories.gradle' + repositories repos } task wrapper(type: Wrapper) { diff --git a/bin/templates/project/app/repositories.gradle b/bin/templates/project/app/repositories.gradle new file mode 100644 index 00000000..996e214b --- /dev/null +++ b/bin/templates/project/app/repositories.gradle @@ -0,0 +1,5 @@ +ext.repos = { + mavenCentral() + google() + jcenter() +} diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle index 04395fed..9bf1b1f5 100644 --- a/bin/templates/project/build.gradle +++ b/bin/templates/project/build.gradle @@ -20,10 +20,9 @@ buildscript { ext.kotlin_version = '1.4.31' - repositories { - google() - jcenter() - } + apply from: 'repositories.gradle' + repositories repos + dependencies { classpath 'com.android.tools.build:gradle:4.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -33,10 +32,8 @@ buildscript { } allprojects { - repositories { - google() - jcenter() - } + apply from: 'repositories.gradle' + repositories repos //This replaces project.properties w.r.t. build settings project.ext { diff --git a/bin/templates/project/repositories.gradle b/bin/templates/project/repositories.gradle new file mode 100644 index 00000000..66d1143c --- /dev/null +++ b/bin/templates/project/repositories.gradle @@ -0,0 +1,4 @@ +ext.repos = { + google() + jcenter() +} diff --git a/framework/build.gradle b/framework/build.gradle index a5959433..98648323 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -29,10 +29,8 @@ ext { } buildscript { - repositories { - google() - jcenter() - } + apply from: 'repositories.gradle' + repositories repos dependencies { // The gradle plugin and the maven plugin have to be updated after each version of Android @@ -44,10 +42,8 @@ buildscript { } allprojects { - repositories { - google() - jcenter() - } + apply from: 'repositories.gradle' + repositories repos } apply plugin: 'com.android.library' diff --git a/framework/repositories.gradle b/framework/repositories.gradle new file mode 100644 index 00000000..66d1143c --- /dev/null +++ b/framework/repositories.gradle @@ -0,0 +1,4 @@ +ext.repos = { + google() + jcenter() +}