Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,22 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase

public buildProject(projectRoot: string): IFuture<void> {
return (() => {
var basicArgs = [
"-project", path.join(projectRoot, this.$projectData.projectName + ".xcodeproj"),
"-target", this.$projectData.projectName,
let basicArgs = [
"-configuration", this.$options.release ? "Release" : "Debug",
"build",
'SHARED_PRECOMPS_DIR=' + path.join(projectRoot, 'build', 'sharedpch')
];
var args: string[] = [];


let xcworkspacePath = path.join(projectRoot, this.$projectData.projectName + ".xcworkspace");
if(this.$fs.exists(xcworkspacePath).wait()) {
basicArgs.push("-workspace", xcworkspacePath);
basicArgs.push("-scheme", this.$projectData.projectName);
} else {
basicArgs.push("-project", path.join(projectRoot, this.$projectData.projectName + ".xcodeproj"));
basicArgs.push("-target", this.$projectData.projectName);
}

let args: string[] = [];
if(this.$options.forDevice) {
args = basicArgs.concat([
"-xcconfig", path.join(projectRoot, this.$projectData.projectName, "build.xcconfig"),
Expand All @@ -151,7 +158,6 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
"VALID_ARCHS=\"i386\"",
"CONFIGURATION_BUILD_DIR=" + path.join(projectRoot, "build", "emulator")
]);

}

this.$childProcess.spawnFromEvent("xcodebuild", args, "exit", {cwd: this.$options, stdio: 'inherit'}).wait();
Expand Down Expand Up @@ -361,4 +367,4 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
}).future<void>()();
}
}
$injector.register("iOSProjectService", IOSProjectService);
$injector.register("iOSProjectService", IOSProjectService);