Skip to content

Commit

Permalink
Move stitch files to a directory ignored by spm
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tgoyne committed Jun 21, 2021
1 parent 5a89100 commit 5154639
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 43 deletions.
30 changes: 1 addition & 29 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -101,7 +73,7 @@ SwiftVersion.swift
examples/ios/objc/Draw/Constants.h

## Sync testing
/stitch
/.baas

## Swiftpm
.swiftpm
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ x.y.z Release notes (yyyy-MM-dd)

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](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).

<!-- ### Breaking Changes - ONLY INCLUDE FOR NEW MAJOR version -->

Expand Down
8 changes: 4 additions & 4 deletions Realm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 5 additions & 8 deletions Realm/ObjectServerTests/RealmServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}

Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Realm/ObjectServerTests/setup_baas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5154639

Please sign in to comment.