Skip to content
This repository was archived by the owner on Oct 2, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions src/ios/AssetBundleManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ protocol AssetBundleManagerDelegate: class {

final class AssetBundleManager: AssetBundleDownloaderDelegate {
let configuration: WebAppConfiguration

/// The directory used to store downloaded asset bundles
let versionsDirectoryURL: URL

Expand All @@ -20,9 +20,9 @@ final class AssetBundleManager: AssetBundleDownloaderDelegate {

private let fileManager = FileManager()
private var downloadedAssetBundlesByVersion: [String: AssetBundle]

private var session: URLSession!

private var downloadDirectoryURL: URL
private var assetBundleDownloader: AssetBundleDownloader?
private var partiallyDownloadedAssetBundle: AssetBundle?
Expand All @@ -42,17 +42,17 @@ final class AssetBundleManager: AssetBundleDownloaderDelegate {

downloadedAssetBundlesByVersion = [String: AssetBundle]()
loadDownloadedAssetBundles()

let operationQueue = OperationQueue()
operationQueue.maxConcurrentOperationCount = 1
operationQueue.underlyingQueue = queue

// We use a separate to download the manifest, so we can use caching
// (which we disable for the session we use to download the other files
// (which we disable for the session we use to download the other files
// in AssetBundleDownloader)
session = URLSession(configuration: URLSessionConfiguration.default, delegate: nil, delegateQueue: operationQueue)
}

deinit {
assetBundleDownloader?.cancel()
}
Expand Down Expand Up @@ -90,7 +90,7 @@ final class AssetBundleManager: AssetBundleDownloaderDelegate {
}

func checkForUpdatesWithBaseURL(_ baseURL: URL) {
let manifestURL = URL(string: "manifest.json", relativeTo: baseURL)!
let manifestURL = URL(string: "__meteor__/webapp/manifest.json", relativeTo: baseURL)!

NSLog("Start downloading asset manifest from: \(manifestURL)")

Expand Down Expand Up @@ -147,10 +147,10 @@ final class AssetBundleManager: AssetBundleDownloaderDelegate {
self.didFinishDownloadingAssetBundle(assetBundle)
return
}

// Else, get ready to download the new asset bundle
self.moveExistingDownloadDirectoryIfNeeded()

// Create download directory
do {
try self.fileManager.createDirectory(at: self.downloadDirectoryURL, withIntermediateDirectories: true, attributes: nil)
Expand All @@ -172,7 +172,7 @@ final class AssetBundleManager: AssetBundleDownloaderDelegate {
self.didFailWithError(error)
}
}
})
})

// If a new version is available, we want to know as soon as possible even
// if other downloads are in progress
Expand Down
13 changes: 13 additions & 0 deletions src/ios/GCDWebServer/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
Language: Cpp
BasedOnStyle: Google
Standard: Cpp11
ColumnLimit: 0
AlignTrailingComments: false
NamespaceIndentation: All
DerivePointerAlignment: false
AlwaysBreakBeforeMultilineStrings: false
AccessModifierOffset: -2
ObjCSpaceBeforeProtocolList: true
SortIncludes: false
...
Empty file modified src/ios/GCDWebServer/.gitignore
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/ios/GCDWebServer/.travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
language: objective-c
script: ./Run-Tests.sh
osx_image: xcode7.1
osx_image: xcode8.2
Empty file modified src/ios/GCDWebServer/Frameworks/GCDWebServers.h
100644 → 100755
Empty file.
Empty file modified src/ios/GCDWebServer/Frameworks/Info.plist
100644 → 100755
Empty file.
Empty file modified src/ios/GCDWebServer/Frameworks/Tests.m
100644 → 100755
Empty file.
Empty file modified src/ios/GCDWebServer/GCDWebDAVServer/GCDWebDAVServer.h
100644 → 100755
Empty file.
210 changes: 117 additions & 93 deletions src/ios/GCDWebServer/GCDWebDAVServer/GCDWebDAVServer.m
100644 → 100755

Large diffs are not rendered by default.

46 changes: 32 additions & 14 deletions src/ios/GCDWebServer/GCDWebServer.podspec
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# http://guides.cocoapods.org/making/getting-setup-with-trunk.html
# $ sudo gem update cocoapods
# (optional) $ pod trunk register {email} {name} --description={computer}
# $ pod trunk push
# $ pod trunk --verbose push
# DELETE THIS SECTION BEFORE PROCEEDING!

Pod::Spec.new do |s|
s.name = 'GCDWebServer'
s.version = '3.3.1'
s.version = '3.3.4'
s.author = { 'Pierre-Olivier Latour' => 'info@pol-online.net' }
s.license = { :type => 'BSD', :file => 'LICENSE' }
s.homepage = 'https://github.com/swisspol/GCDWebServer'
Expand All @@ -33,21 +33,39 @@ Pod::Spec.new do |s|
cs.osx.framework = 'SystemConfiguration'
end

s.subspec 'WebDAV' do |cs|
s.subspec "CocoaLumberjack" do |cs|
cs.dependency 'GCDWebServer/Core'
cs.source_files = 'GCDWebDAVServer/*.{h,m}'
cs.requires_arc = true
cs.ios.library = 'xml2'
cs.tvos.library = 'xml2'
cs.osx.library = 'xml2'
cs.compiler_flags = '-I$(SDKROOT)/usr/include/libxml2'
cs.dependency 'CocoaLumberjack', '~> 2'
end

