Repository navigation
Expand file tree
/
Copy pathgenerateMockoloMocks.sh
More file actions
executable file
·110 lines (94 loc) · 4.13 KB
/
Copy pathgenerateMockoloMocks.sh
File metadata and controls
executable file
·110 lines (94 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
# Script to generate mocks using Mockolo
# Usage: ./generateMockoloMocks.sh
set -e
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd "${DIR}"
# Check if mockolo is installed
if ! which mockolo >/dev/null; then
echo "Error: mockolo is not installed"
echo "Install it with: brew install mockolo"
exit 1
fi
echo "Generating mocks with Mockolo..."
# Core module
echo "Generating Core mocks..."
mockolo \
--sourcedirs "Core/Core" \
--destination "Core/CoreTests/Generated/CoreMocks.generated.swift" \
--mock-final \
--testable-imports "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation" "Alamofire" "CoreData" "ZipArchive"
# Authorization module (includes Core sources for shared protocols like AuthInteractorProtocol)
echo "Generating Authorization mocks..."
mockolo \
--sourcedirs "Authorization/Authorization" "Core/Core" \
--destination "Authorization/AuthorizationTests/Generated/AuthorizationMocks.generated.swift" \
--mock-final \
--testable-imports "Authorization" "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation" "Alamofire" "CoreData"
# Course module (includes Core sources for shared protocols)
echo "Generating Course mocks..."
mockolo \
--sourcedirs "Course/Course" "Core/Core" \
--destination "Course/CourseTests/Generated/CourseMocks.generated.swift" \
--mock-final \
--testable-imports "Course" "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation" "Alamofire" "CoreData"
# WhatsNew module
echo "Generating WhatsNew mocks..."
mockolo \
--sourcedirs "WhatsNew/WhatsNew" \
--destination "WhatsNew/WhatsNewTests/Generated/WhatsNewMocks.generated.swift" \
--mock-final \
--testable-imports "WhatsNew" \
--custom-imports "Foundation"
# Discovery module (includes Core sources for shared protocols)
echo "Generating Discovery mocks..."
mockolo \
--sourcedirs "Discovery/Discovery" "Core/Core" \
--destination "Discovery/DiscoveryTests/Generated/DiscoveryMocks.generated.swift" \
--mock-final \
--testable-imports "Discovery" "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation" "Alamofire" "CoreData"
# Dashboard module (includes Core sources for shared protocols)
echo "Generating Dashboard mocks..."
mockolo \
--sourcedirs "Dashboard/Dashboard" "Core/Core" \
--destination "Dashboard/DashboardTests/Generated/DashboardMocks.generated.swift" \
--mock-final \
--testable-imports "Dashboard" "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation"
# Downloads module (includes Core sources for shared protocols)
echo "Generating Downloads mocks..."
mockolo \
--sourcedirs "Downloads/Downloads" "Core/Core" \
--destination "Downloads/DownloadsTests/Generated/DownloadsMocks.generated.swift" \
--mock-final \
--testable-imports "Downloads" "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation"
# Profile module (includes Core sources for shared protocols)
echo "Generating Profile mocks..."
mockolo \
--sourcedirs "Profile/Profile" "Core/Core" \
--destination "Profile/ProfileTests/Generated/ProfileMocks.generated.swift" \
--mock-final \
--testable-imports "Profile" "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation" "Alamofire"
# Discussion module (includes Core sources for shared protocols)
echo "Generating Discussion mocks..."
mockolo \
--sourcedirs "Discussion/Discussion" "Core/Core" \
--destination "Discussion/DiscussionTests/Generated/DiscussionMocks.generated.swift" \
--mock-final \
--testable-imports "Discussion" "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation" "Alamofire"
# AppDates module (includes Core sources for shared protocols)
echo "Generating AppDates mocks..."
mockolo \
--sourcedirs "AppDates/AppDates" "Core/Core" \
--destination "AppDates/AppDatesTests/Generated/AppDatesMocks.generated.swift" \
--mock-final \
--testable-imports "AppDates" "Core" \
--custom-imports "Foundation" "SwiftUI" "Combine" "OEXFoundation"
echo "Done! All mocks generated successfully."