mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 19:20:44 +02:00
Fix overrides of plugin repository
The correct way to override the plugins repo is through the pluginManagement section in the gradle settings file. Also make use of the gradle.properties file to initialize repositoryUrl and also publishUrl so we don't have to mess around with finding and assigning them in the main gradle file. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=233778270
This commit is contained in:
parent
76028ba1b4
commit
287824564c
3 changed files with 19 additions and 18 deletions
|
@ -1,18 +1,4 @@
|
|||
buildscript {
|
||||
ext.repositoryUrl = project.findProperty('repositoryUrl')
|
||||
ext.publishUrl = project.findProperty('publishUrl')
|
||||
repositories {
|
||||
if (repositoryUrl == null) {
|
||||
println "Using Maven central..."
|
||||
mavenCentral()
|
||||
} else {
|
||||
maven {
|
||||
println "Using GCS Maven repo..."
|
||||
url repositoryUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Lock buildscript dependencies.
|
||||
configurations.classpath {
|
||||
resolutionStrategy.activateDependencyLocking()
|
||||
|
@ -71,7 +57,7 @@ task stage {
|
|||
}
|
||||
|
||||
|
||||
if (publishUrl != null) {
|
||||
if (publishUrl) {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
|
@ -129,12 +115,12 @@ allprojects {
|
|||
if (project.name == 'services') return
|
||||
|
||||
repositories {
|
||||
if (rootProject.repositoryUrl == null) {
|
||||
mavenCentral()
|
||||
} else {
|
||||
if (rootProject.repositoryUrl) {
|
||||
maven {
|
||||
url rootProject.repositoryUrl
|
||||
}
|
||||
} else {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
gradle/gradle.properties
Normal file
2
gradle/gradle.properties
Normal file
|
@ -0,0 +1,2 @@
|
|||
repositoryUrl=
|
||||
publishUrl=
|
|
@ -1,3 +1,16 @@
|
|||
if (repositoryUrl) {
|
||||
println "Using repository $repositoryUrl for plugins"
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
url repositoryUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println "Using default repository for plugins"
|
||||
}
|
||||
|
||||
rootProject.name = 'nomulus'
|
||||
|
||||
include 'core'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue