diff --git a/.gitignore b/.gitignore index 7f107c4bc93..b4ba88390c2 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ /lib/ build/apache-maven* build/sbt-launch-*.jar +build/sbt-config/repositories-local cache checkpoint conf/*.cmd diff --git a/.rat-excludes b/.rat-excludes index e7715c98e53..a4d3424b349 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -35,4 +35,5 @@ assets/** build/apache-maven-*/** build/scala-*/** build/sbt-config/repositories +build/sbt-config/repositories-cn.template **/benchmarks/** diff --git a/build/sbt b/build/sbt index 518513d95cd..8251f889e91 100755 --- a/build/sbt +++ b/build/sbt @@ -20,9 +20,17 @@ SELF=$(cd $(dirname $0) && pwd) . "$SELF/util.sh" -echo "The CN repositories are to be enabled by default for the purpose of downloading bootstrap/plugin/dependencies jars." -SBT_REPOSITORIES_CONFIG="$(dirname "$(realpath "$0")")/sbt-config/repositories-cn" -export SBT_OPTS="${SBT_OPTS:="-Dsbt.override.build.repos=true -Dsbt.repository.config=$SBT_REPOSITORIES_CONFIG"}" +# Check if repositories-local file exists, otherwise use repositories +SBT_REPOSITORIES_LOCAL_CONFIG="$(dirname "$(realpath "$0")")/sbt-config/repositories-local" +SBT_REPOSITORIES_CONFIG="$(dirname "$(realpath "$0")")/sbt-config/repositories" + +if [ -f "$SBT_REPOSITORIES_LOCAL_CONFIG" ]; then + SBT_OPTS="${SBT_OPTS:="-Dsbt.override.build.repos=true -Dsbt.repository.config=$SBT_REPOSITORIES_LOCAL_CONFIG"}" +else + SBT_OPTS="${SBT_OPTS:="-Dsbt.override.build.repos=true -Dsbt.repository.config=$SBT_REPOSITORIES_CONFIG"}" +fi + +export SBT_OPTS . "$(dirname "$(realpath "$0")")"/sbt-launch-lib.bash diff --git a/build/sbt-config/repositories-cn b/build/sbt-config/repositories-cn.template similarity index 100% rename from build/sbt-config/repositories-cn rename to build/sbt-config/repositories-cn.template