Skip to content

Commit

Permalink
Project: Add DevelopmentTeam configuration (#157)
Browse files Browse the repository at this point in the history
This is a generated xcconfig in the Rakefile which gets included by the project
to set the DEVELOPMENT_TEAM key to keep Xcode 8 happy. The development team is
figured based on the available “Mac Developer” certificate.

Also update the way SantaCache declares a ‘zero’ value, update the
OCMock pod and add a few missing includes.
  • Loading branch information
russellhancox authored Mar 20, 2017
1 parent c3db518 commit 094880a
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 98 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Santa.xcodeproj/xcuserdata
Santa.xcodeproj/project.xcworkspace
Santa.xcworkspace/xcuserdata
Santa.xcworkspace/xcshareddata
Source/DevelopmentTeam.xcconfig
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ PODS:
- FMDB (2.6.2):
- FMDB/standard (= 2.6.2)
- FMDB/standard (2.6.2)
- MOLAuthenticatingURLSession (2.1):
- MOLAuthenticatingURLSession (2.2):
- MOLCertificate (~> 1.5)
- MOLCertificate (1.5)
- MOLCodesignChecker (1.5):
- MOLCertificate (~> 1.3)
- MOLFCMClient (1.3):
- MOLAuthenticatingURLSession (~> 2.1)
- OCMock (3.3.1)
- OCMock (3.4)

DEPENDENCIES:
- FMDB
Expand All @@ -21,11 +21,11 @@ DEPENDENCIES:

SPEC CHECKSUMS:
FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a
MOLAuthenticatingURLSession: 2f0fd35f641bc857ee1b026021dbd759955adaa3
MOLAuthenticatingURLSession: 5a5e31eb73248c3e92c79b9a285f031194e8404c
MOLCertificate: c39cae866d24d36fbc78032affff83d401b5384a
MOLCodesignChecker: fc9c64147811d7b0d0739127003e0630dff9213a
MOLFCMClient: 13d8b42db9d750e772f09cc38fc453922fece09f
OCMock: f3f61e6eaa16038c30caa5798c5e49d3307b6f22
OCMock: 35ae71d6a8fcc1b59434d561d1520b9dd4f15765

PODFILE CHECKSUM: 1728b86e95e7cdb481dd91ab9c38af38e060a023

Expand Down
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
require 'openssl'

WORKSPACE = 'Santa.xcworkspace'
DEFAULT_SCHEME = 'All'
OUTPUT_PATH = 'Build'
BINARIES = ['Santa.app', 'santa-driver.kext']
DSYMS = ['Santa.app.dSYM', 'santa-driver.kext.dSYM', 'santad.dSYM', 'santactl.dSYM']
XCPRETTY_DEFAULTS = '-sc'
XCODEBUILD_DEFAULTS = "-workspace #{WORKSPACE} -derivedDataPath #{OUTPUT_PATH} -parallelizeTargets"
DEVTEAM_FILE = 'Source/DevelopmentTeam.xcconfig'
DEVTEAM_CERT_CN = 'Mac Developer'
$DISABLE_XCPRETTY = false

task :default do
Expand Down Expand Up @@ -44,6 +48,13 @@ task :init do
puts "xcpretty is not installed. Install with 'sudo gem install xcpretty'"
$DISABLE_XCPRETTY = true
end
cert_pem = `security find-certificate -p -c '#{DEVTEAM_CERT_CN}'`
cert = OpenSSL::X509::Certificate.new cert_pem
team_id = cert.subject.to_a.find {|f| f[0] == "OU"}[1]
File.open(DEVTEAM_FILE, 'w') { |f|
f.puts("// This file is auto-generated. Do not edit manually")
f.puts("DEVELOPMENT_TEAM = #{team_id}")
}
end

task :remove_existing do
Expand Down
182 changes: 89 additions & 93 deletions Santa.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Source/santa-driver/SantaCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ template<class T> class SantaCache {
/**
Holder for a 'zero' entry for the current type
*/
T zero_ = {};
const T zero_ = T(0);

/**
Special bucket used when automatically clearing due to size
Expand Down
2 changes: 2 additions & 0 deletions Source/santad/SNTDriverManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

@import IOKit.kext;

#include <mach/mach_port.h>

#import "SNTLogging.h"

@interface SNTDriverManager ()
Expand Down
1 change: 1 addition & 0 deletions Source/santad/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "SNTLogging.h"

#include <mach/task.h>
#include <pthread/pthread.h>
#include <sys/resource.h>

Expand Down

0 comments on commit 094880a

Please sign in to comment.