Skip to content

Commit

Permalink
Resolves issue robbiehanson#56 - Use Xcode configuration files common…
Browse files Browse the repository at this point in the history
… to all Sample projects. Also adding instructions to all sample projects.
  • Loading branch information
robbiehanson committed Jun 6, 2011
1 parent 2c10c23 commit 56bd9ce
Show file tree
Hide file tree
Showing 37 changed files with 424 additions and 469 deletions.
41 changes: 17 additions & 24 deletions Samples/DynamicServer/DynamicServer.xcodeproj/project.pbxproj
Expand Up @@ -93,6 +93,9 @@
DC2E2EE11298C60A009F096E /* MyHTTPConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyHTTPConnection.m; sourceTree = "<group>"; };
DC3303BB12B0967000AEF314 /* HTTPResponseTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPResponseTest.h; sourceTree = "<group>"; };
DC3303BC12B0967000AEF314 /* HTTPResponseTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPResponseTest.m; sourceTree = "<group>"; };
DC372E3A139D37A500A8407D /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
DC372E3B139D37A500A8407D /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
DC372E3D139D37A500A8407D /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -166,6 +169,7 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
DC372E39139D37A500A8407D /* Xcode-Configurations */,
256AC3F00F4B6AF500CF3369 /* DynamicServer_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
Expand Down Expand Up @@ -275,6 +279,17 @@
name = Core;
sourceTree = "<group>";
};
DC372E39139D37A500A8407D /* Xcode-Configurations */ = {
isa = PBXGroup;
children = (
DC372E3A139D37A500A8407D /* Base.xcconfig */,
DC372E3B139D37A500A8407D /* Debug.xcconfig */,
DC372E3D139D37A500A8407D /* Release.xcconfig */,
);
name = "Xcode-Configurations";
path = "../Xcode-Configurations";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -388,56 +403,34 @@
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = DynamicServer_Prefix.pch;
INFOPLIST_FILE = "DynamicServer-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = DynamicServer;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = DynamicServer_Prefix.pch;
INFOPLIST_FILE = "DynamicServer-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = DynamicServer;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DC372E3B139D37A500A8407D /* Debug.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DC372E3D139D37A500A8407D /* Release.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Release;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Samples/DynamicServer/Instructions.txt
@@ -0,0 +1,19 @@
INFO:

This example project demonstrates the ability of the HTTPDynamicFileResponse to easily create dynamic content.

Take a look at the Web/index.html file. You'll notice a bunch of "%%PLACEHOLDERS%%" meant to be replaced dynamically. With only a few lines of code, the HTTPDynamicFileResponse will replace these automatically, and asynchronously, as the file gets uploaded to the client!

INSTRUCTIONS:

Open the Xcode project, and build and go.

On the Xcode console you'll see a message saying:
"Started HTTP server on port 59123"

Now open your browser and type in the URL:
http://localhost:59123

(Replace 59123 with whatever port the server is actually running on.)

Enjoy.
32 changes: 32 additions & 0 deletions Samples/PasswdHTTPServer/Instructions.txt
@@ -0,0 +1,32 @@
INFO:

This project demonstrates password protecting a specific resource. More specifically, the project allows unrestricted access to the ~/Sites folder, but requires a password for anything in the ~/Sites/secret/ subfolder.

INSTRUCTIONS:

Create the following folder:
~/Sites/secret

And then add a file to it. For example:
~/Sites/secret/doc.txt

Open the Xcode project, and build and go.

On the Xcode console you'll see a message saying:
"Started HTTP server on port 59123"

Now open your browser and type the URL:
http://localhost:59123

Notice that it displays your file without password prompt:
~/Sites/index.html

Now type the URL:
http://localhost:59123/secret/doc.txt

Notice that it prompts you for a username/password.
The sample code accepts any username, and the password is "secret".

(Replace 59123 with whatever port the server is actually running on.)

Enjoy.
18 changes: 0 additions & 18 deletions Samples/PasswdHTTPServer/LICENSE.txt

This file was deleted.

41 changes: 17 additions & 24 deletions Samples/PasswdHTTPServer/PasswdHTTPServer.xcodeproj/project.pbxproj
Expand Up @@ -63,6 +63,9 @@
DC2E30271298EF01009F096E /* DDTTYLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDTTYLogger.m; path = ../../Vendor/CocoaLumberjack/DDTTYLogger.m; sourceTree = SOURCE_ROOT; };
DC2E302E1298EF89009F096E /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
DC2E308A1298F172009F096E /* HTTPLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPLogging.h; path = ../../HTTPLogging.h; sourceTree = SOURCE_ROOT; };
DC372E56139D47B100A8407D /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
DC372E57139D47B100A8407D /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
DC372E59139D47B100A8407D /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
DC5BD61A0FC3331700DA9B03 /* DDData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDData.h; path = ../../DDData.h; sourceTree = SOURCE_ROOT; };
DC5BD61B0FC3331700DA9B03 /* DDData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DDData.m; path = ../../DDData.m; sourceTree = SOURCE_ROOT; };
DC5BD61C0FC3331700DA9B03 /* DDNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DDNumber.h; path = ../../DDNumber.h; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -159,6 +162,7 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
DC372E55139D47B100A8407D /* Xcode-Configurations */,
32CA4F630368D1EE00C91783 /* PasswdHTTPServer_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
Expand Down Expand Up @@ -199,6 +203,17 @@
name = Logging;
sourceTree = "<group>";
};
DC372E55139D47B100A8407D /* Xcode-Configurations */ = {
isa = PBXGroup;
children = (
DC372E56139D47B100A8407D /* Base.xcconfig */,
DC372E57139D47B100A8407D /* Debug.xcconfig */,
DC372E59139D47B100A8407D /* Release.xcconfig */,
);
name = "Xcode-Configurations";
path = "../Xcode-Configurations";
sourceTree = "<group>";
};
DC5BD6190FC3330400DA9B03 /* Categories */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -370,56 +385,34 @@
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = PasswdHTTPServer_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = PasswdHTTPServer;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = PasswdHTTPServer_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = PasswdHTTPServer;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DC372E57139D47B100A8407D /* Debug.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DC372E59139D47B100A8407D /* Release.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Release;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 0 additions & 31 deletions Samples/PasswdHTTPServer/ReadMe.txt

This file was deleted.

21 changes: 21 additions & 0 deletions Samples/PostHTTPServer/Instructions.txt
@@ -0,0 +1,21 @@
INFO:

This is an extremely simplified example of accepting a POST.

The included Web folder is added to the project, copied into the applications resource bundle, and set as the document root of the http server. It only has a single index.html file which prompts you to answer a simple math question. Your answer is submitted as a post.

The MyHTTPConnection class reads your response, and dynamically generates the response.

INSTRUCTIONS:

Open the Xcode project, and build and go.

On the Xcode console you'll see a message saying:
"Started HTTP server on port 59123"

Now open your browser and type in the URL:
http://localhost:59123

(Replace 59123 with whatever port the server is actually running on.)

Enjoy.
18 changes: 0 additions & 18 deletions Samples/PostHTTPServer/LICENSE.txt

This file was deleted.

0 comments on commit 56bd9ce

Please sign in to comment.