Commit c062a59
Move model files from apps targets to WordPressData (#24378)
* Configure `Package.swift` with WordPressData framework deps
* Add `WordPress-Swift.h` to WordPressData to work around build fail
* Add prefix header
* Add all required sources to WordPressData
* Add required imports to Swift layer
* Extract `defaultWordPressComAccountRestAPI` method to WordPressData
Only the method, not the rest of the extension to avoid dependencies
galore.
* Add `Blog+SelfHosted` to WordPressData, including dependencies
* Hack `ContextManager.swift` to compile
* Replicate Keystone preprocessor macro hack for WordPressData-Swift.h
* Add `Media+Blog.swift` to WordPressData to compile `PostHelper.m`
* Add `RemotePost+Metadata` source to WordPressData for `PostHelper.m`
* Add `PostServiceRemoteFactory` to WordPressData to fix `PostService.m`
* Add `PostHelper+JetpackSocial` to WordPressData to fix `PostHelper.m`
* Add `WordPressOrgRestApi+WordPress` to WordPressData
Made possible by
#24351
* Add `.m` file in WordPressData only to config CocoaLumberJack
* Add some `import CocoaLumberJackSwift` required by WordPressData
* Use `_private_wordPressComRestApi` in `Blog+WordPressComRestAPI.swift` to build WordPressData
* Add CocoaLumberjack as a dependency to the extensions to fix compilation
Otherwise, we'd get:
```
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_DDLog", referenced from:
in AppExtensionsService.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
* Remove `WordPress-Swift.h` hack from WordPressData
* Add `Blog+Lookup` to WordPressData
* Add `WordPress.xcdatamodeld` to WordPressData
* Duplicate test infra in WordPressData in order to run `BlogTests`
* Remove unnecessary `CocoaLumberJackConfiguration.h` header
We don't need the header, the implementation file is enough for the
CocoaLumberJack shenanigans to take place.
* Remove WordPressData types from WordPress and Jetpack
Not Keystone yet because I don't know if that compiles okay to verify
the change.
* Update imports after removing WordPressData files from WP and Jetpack
* Disambiguate `Notification` usages — `/: Notification\)/`
* Disambiguate `Notification` usages — `/: Notification$/`
* Disambiguate `Notification` usages — `/, Notification(?!s)/`
* Disambiguate `Notification` usages — `/as\? Notification/`
* Disambiguate `Notification` usages — `/ Notification \{/`
* Disambiguate `Notification` usages — `/ Notification\?/`
* Disambiguate `Notification` usages — `/ Notification,$/`
* Disambiguate `Notification` usages — `/\[Notification\]/`
* Disambiguate `Notification` usages — `/ Notification\:/`
* Disambiguate `Notification` usages — `/: Notification,/`
* Disambiguate `Notification` usages — `/\(Notification\)/`
* Disambiguate `Notification` usages — `/Notification else/`
* Disambiguate `Notification` usages — `/Notification\!/`
* Disambiguate `Notification` usages — `/as\? Notification/`
* Add CocoaLumberjack to notification service extensions
* Update imports after `Notification` disambiguation
* Replace all `#import` of headers now in WordPressData with `@import WordPressData`
* Work around (temporarily?!) a build failure after the WordPressData move
* Remove unused `AccountService` import from `Blog.m`
It matters because once `Blog` is in WordPressData, `AccountService`
will no longer be available.
* Move some `MenuItem` imports from `.h` to `.m`
`MenuItem` was not used in the interface. Moving the import in the
implementation will make it cleaner to update once WordPressData is
integrated.
* Remove WordPressData types from `WordPress-Bridging-Header.h`
* Address module verifier warnings in WordPressData
* Extract Swift-dependant logic from `Theme`
* Make `Media` extension `public`
* Remove unused WordPressData import from NotificationServiceExtension
* Add CocoaLumberjack to extensions Jetpack uses to avoid compile failure
Undefined symbol: _OBJC_CLASS_$_DDLog
* Make WordPressData Swift API available to ObjC framework consumers
* Add `testable import WordPressData` to unit tests
* Update `WordPress.Notification` to `WordPressData.Notification` in tests
* Add more required `@testable import WordPressData`
Via
```
find WordPress/WordPressTest \
-name "*.swift" \
-type f \
-exec perl -i -0pe 's/(@testable import WordPress\n)(\nclass (\w+): CoreDataTestCase \{)/\1\@testable import WordPressData\n\nclass \3: CoreDataTestCase {/g' \
{} \;
```
and
```
find WordPress/WordPressTest \
-name "*.swift" \
-type f \
-exec perl -i -0pe 's/(@testable import WordPress\n)(\nfinal class (\w+): CoreDataTestCase \{)/\1\@testable import WordPressData\n\nfinal class \3: CoreDataTestCase {/g' \
{} \;
```
* Add WordPressData as a WordPressTests dependency
* Add missing dependencies to WordPressTesting post WordPressData addition
* Load model from the `ContextManager` bundle in the unit tests
* Replace `AppEnvironment` with `WordPressComRestApi.apiBaseURL` in RestAPI
Same rationale as 09990b8
* No longer access `_private_wordPressComRestApi` in `Blog`
* Fix WordPressData linkage in Keystone and move sources
* Update access of types required by Keystone for WordPressData link
* Explicitly add WebKit as a Keystone dependency
Triggered by a few errors like
```
In file included from /Users/gio/Developer/a8c/wpios/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.m:3:
/Users/gio/Developer/a8c/wpios/DerivedData/WordPress/Build/Intermediates.noindex/WordPress.build/Debug-iphonesimulator/Keystone.build/DerivedSources/Keystone-Swift.h:295:9: fatal error: module 'WebKit' not found
295 | @import WebKit;
| ~~~~~~~^~~~~~
```
which I got after linking WordPressData against Keystone and moving all
the sources there.
* Revert `CookieJar` `public` access level
Apparently unnecessary, see
#24420 (comment)
* REVERT ME - Only run WordPress tests
* Switch all models to use "Global Namespace"
Via
```
sed -i '' -E 's/representedClassName="(WordPress)?(\.)?([^"]+)"/representedClassName=".\3"/g' \
Sources/WordPressData/Resources/WordPress.xcdatamodeld/WordPress\ 155.xcdatamodel/contents
```
which switched to "Current Product Module" but resulted in unit tests
failure in WordPressData, followed by
```
➜ sed -i '' -E 's/representedClassName="\.([^"]+)"/representedClassName="\1"/g' \
Sources/WordPressData/Resources/WordPress.xcdatamodeld/WordPress\ 155.xcdatamodel/contents
```
* Replace all string values passed to `forEntityName` with `entityName()`
Done via
```
find . \
\( -path './DerivedData' -o -path './.git' -o -path './vendor' \) \
-prune -o -type f -name "*.swift" \
-exec sed -i '' -E 's/forEntityName: "([A-Za-z_][A-Za-z0-9_]*)"/forEntityName: \1.entityName()/g' {} +
```
* Replace all `NSStringFromClass` values passed to `forEntityName`
Done via
```
find . \
\( -path './DerivedData' -o -path './.git' -o -path './vendor' \) \
-prune -o -type f -name "*.swift" \
-exec sed -i '' -E 's/forEntityName: NSStringFromClass\(([A-Za-z_][A-Za-z0-9_]*)\.self\)/forEntityName: \1.entityName()/g' {} +
```
The goal is to have a single way to get the entity name so we can adapt
it to the new WordPressData setup in one go.
* Replace all `Self.classNameWithoutNamespaces()` with `entityName()`
The goal is to have a single way to get the entity name so we can adapt
it to the new WordPressData setup in one go.
* Replace all `classNameWithoutNamespace()` calls with `entityName()`
Done via
```
find . \( -path './DerivedData' -o -path './.git' -o -path './vendor' \) \
-prune -o -type f -name "*.swift" \
-exec sed -i '' -E 's/forEntityName: ([A-Za-z_][A-Za-z0-9_]*)\.classNameWithoutNamespaces\(\)/forEntityName: \1.entityName()/g' {} +
```
The goal is to have a single way to get the entity name so we can adapt
it to the new WordPressData setup in one go.
* Fix WordPressData runtime issues (#24494)
* Move remaining types to WordPressData
* Use Current Module for Swift-only types
* Fix ReaderTeamTopic compilation
* Add missing class names
* Remove unused SiteInfo
* Add Bundle.wordPressData and update DataMigratorTests
* Update CoreDataMigrationTests
* Fix unit tests (AppEnvironment required)
* Add `BlobEntity` to WordPressData
* Address straightforward `FIXME` notes
---------
Co-authored-by: Alex Grebenyuk <[email protected]>1 parent 0112a1d commit c062a59
File tree
592 files changed
+1660
-588
lines changed- Modules
- Sources/XcodeSupport/XcodeTarget_WordPressData
- Sources
- Keystone
- WordPressData
- Objective-C
- include
- Resources/WordPress.xcdatamodeld
- WordPress 10.xcdatamodel
- WordPress 100.xcdatamodel
- WordPress 101.xcdatamodel
- WordPress 102.xcdatamodel
- WordPress 103.xcdatamodel
- WordPress 104.xcdatamodel
- WordPress 105.xcdatamodel
- WordPress 106.xcdatamodel
- WordPress 107.xcdatamodel
- WordPress 108.xcdatamodel
- WordPress 109.xcdatamodel
- WordPress 11.xcdatamodel
- WordPress 110.xcdatamodel
- WordPress 111.xcdatamodel
- WordPress 112.xcdatamodel
- WordPress 113.xcdatamodel
- WordPress 114.xcdatamodel
- WordPress 115.xcdatamodel
- WordPress 116.xcdatamodel
- WordPress 117.xcdatamodel
- WordPress 118.xcdatamodel
- WordPress 119.xcdatamodel
- WordPress 12.xcdatamodel
- WordPress 120.xcdatamodel
- WordPress 121.xcdatamodel
- WordPress 122.xcdatamodel
- WordPress 123.xcdatamodel
- WordPress 124.xcdatamodel
- WordPress 125.xcdatamodel
- WordPress 126.xcdatamodel
- WordPress 127.xcdatamodel
- WordPress 128.xcdatamodel
- WordPress 129.xcdatamodel
- WordPress 13.xcdatamodel
- WordPress 130.xcdatamodel
- WordPress 131.xcdatamodel
- WordPress 132.xcdatamodel
- WordPress 133.xcdatamodel
- WordPress 134.xcdatamodel
- WordPress 135.xcdatamodel
- WordPress 136.xcdatamodel
- WordPress 137.xcdatamodel
- WordPress 138.xcdatamodel
- WordPress 139.xcdatamodel
- WordPress 14.xcdatamodel
- WordPress 140.xcdatamodel
- WordPress 141.xcdatamodel
- WordPress 142.xcdatamodel
- WordPress 143.xcdatamodel
- WordPress 144.xcdatamodel
- WordPress 145.xcdatamodel
- WordPress 146.xcdatamodel
- WordPress 147.xcdatamodel
- WordPress 148.xcdatamodel
- WordPress 149.xcdatamodel
- WordPress 15.xcdatamodel
- WordPress 150.xcdatamodel
- WordPress 151.xcdatamodel
- WordPress 152.xcdatamodel
- WordPress 153.xcdatamodel
- WordPress 154.xcdatamodel
- WordPress 155.xcdatamodel
- WordPress 16.xcdatamodel
- WordPress 17.xcdatamodel
- WordPress 18.xcdatamodel
- WordPress 19.xcdatamodel
- WordPress 2.xcdatamodel
- WordPress 20.xcdatamodel
- WordPress 21.xcdatamodel
- WordPress 22.xcdatamodel
- WordPress 23.xcdatamodel
- WordPress 24.xcdatamodel
- WordPress 25.xcdatamodel
- WordPress 26.xcdatamodel
- WordPress 27.xcdatamodel
- WordPress 28.xcdatamodel
- WordPress 29.xcdatamodel
- WordPress 3.xcdatamodel
- WordPress 30.xcdatamodel
- WordPress 31.xcdatamodel
- WordPress 32.xcdatamodel
- WordPress 33.xcdatamodel
- WordPress 34.xcdatamodel
- WordPress 35.xcdatamodel
- WordPress 36.xcdatamodel
- WordPress 37.xcdatamodel
- WordPress 38.xcdatamodel
- WordPress 39.xcdatamodel
- WordPress 4.xcdatamodel
- WordPress 40.xcdatamodel
- WordPress 41.xcdatamodel
- WordPress 42.xcdatamodel
- WordPress 43.xcdatamodel
- WordPress 44.xcdatamodel
- WordPress 45.xcdatamodel
- WordPress 46.xcdatamodel
- WordPress 47.xcdatamodel
- WordPress 48.xcdatamodel
- WordPress 49.xcdatamodel
- WordPress 5.xcdatamodel
- WordPress 50.xcdatamodel
- WordPress 51.xcdatamodel
- WordPress 52.xcdatamodel
- WordPress 53.xcdatamodel
- WordPress 54.xcdatamodel
- WordPress 55.xcdatamodel
- WordPress 56.xcdatamodel
- WordPress 57.xcdatamodel
- WordPress 58.xcdatamodel
- WordPress 59.xcdatamodel
- WordPress 6.xcdatamodel
- WordPress 60.xcdatamodel
- WordPress 61.xcdatamodel
- WordPress 62.xcdatamodel
- WordPress 63.xcdatamodel
- WordPress 64.xcdatamodel
- WordPress 65.xcdatamodel
- WordPress 66.xcdatamodel
- WordPress 67.xcdatamodel
- WordPress 68.xcdatamodel
- WordPress 69.xcdatamodel
- WordPress 7.xcdatamodel
- WordPress 70.xcdatamodel
- WordPress 71.xcdatamodel
- WordPress 72.xcdatamodel
- WordPress 73.xcdatamodel
- WordPress 74.xcdatamodel
- WordPress 75.xcdatamodel
- WordPress 76.xcdatamodel
- WordPress 77.xcdatamodel
- WordPress 78.xcdatamodel
- WordPress 79.xcdatamodel
- WordPress 8.xcdatamodel
- WordPress 80.xcdatamodel
- WordPress 81.xcdatamodel
- WordPress 82.xcdatamodel
- WordPress 83.xcdatamodel
- WordPress 84.xcdatamodel
- WordPress 85.xcdatamodel
- WordPress 86.xcdatamodel
- WordPress 87.xcdatamodel
- WordPress 88.xcdatamodel
- WordPress 89.xcdatamodel
- WordPress 9.xcdatamodel
- WordPress 90.xcdatamodel
- WordPress 91.xcdatamodel
- WordPress 92.xcdatamodel
- WordPress 93.xcdatamodel
- WordPress 94.xcdatamodel
- WordPress 95.xcdatamodel
- WordPress 96.xcdatamodel
- WordPress 97.xcdatamodel
- WordPress 98.xcdatamodel
- WordPress 99.xcdatamodel
- WordPress.xcdatamodel
- Swift
- Tests
- KeystoneTests
- Helpers
- Tests
- CoreData
- Extensions
- Features
- Aztec
- Blaze
- Blog
- Dashboard
- Domains
- Gutenberg
- Media
- Mentions
- Misc
- Compliance
- Notifications
- Posts
- Jetpack
- Login
- Misc
- Models
- Networking
- Reader
- Services
- Stores
- Utility
- WordPressDataTests
- Helpers
- WordPress
- Classes
- Categories
- Extensions
- Notifications
- Jetpack/Utility
- Models
- Blog
- Notifications
- Types
- Services
- Domains
- Facades
- Reader Post
- Stores
- System
- 3D Touch
- Utility
- Analytics
- Editor
- Logging
- Migration
- ViewRelated
- Blog
- Blog Dashboard
- Blog Details
- Sharing
- Site Management
- Site Picker/BlogList
- Site Settings
- Comments
- Controllers
- Views/Detail
- Jetpack
- Jetpack Scan
- Jetpack Settings
- Likes
- Menus
- Categories
- Controllers
- View Models
- Views
- Me
- App Settings
- Privacy Settings
- Help & Support
- Me Main
- NUX/Helpers
- Notifications
- Controllers
- NotificationsViewController
- FormattableContent/Groups
- Tools
- Views
- Post
- Revisions
- Search
- Reader/Controllers
- Site Creation/Wizard
- Stats
- System
- Notices
- Sidebar
- WordPress.xcodeproj
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
592 files changed
+1660
-588
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
238 | 249 | | |
239 | 250 | | |
240 | 251 | | |
| |||
307 | 318 | | |
308 | 319 | | |
309 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
310 | 332 | | |
311 | 333 | | |
312 | 334 | | |
| |||
319 | 341 | | |
320 | 342 | | |
321 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
322 | 356 | | |
323 | 357 | | |
324 | 358 | | |
| |||
327 | 361 | | |
328 | 362 | | |
329 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
330 | 374 | | |
331 | 375 | | |
332 | 376 | | |
333 | 377 | | |
334 | 378 | | |
335 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
336 | 390 | | |
337 | 391 | | |
338 | 392 | | |
339 | 393 | | |
340 | 394 | | |
341 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
342 | 412 | | |
343 | 413 | | |
344 | 414 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 22 | | |
27 | | - | |
28 | 23 | | |
29 | 24 | | |
30 | 25 | | |
| |||
33 | 28 | | |
34 | 29 | | |
35 | 30 | | |
36 | | - | |
37 | | - | |
38 | 31 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 32 | | |
44 | | - | |
45 | 33 | | |
46 | 34 | | |
47 | | - | |
48 | | - | |
49 | 35 | | |
50 | 36 | | |
51 | 37 | | |
| |||
57 | 43 | | |
58 | 44 | | |
59 | 45 | | |
60 | | - | |
61 | 46 | | |
62 | 47 | | |
63 | 48 | | |
64 | 49 | | |
65 | | - | |
66 | 50 | | |
67 | 51 | | |
68 | 52 | | |
69 | 53 | | |
70 | 54 | | |
71 | 55 | | |
72 | | - | |
73 | 56 | | |
74 | 57 | | |
75 | 58 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
8 | 4 | | |
9 | 5 | | |
10 | 6 | | |
| |||
File renamed without changes.
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| 4 | + | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 2 | + | |
7 | 3 | | |
8 | 4 | | |
9 | 5 | | |
| |||
File renamed without changes.
0 commit comments