This repository was archived by the owner on Jan 25, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -465,12 +465,9 @@ RUN dotnet new
465
465
#
466
466
# ###############################################################################
467
467
USER buildbot
468
- ENV NETLIFY_BUILD_SWIFT_VERSION 5.2
469
468
ENV SWIFTENV_ROOT "/opt/buildhome/.swiftenv"
470
469
RUN git clone --depth 1 https://github.com/kylef/swiftenv.git "$SWIFTENV_ROOT"
471
470
ENV PATH "$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH"
472
- RUN swiftenv install ${NETLIFY_BUILD_SWIFT_VERSION}
473
- RUN swift --version
474
471
475
472
# ###############################################################################
476
473
#
Original file line number Diff line number Diff line change @@ -415,9 +415,6 @@ install_dependencies() {
415
415
echo " Attempting Swift version '$SWIFT_VERSION ' from .swift-version"
416
416
fi
417
417
418
- swiftenv global ${SWIFT_VERSION} > /dev/null 2>&1
419
- export CUSTOM_SWIFT=$?
420
-
421
418
if [ -d $NETLIFY_CACHE_DIR /swift_version/$SWIFT_VERSION ]
422
419
then
423
420
echo " Started restoring cached Swift version"
@@ -429,12 +426,14 @@ install_dependencies() {
429
426
430
427
# swiftenv expects the following environment variables to refer to
431
428
# swiftenv internals
432
- if PLATFORM= URL= VERSION= swiftenv install -s $SWIFT_VERSION
433
- then
434
- echo " Using Swift version $SWIFT_VERSION "
435
- else
436
- echo " Failed to install Swift version '$SWIFT_VERSION '"
437
- exit 1
429
+ if [ -f .swift-version -o -f Package.swift ]
430
+ if PLATFORM= URL= VERSION= swiftenv install -s $SWIFT_VERSION
431
+ then
432
+ echo " Using Swift version $SWIFT_VERSION "
433
+ else
434
+ echo " Failed to install Swift version '$SWIFT_VERSION '"
435
+ exit 1
436
+ fi
438
437
fi
439
438
440
439
# SPM dependencies
@@ -700,7 +699,7 @@ cache_artifacts() {
700
699
fi
701
700
702
701
# cache the version of Swift installed
703
- if [[ " $CUSTOM_SWIFT " -ne " 0 " ] ]
702
+ if [ -d $SWIFTENV_ROOT /versions/ $SWIFT_VERSION ]
704
703
then
705
704
if ! [ -d $NETLIFY_CACHE_DIR /swift_version/$SWIFT_VERSION ]
706
705
then
You can’t perform that action at this time.
0 commit comments