Closed 05nelsonm closed 10 months ago
I think that for the tool and it's use case, it'd work best as a gradle plugin. The whole process will go something like this
tor
via ./external/task.sh
./external/task.sh
and diff-cli
toolbuild
directory output (built binaries for given platform/arch). This will be 3 steps:
/library/binary/src/native_resources/<source set>
+ /io/matthewnelson/kmp/tor/binary
/library/binary/src/native_resources/iosArm64/io/matthewnelson/kmp/tor/binary/tor
src/native_resources
directory for files and generate the .kt
resource files.tor
binary file will be picked up, and written in the aforementioned format to src/iosArm64/io/matthewnelson/kmp/tor/binary/resource_tor.kt
A runtime library will be needed to provide the NativeResource
abstraction (maybe rename to KmpResource
in case future support for other platforms than just darwin targets???) which has the extraction logic and will simply provide a stream.
Split this issue up by creating #134 for implementing NativeResource
Adding the blocked
label until that is completed.
Finally ready to start working on task.sh
build script for darwin targets after #155
will need to use the lipo
tool for darwin to make a multi-arch binary so they can be written to iosMain
, macosMain
, tvosMain
, and watchosMain
and not individually for each architecture. Will significantly reduce the size.
will need to use the
lipo
tool for darwin to make a multi-arch binary so they can be written toiosMain
,macosMain
,tvosMain
, andwatchosMain
and not individually for each architecture. Will significantly reduce the size.
Unsure how the simulators will work with this because there'll be multiple arm64 architectures. May need to configure source sets separately.
e.g.
darwinMain
|--- iosMain
| |--- iosArm64
| '--- iosX64
|--- iosSimulatorArm64
...
So compiling on macOS
machine using Xcode.app
is simply not going to work. Output is not reproducible. Working on another docker container for iPhoneOS
and iPhoneSimulator
SDKs.
ios
/ios-simulator
docker files will live in kmp-tor-binary
until things are ready for release. #168 has been created so I do not forget about it :smirk_cat:
Native support for macOS
was implemented in #171
Remaining targets will be rolled out separately (tons of work getting things compiling via docker using cctools-port
). Closing this as "completed" and delegating the remaining items to the following issue tickets:
Add
macOS
,iOS
,tvOS
,watchOS
support.Tor will need to be compiled, codesigned, and packaged so it can be extracted to the appropriate destination (just like Jvm/Js).
A new packaging tool and runtime library will be needed as there currently exists no way to add resources to a
.klib
.The simplest way it seems to package things is to base64 encode each resource and add as
.kt
files with some sort of header.Will have to see if gzipping is possible before encoding. Also, this is a perfect use case for
EncoderDecoder.Feed
https://github.com/05nelsonm/encoding