s.subspec 'WebUploader' do |cs|
cs.dependency 'GCDWebServer/Core'
cs.source_files = 'GCDWebUploader/*.{h,m}'
cs.requires_arc = true
cs.resource = "GCDWebUploader/GCDWebUploader.bundle"
s.subspec 'WebDAV' do |cs|
cs.subspec "Core" do |ccs|
ccs.dependency 'GCDWebServer/Core'
ccs.source_files = 'GCDWebDAVServer/*.{h,m}'
ccs.requires_arc = true
ccs.ios.library = 'xml2'
ccs.tvos.library = 'xml2'
ccs.osx.library = 'xml2'
ccs.compiler_flags = '-I$(SDKROOT)/usr/include/libxml2'
end

cs.subspec "CocoaLumberjack" do |cscl|
cscl.dependency 'GCDWebServer/WebDAV/Core'
cscl.dependency 'GCDWebServer/CocoaLumberjack'
end
end

s.subspec 'WebUploader' do |cs|
cs.subspec "Core" do |ccs|
ccs.dependency 'GCDWebServer/Core'
ccs.source_files = 'GCDWebUploader/*.{h,m}'
ccs.requires_arc = true
ccs.resource = "GCDWebUploader/GCDWebUploader.bundle"
end

cs.subspec "CocoaLumberjack" do |cscl|
cscl.dependency 'GCDWebServer/WebUploader/Core'
cscl.dependency 'GCDWebServer/CocoaLumberjack'
end
end
end
35 changes: 14 additions & 21 deletions src/ios/GCDWebServer/GCDWebServer.xcodeproj/project.pbxproj
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 48;
objects = {

/* Begin PBXAggregateTarget section */
Expand Down Expand Up @@ -854,14 +854,13 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0820;
TargetAttributes = {
CEE28CD01AE004D800F4023C = {
CreatedOnToolsVersion = 6.3;
};
CEE28CEE1AE0051F00F4023C = {
CreatedOnToolsVersion = 6.3;
DevelopmentTeam = 88W3E55T4B;
};
E24039241BA09207000B7089 = {
CreatedOnToolsVersion = 6.4;
Expand All @@ -871,15 +870,14 @@
};
E2DDD1C61BE698A8002CE867 = {
CreatedOnToolsVersion = 7.1;
DevelopmentTeam = 88W3E55T4B;
};
E2DDD1F51BE69EE4002CE867 = {
CreatedOnToolsVersion = 7.1;
};
};
};
buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "GCDWebServer" */;
compatibilityVersion = "Xcode 3.2";
compatibilityVersion = "Xcode 8.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -1208,7 +1206,7 @@
1DEB928A08733DD80010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_VERSION_STRING = 3.3.1;
BUNDLE_VERSION_STRING = 3.3.4;
CLANG_ENABLE_OBJC_ARC = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -1238,14 +1236,15 @@
"-Wno-reserved-id-macro",
"-Wno-cast-qual",
"-Wno-nullable-to-nonnull-conversion",
"-Wno-partial-availability",
);
};
name = Debug;
};
1DEB928B08733DD80010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_VERSION_STRING = 3.3.1;
BUNDLE_VERSION_STRING = 3.3.4;
CLANG_ENABLE_OBJC_ARC = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = __GCDWEBSERVER_ENABLE_TESTING__;
Expand All @@ -1268,6 +1267,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_NAME = GCDWebServers;
SDKROOT = macosx;
SKIP_INSTALL = YES;
};
name = Debug;
};
Expand All @@ -1283,13 +1283,13 @@
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_NAME = GCDWebServers;
SDKROOT = macosx;
SKIP_INSTALL = YES;
};
name = Release;
};
CEE28D031AE0052000F4023C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -1298,15 +1298,14 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = GCDWebServers;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Debug;
};
CEE28D041AE0052000F4023C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -1315,8 +1314,8 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = GCDWebServers;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
};
name = Release;
};
Expand Down Expand Up @@ -1373,41 +1372,38 @@
E2DDD1901BE69404002CE867 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Frameworks/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = GCDWebServers;
PROVISIONING_PROFILE = "";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
};
E2DDD1911BE69404002CE867 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Frameworks/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = GCDWebServers;
PROVISIONING_PROFILE = "";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Release;
};
E2DDD1D91BE698A8002CE867 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = tvOS/Info.plist;
PRODUCT_NAME = GCDWebServer;
PROVISIONING_PROFILE = "";
Expand All @@ -1419,7 +1415,6 @@
E2DDD1DA1BE698A8002CE867 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = tvOS/Info.plist;
PRODUCT_NAME = GCDWebServer;
PROVISIONING_PROFILE = "";
Expand All @@ -1431,10 +1426,9 @@
E2DDD20B1BE69EE5002CE867 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
ENABLE_BITCODE = YES;
INFOPLIST_FILE = iOS/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = GCDWebServer;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
Expand All @@ -1445,10 +1439,9 @@
E2DDD20C1BE69EE5002CE867 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
ENABLE_BITCODE = YES;
INFOPLIST_FILE = iOS/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = GCDWebServer;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -50,7 +50,6 @@
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
enableAddressSanitizer = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
Expand All @@ -63,11 +62,6 @@
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
<AdditionalOption
key = "NSZombieEnabled"
value = "YES"
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
Expand Down
Loading