Closed neysofu closed 2 years ago
Good point about source-code reusability both for compiling against FFI and testing purposes (mock). Let met think about a solution.
@neysofu Since we're keeping the
Cargo.lock
files (and.gitignore
-ing the other artifacts), that's the only comment I have on this PR. We can go ahead and merge it.
Yes we are for now just to keep moving forward, but I've created an issue and we'll definitely address it in the future.
Follow-up PR to #416. This PR fixes many of the problems that we've had in the past related to mutually exclusive Cargo features. In particular, it refactors conditional compilation of the
ffi
andmock
flags into their own separate crates, which allows Cargo to easily avoid conflicts automatically and prepares the ground for fixing #414.svm-sdk
is split intosvm-sdk
andsvm-sdk-mock
. One can easilyextern crate svm_sdk_mock as svm_sdk
to avoid rewriting lots of examples and tests.svm-sdk-host
is split into three crates:svm-sdk-host
(core trait definition),svm-sdk-host-ffi
andsvm-sdk-host-mock
.svm-sdk-storage
.svm-sdk-macros
is agnostic to bothsvm-sdk
andsvm-sdk-mock
with its macrostemplate
andtemplate_mock
.