Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #160 from pvzig/examples
Browse files Browse the repository at this point in the history
Support CocoaPods and Carthage for examples
  • Loading branch information
pvzig committed Apr 6, 2019
2 parents cc20c54 + ead9bb9 commit 6c1612f
Show file tree
Hide file tree
Showing 18 changed files with 674 additions and 31 deletions.
1 change: 1 addition & 0 deletions Examples/Leaderboard/Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "pvzig/SlackKit"
275 changes: 275 additions & 0 deletions Examples/Leaderboard/Leaderboard.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
262F50452259146E00A74EB1 /* Leaderbot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262F50432259146E00A74EB1 /* Leaderbot.swift */; };
262F50462259146E00A74EB1 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 262F50442259146E00A74EB1 /* main.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
262F50312259139400A74EB1 /* Leaderboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Leaderboard.app; sourceTree = BUILT_PRODUCTS_DIR; };
262F50362259139400A74EB1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
262F50432259146E00A74EB1 /* Leaderbot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Leaderbot.swift; path = Sources/Leaderbot.swift; sourceTree = "<group>"; };
262F50442259146E00A74EB1 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = main.swift; path = Sources/main.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
262F502F2259139400A74EB1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
262F50292259139400A74EB1 = {
isa = PBXGroup;
children = (
262F50332259139400A74EB1 /* Leaderboard */,
262F50322259139400A74EB1 /* Products */,
665E45E1CAEDB17C0745AD28 /* Pods */,
);
sourceTree = "<group>";
};
262F50322259139400A74EB1 /* Products */ = {
isa = PBXGroup;
children = (
262F50312259139400A74EB1 /* Leaderboard.app */,
);
name = Products;
sourceTree = "<group>";
};
262F50332259139400A74EB1 /* Leaderboard */ = {
isa = PBXGroup;
children = (
262F50432259146E00A74EB1 /* Leaderbot.swift */,
262F50442259146E00A74EB1 /* main.swift */,
262F50362259139400A74EB1 /* Info.plist */,
);
path = Leaderboard;
sourceTree = "<group>";
};
665E45E1CAEDB17C0745AD28 /* Pods */ = {
isa = PBXGroup;
children = (
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
262F50302259139400A74EB1 /* Leaderboard */ = {
isa = PBXNativeTarget;
buildConfigurationList = 262F50392259139400A74EB1 /* Build configuration list for PBXNativeTarget "Leaderboard" */;
buildPhases = (
262F502E2259139400A74EB1 /* Sources */,
262F502F2259139400A74EB1 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Leaderboard;
productName = Leaderboard;
productReference = 262F50312259139400A74EB1 /* Leaderboard.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
262F502A2259139400A74EB1 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Peter Zignego";
TargetAttributes = {
262F50302259139400A74EB1 = {
CreatedOnToolsVersion = 10.2;
LastSwiftMigration = 1020;
};
};
};
buildConfigurationList = 262F502D2259139400A74EB1 /* Build configuration list for PBXProject "Leaderboard" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 262F50292259139400A74EB1;
productRefGroup = 262F50322259139400A74EB1 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
262F50302259139400A74EB1 /* Leaderboard */,
);
};
/* End PBXProject section */

/* Begin PBXSourcesBuildPhase section */
262F502E2259139400A74EB1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
262F50462259146E00A74EB1 /* main.swift in Sources */,
262F50452259146E00A74EB1 /* Leaderbot.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
262F50372259139400A74EB1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
262F50382259139400A74EB1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
name = Release;
};
262F503A2259139400A74EB1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/Carthage/Build/Mac\"";
INFOPLIST_FILE = Leaderboard/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.Leaderboard;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
262F503B2259139400A74EB1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/Carthage/Build/Mac\"";
INFOPLIST_FILE = Leaderboard/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.Leaderboard;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
262F502D2259139400A74EB1 /* Build configuration list for PBXProject "Leaderboard" */ = {
isa = XCConfigurationList;
buildConfigurations = (
262F50372259139400A74EB1 /* Debug */,
262F50382259139400A74EB1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
262F50392259139400A74EB1 /* Build configuration list for PBXNativeTarget "Leaderboard" */ = {
isa = XCConfigurationList;
buildConfigurations = (
262F503A2259139400A74EB1 /* Debug */,
262F503B2259139400A74EB1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 262F502A2259139400A74EB1 /* Project object */;
}

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
28 changes: 28 additions & 0 deletions Examples/Leaderboard/Leaderboard/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Peter Zignego. All rights reserved.</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Leaderboard.swift
//
// Copyright © 2017 Peter Zignego. All rights reserved.
// Copyright © 2019 Peter Zignego. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -100,7 +100,7 @@ class Leaderbot {
let thingRegex = try? NSRegularExpression(pattern: expression, options: [])
let things = thingRegex?.matches(in: text, options: [], range: NSMakeRange(0, text.utf16.count)) ?? []
for match in things {
let value = text.substring(with: text.range(from: match.range(at: 1))!)
let value = String(text[text.range(from: match.range(at: 1))!])
if leaderboards[teamID]?.scores[value] == nil { leaderboards[teamID]?.scores[value] = 0 }
switch trigger {
case .plusPlus:
Expand Down
6 changes: 3 additions & 3 deletions Examples/Leaderboard/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ let package = Package(
.executable(name: "Leaderboard", targets: ["Leaderboard"]),
],
dependencies: [
.package(url: "https://github.com/SlackKit/SlackKit", .upToNextMajor(from: "4.0.0"))
.package(url: "https://github.com/pvzig/SlackKit", .upToNextMinor(from: "4.3.0"))
],
targets: [
.target(name: "Leaderboard",
dependencies: ["SlackKit"],
path: "Sources")
dependencies: ["SlackKit"],
path: "Leaderboard/Sources")
]
)
6 changes: 6 additions & 0 deletions Examples/Leaderboard/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
platform :osx, '10.11'

target 'Leaderboard' do
use_frameworks!
pod 'SlackKit', '>= 4.3.0'
end
1 change: 1 addition & 0 deletions Examples/Robot or Not Bot/Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "pvzig/SlackKit"
4 changes: 2 additions & 2 deletions Examples/Robot or Not Bot/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ let package = Package(
.executable(name: "Robot or Not Bot", targets: ["Robot or Not Bot"]),
],
dependencies: [
.package(url: "https://github.com/SlackKit/SlackKit", .upToNextMajor(from: "4.0.0"))
.package(url: "https://github.com/pvzig/SlackKit", .upToNextMinor(from: "4.3.0"))
],
targets: [
.target(name: "Robot or Not Bot",
dependencies: ["SlackKit"],
path: "Sources")
path: "Robot or Not Bot/Sources")
]
)
7 changes: 7 additions & 0 deletions Examples/Robot or Not Bot/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
platform :osx, '10.11'

target 'Robot Or Not Bot' do
use_frameworks!
pod 'SlackKit', '>= 4.3.0'
end

Loading

0 comments on commit 6c1612f

Please sign in to comment.