Skip to content

Commit 92ec8c8

Browse files
authored
Merge pull request #28 from hishd/refactor/spm
Refactor app target dependencies and tests
2 parents 37f8111 + dd01d8e commit 92ec8c8

File tree

7 files changed

+11
-149
lines changed

7 files changed

+11
-149
lines changed

SkyWizard-SwiftUI.xcodeproj/project.pbxproj

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
FD8574882CD9D040003D9D29 /* SubTemperatureView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD8574872CD9D040003D9D29 /* SubTemperatureView.swift */; };
4848
FD949A402CDC8C3B00F8CF48 /* WeatherService+Dependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD949A3F2CDC8C3B00F8CF48 /* WeatherService+Dependencies.swift */; };
4949
FD949A422CDC8DD800F8CF48 /* Application.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD949A412CDC8DD800F8CF48 /* Application.swift */; };
50-
FD949A5C2CDC935E00F8CF48 /* WeatherServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD949A5B2CDC935E00F8CF48 /* WeatherServiceTests.swift */; };
5150
FD949A692CDCA44300F8CF48 /* GeocodingService+Dependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD949A682CDCA44300F8CF48 /* GeocodingService+Dependencies.swift */; };
52-
FD949A6B2CDCA54500F8CF48 /* GeocodingServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD949A6A2CDCA54500F8CF48 /* GeocodingServiceTests.swift */; };
5351
FD949A712CDD4E0F00F8CF48 /* DataTransferService+Dependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD949A702CDD4E0F00F8CF48 /* DataTransferService+Dependencies.swift */; };
5452
FD949A742CDD614300F8CF48 /* WeatherDataStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD949A732CDD614300F8CF48 /* WeatherDataStore.swift */; };
5553
FD949A762CDD66D000F8CF48 /* View+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD949A752CDD66D000F8CF48 /* View+Extensions.swift */; };
@@ -62,7 +60,6 @@
6260
FDB65E732CDC030300E4A52E /* wizard_house.scn in Resources */ = {isa = PBXBuildFile; fileRef = FDB65E722CDC030300E4A52E /* wizard_house.scn */; };
6361
FDB65E762CDC033C00E4A52E /* HouseViewRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB65E752CDC033C00E4A52E /* HouseViewRepresentable.swift */; };
6462
FDB65E782CDC28D400E4A52E /* IsVisibleModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB65E772CDC28D400E4A52E /* IsVisibleModifier.swift */; };
65-
FDB65E7B2CDC4F2600E4A52E /* NetworkingService in Frameworks */ = {isa = PBXBuildFile; productRef = FDB65E7A2CDC4F2600E4A52E /* NetworkingService */; };
6663
FDB65E7E2CDC4F4E00E4A52E /* DependencyInjector in Frameworks */ = {isa = PBXBuildFile; productRef = FDB65E7D2CDC4F4E00E4A52E /* DependencyInjector */; };
6764
FDE0B9662CD8082200017A6B /* SheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDE0B9652CD8082200017A6B /* SheetView.swift */; };
6865
FDF41DEB2CE37AC8000C4FB4 /* OSLog+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDF41DEA2CE37AC8000C4FB4 /* OSLog+Extensions.swift */; };
@@ -106,7 +103,7 @@
106103
FD4B928F2CF0AA0000EA05E7 /* rain_fall.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = rain_fall.sks; sourceTree = "<group>"; };
107104
FD4B92922CF0AAD600EA05E7 /* snow_fall.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = snow_fall.sks; sourceTree = "<group>"; };
108105
FD4B92942CF0B4E100EA05E7 /* night_cloudy.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = night_cloudy.json; sourceTree = "<group>"; };
109-
FD4B92982CF0E07000EA05E7 /* SkyWizard-SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SkyWizard-SwiftUI.app"; sourceTree = BUILT_PRODUCTS_DIR; };
106+
FD4B92982CF0E07000EA05E7 /* SkyWizard-SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = "SkyWizard-SwiftUI.app"; path = "/Users/hishd/Desktop/Development/PROJECTS/SkyWizard-SwiftUI/build/Debug-iphoneos/SkyWizard-SwiftUI.app"; sourceTree = "<absolute>"; };
110107
FD73C1AF2CD89EE4004DA8A7 /* DailyWeatherView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DailyWeatherView.swift; sourceTree = "<group>"; };
111108
FD8574692CD9C690003D9D29 /* cloudy.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = cloudy.json; sourceTree = "<group>"; };
112109
FD85746A2CD9C690003D9D29 /* cloudy_sun.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = cloudy_sun.json; sourceTree = "<group>"; };
@@ -121,10 +118,7 @@
121118
FD8574872CD9D040003D9D29 /* SubTemperatureView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubTemperatureView.swift; sourceTree = "<group>"; };
122119
FD949A3F2CDC8C3B00F8CF48 /* WeatherService+Dependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WeatherService+Dependencies.swift"; sourceTree = "<group>"; };
123120
FD949A412CDC8DD800F8CF48 /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = "<group>"; };
124-
FD949A4D2CDC916900F8CF48 /* SkyWizard-SwiftUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = "SkyWizard-SwiftUITests.xctest"; path = "/Users/hishd/Desktop/Development/SwiftUI/SkyWizard-SwiftUI/build/Debug-iphoneos/SkyWizard-SwiftUI.app/PlugIns/SkyWizard-SwiftUITests.xctest"; sourceTree = "<absolute>"; };
125-
FD949A5B2CDC935E00F8CF48 /* WeatherServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherServiceTests.swift; sourceTree = "<group>"; };
126121
FD949A682CDCA44300F8CF48 /* GeocodingService+Dependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "GeocodingService+Dependencies.swift"; sourceTree = "<group>"; };
127-
FD949A6A2CDCA54500F8CF48 /* GeocodingServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeocodingServiceTests.swift; sourceTree = "<group>"; };
128122
FD949A702CDD4E0F00F8CF48 /* DataTransferService+Dependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DataTransferService+Dependencies.swift"; sourceTree = "<group>"; };
129123
FD949A732CDD614300F8CF48 /* WeatherDataStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherDataStore.swift; sourceTree = "<group>"; };
130124
FD949A752CDD66D000F8CF48 /* View+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Extensions.swift"; sourceTree = "<group>"; };
@@ -137,6 +131,7 @@
137131
FDB65E722CDC030300E4A52E /* wizard_house.scn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = wizard_house.scn; sourceTree = "<group>"; };
138132
FDB65E752CDC033C00E4A52E /* HouseViewRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HouseViewRepresentable.swift; sourceTree = "<group>"; };
139133
FDB65E772CDC28D400E4A52E /* IsVisibleModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IsVisibleModifier.swift; sourceTree = "<group>"; };
134+
FDD1E81D2D21F0BF00B9A1EF /* SkyWizard-SwiftUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = "SkyWizard-SwiftUITests.xctest"; path = "/Users/hishd/Desktop/Development/PROJECTS/SkyWizard-SwiftUI/build/Debug-iphoneos/SkyWizard-SwiftUI.app/PlugIns/SkyWizard-SwiftUITests.xctest"; sourceTree = "<absolute>"; };
140135
FDE0B9652CD8082200017A6B /* SheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetView.swift; sourceTree = "<group>"; };
141136
FDF41DEA2CE37AC8000C4FB4 /* OSLog+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OSLog+Extensions.swift"; sourceTree = "<group>"; };
142137
FDF41DEC2CE386E5000C4FB4 /* WeatherDataStore+Dependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WeatherDataStore+Dependencies.swift"; sourceTree = "<group>"; };
@@ -149,7 +144,6 @@
149144
isa = PBXFrameworksBuildPhase;
150145
buildActionMask = 2147483647;
151146
files = (
152-
FDB65E7B2CDC4F2600E4A52E /* NetworkingService in Frameworks */,
153147
FD8574672CD9C572003D9D29 /* Lottie in Frameworks */,
154148
FD4B92882CF0A84300EA05E7 /* SkyWizardModel in Frameworks */,
155149
FD4B92862CF0A84300EA05E7 /* SkyWizardEnum in Frameworks */,
@@ -225,7 +219,6 @@
225219
FD32A9F02CB4484D002B8706 /* SkyWizard-SwiftUI */,
226220
FD949A572CDC917200F8CF48 /* SkyWizard-SwiftUITests */,
227221
FD4B92832CF0A82C00EA05E7 /* SkyWizardAPI */,
228-
FD4B92982CF0E07000EA05E7 /* SkyWizard-SwiftUI.app */,
229222
);
230223
sourceTree = "<group>";
231224
};
@@ -378,28 +371,10 @@
378371
FD949A572CDC917200F8CF48 /* SkyWizard-SwiftUITests */ = {
379372
isa = PBXGroup;
380373
children = (
381-
FD949A5A2CDC91DF00F8CF48 /* Geocoding Service */,
382-
FD949A592CDC91D700F8CF48 /* Weather Service */,
383374
);
384375
path = "SkyWizard-SwiftUITests";
385376
sourceTree = "<group>";
386377
};
387-
FD949A592CDC91D700F8CF48 /* Weather Service */ = {
388-
isa = PBXGroup;
389-
children = (
390-
FD949A5B2CDC935E00F8CF48 /* WeatherServiceTests.swift */,
391-
);
392-
path = "Weather Service";
393-
sourceTree = "<group>";
394-
};
395-
FD949A5A2CDC91DF00F8CF48 /* Geocoding Service */ = {
396-
isa = PBXGroup;
397-
children = (
398-
FD949A6A2CDCA54500F8CF48 /* GeocodingServiceTests.swift */,
399-
);
400-
path = "Geocoding Service";
401-
sourceTree = "<group>";
402-
};
403378
FD949A722CDD613800F8CF48 /* Datastores */ = {
404379
isa = PBXGroup;
405380
children = (
@@ -467,7 +442,6 @@
467442
name = "SkyWizard-SwiftUI";
468443
packageProductDependencies = (
469444
FD8574662CD9C572003D9D29 /* Lottie */,
470-
FDB65E7A2CDC4F2600E4A52E /* NetworkingService */,
471445
FDB65E7D2CDC4F4E00E4A52E /* DependencyInjector */,
472446
FD4B92852CF0A84300EA05E7 /* SkyWizardEnum */,
473447
FD4B92872CF0A84300EA05E7 /* SkyWizardModel */,
@@ -494,7 +468,7 @@
494468
packageProductDependencies = (
495469
);
496470
productName = "SkyWizard-SwiftUITests";
497-
productReference = FD949A4D2CDC916900F8CF48 /* SkyWizard-SwiftUITests.xctest */;
471+
productReference = FDD1E81D2D21F0BF00B9A1EF /* SkyWizard-SwiftUITests.xctest */;
498472
productType = "com.apple.product-type.bundle.unit-test";
499473
};
500474
/* End PBXNativeTarget section */
@@ -527,7 +501,6 @@
527501
minimizedProjectReferenceProxies = 1;
528502
packageReferences = (
529503
FD8574652CD9C572003D9D29 /* XCRemoteSwiftPackageReference "lottie-spm" */,
530-
FDB65E792CDC4F2600E4A52E /* XCRemoteSwiftPackageReference "NetworkingService" */,
531504
FDB65E7C2CDC4F4E00E4A52E /* XCRemoteSwiftPackageReference "DependencyInjector" */,
532505
);
533506
preferredProjectObjectVersion = 77;
@@ -624,8 +597,6 @@
624597
isa = PBXSourcesBuildPhase;
625598
buildActionMask = 2147483647;
626599
files = (
627-
FD949A5C2CDC935E00F8CF48 /* WeatherServiceTests.swift in Sources */,
628-
FD949A6B2CDCA54500F8CF48 /* GeocodingServiceTests.swift in Sources */,
629600
);
630601
runOnlyForDeploymentPostprocessing = 0;
631602
};
@@ -908,14 +879,6 @@
908879
minimumVersion = 4.5.0;
909880
};
910881
};
911-
FDB65E792CDC4F2600E4A52E /* XCRemoteSwiftPackageReference "NetworkingService" */ = {
912-
isa = XCRemoteSwiftPackageReference;
913-
repositoryURL = "https://github.com/hishd/NetworkingService";
914-
requirement = {
915-
kind = upToNextMajorVersion;
916-
minimumVersion = 1.0.4;
917-
};
918-
};
919882
FDB65E7C2CDC4F4E00E4A52E /* XCRemoteSwiftPackageReference "DependencyInjector" */ = {
920883
isa = XCRemoteSwiftPackageReference;
921884
repositoryURL = "https://github.com/hishd/DependencyInjector";
@@ -944,11 +907,6 @@
944907
package = FD8574652CD9C572003D9D29 /* XCRemoteSwiftPackageReference "lottie-spm" */;
945908
productName = Lottie;
946909
};
947-
FDB65E7A2CDC4F2600E4A52E /* NetworkingService */ = {
948-
isa = XCSwiftPackageProductDependency;
949-
package = FDB65E792CDC4F2600E4A52E /* XCRemoteSwiftPackageReference "NetworkingService" */;
950-
productName = NetworkingService;
951-
};
952910
FDB65E7D2CDC4F4E00E4A52E /* DependencyInjector */ = {
953911
isa = XCSwiftPackageProductDependency;
954912
package = FDB65E7C2CDC4F4E00E4A52E /* XCRemoteSwiftPackageReference "DependencyInjector" */;

SkyWizard-SwiftUI.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SkyWizard-SwiftUITests/Geocoding Service/GeocodingServiceTests.swift

Lines changed: 0 additions & 31 deletions
This file was deleted.

SkyWizard-SwiftUITests/Weather Service/WeatherServiceTests.swift

Lines changed: 0 additions & 65 deletions
This file was deleted.

SkyWizardAPI/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let package = Package(
2525
)
2626
],
2727
dependencies: [
28-
.package(url: "https://github.com/hishd/NetworkingService", .upToNextMajor(from: "1.0.4")),
28+
.package(url: "https://github.com/hishd/NetworkingService", .upToNextMajor(from: "1.0.7")),
2929
],
3030
targets: [
3131
// Targets are the basic building blocks of a package, defining a module or a test suite.

SkyWizardAPI/Sources/SkyWizardService/Geocoding/GeocodingServiceRemote.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public final class GeocodingServiceRemote: GeocodingService {
2323
//Checking task cancellation
2424
try Task.checkCancellation()
2525

26-
let task = await dataTransferService.request(with: GeocodingEndpoints.getGeocoding(latitude: location.latitude, longitude: location.longitude))
27-
let value: GeocodeData = try await task.value.mapToGeocodeResult()
26+
let result: GeocodeResultDTO = try await dataTransferService.request(with: GeocodingEndpoints.getGeocoding(latitude: location.latitude, longitude: location.longitude))
27+
let value: GeocodeData = try result.mapToGeocodeResult()
2828
return value
2929
}
3030
}

SkyWizardAPI/Sources/SkyWizardService/Weather/WeatherServiceRemote.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public final class WeatherServiceRemote: WeatherService {
2222
//Checking task cancellation
2323
try Task.checkCancellation()
2424

25-
let task = await dataTransferService.request(with: WeatherEndpoints.getWeather(latitude: location.latitude, longitude: location.longitude))
26-
return try await task.value
25+
let result: WeatherData = try await dataTransferService.request(with: WeatherEndpoints.getWeather(latitude: location.latitude, longitude: location.longitude))
26+
return result
2727
}
2828

2929
public func getWeatherType(for current: WeatherData.CurrentWeatherData) -> CurrentWeatherType {

0 commit comments

Comments
 (0)