From 515463942c90b07ee4674a47748aed642ceabdc6 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 21 Jun 2021 12:08:39 -0700 Subject: [PATCH] Move stitch files to a directory ignored by spm When opening the Swift Package in Xcode all of the files not in dotdirs are included in the generated xcode project, which includes all of the baas files. This makes Xcode's quick open a lot less useful by flooding it with files we don't want. --- .gitignore | 30 +---------------------- CHANGELOG.md | 3 ++- Realm.xcodeproj/project.pbxproj | 8 +++--- Realm/ObjectServerTests/RealmServer.swift | 13 ++++------ Realm/ObjectServerTests/setup_baas.rb | 2 +- build.sh | 2 ++ 6 files changed, 15 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 13fe3dfe0f..3c040f186f 100644 --- a/.gitignore +++ b/.gitignore @@ -24,10 +24,6 @@ realm-core-*-xcframework # sh build.sh test build/ -# sh build.sh ios-framework -# sh build.sh package-examples -*/Realm.framework -Realm.framework # sh build.sh cocoapods-setup /include @@ -66,30 +62,6 @@ build.log /test/version_tmp/ /tmp/ -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalisation: -/.bundle/ -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc - ## Carthage # Cartfiles are ignored because they're generated on demand in the installation examples Cartfile @@ -101,7 +73,7 @@ SwiftVersion.swift examples/ios/objc/Draw/Constants.h ## Sync testing -/stitch +/.baas ## Swiftpm .swiftpm diff --git a/CHANGELOG.md b/CHANGELOG.md index e8d69a1532..409648ac55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ x.y.z Release notes (yyyy-MM-dd) ### Fixed * ([#????](https://github.com/realm/realm-cocoa/issues/????), since v?.?.?) -* None. +* Importing the Realm swift package produced several warnings about excluded + files not existing. ([#7295](https://github.com/realm/realm-cocoa/issues/7295), since v10.8.0). diff --git a/Realm.xcodeproj/project.pbxproj b/Realm.xcodeproj/project.pbxproj index 7ec477dca9..aeb3995b8b 100644 --- a/Realm.xcodeproj/project.pbxproj +++ b/Realm.xcodeproj/project.pbxproj @@ -2309,10 +2309,10 @@ outputFileListPaths = ( ); outputPaths = ( - "$(SRCROOT)/build/bin/assisted_agg", - "$(SRCROOT)/build/bin/create_user", - "$(SRCROOT)/build/bin/stitch_server", - "$(SRCROOT)/build/bin/update_doc", + "$(SRCROOT)/.baas/bin/assisted_agg", + "$(SRCROOT)/.baas/bin/create_user", + "$(SRCROOT)/.baas/bin/stitch_server", + "$(SRCROOT)/.baas/bin/update_doc", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/Realm/ObjectServerTests/RealmServer.swift b/Realm/ObjectServerTests/RealmServer.swift index c6ffaa3c96..c73956c487 100644 --- a/Realm/ObjectServerTests/RealmServer.swift +++ b/Realm/ObjectServerTests/RealmServer.swift @@ -417,7 +417,7 @@ public class RealmServer: NSObject { .deletingLastPathComponent() // RealmServer.swift .deletingLastPathComponent() // ObjectServerTests .deletingLastPathComponent() // Realm - private static let buildDir = rootUrl.appendingPathComponent("build") + private static let buildDir = rootUrl.appendingPathComponent(".baas") private static let binDir = buildDir.appendingPathComponent("bin") /// The directory where mongo stores its files. This is a unique value so that @@ -433,9 +433,7 @@ public class RealmServer: NSObject { /// Check if the BaaS files are present and we can run the server @objc public class func haveServer() -> Bool { - let goDir = RealmServer.rootUrl - .appendingPathComponent("build") - .appendingPathComponent("stitch") + let goDir = RealmServer.buildDir.appendingPathComponent("stitch") return FileManager.default.fileExists(atPath: goDir.path) } @@ -518,12 +516,11 @@ public class RealmServer: NSObject { } private func launchServerProcess() throws { - let buildDir = RealmServer.rootUrl.appendingPathComponent("build") - let binDir = buildDir.appendingPathComponent("bin").path - let libDir = buildDir.appendingPathComponent("lib").path + let binDir = Self.buildDir.appendingPathComponent("bin").path + let libDir = Self.buildDir.appendingPathComponent("lib").path let binPath = "$PATH:\(binDir)" - let stitchRoot = RealmServer.rootUrl.path + "/build/go/src/github.com/10gen/stitch" + let stitchRoot = RealmServer.buildDir.path + "/go/src/github.com/10gen/stitch" // create the admin user let userProcess = Process() diff --git a/Realm/ObjectServerTests/setup_baas.rb b/Realm/ObjectServerTests/setup_baas.rb index 9318967397..aeec567dde 100644 --- a/Realm/ObjectServerTests/setup_baas.rb +++ b/Realm/ObjectServerTests/setup_baas.rb @@ -5,7 +5,7 @@ require 'pathname' BASE_DIR = Dir.pwd -BUILD_DIR = "#{BASE_DIR}/build" +BUILD_DIR = "#{BASE_DIR}/.baas" BIN_DIR = "#{BUILD_DIR}/bin" LIB_DIR = "#{BUILD_DIR}/lib" PID_FILE = "#{BUILD_DIR}/pid.txt" diff --git a/build.sh b/build.sh index 392e5f090d..6493ac3f3c 100755 --- a/build.sh +++ b/build.sh @@ -1100,6 +1100,8 @@ case "$COMMAND" in export REALM_SKIP_PRELAUNCH=1 if [[ "$target" = *"server"* ]] || [[ "$target" = "swiftpm"* ]]; then + mkdir .baas + mv build/stitch .baas source "$(brew --prefix nvm)/nvm.sh" --no-use nvm install 13.14.0 sh build.sh setup-baas