-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
219 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Navigate to the root directory of the project | ||
cd "$(dirname "$0")/.." | ||
|
||
# Clean up previous builds | ||
rm -f pocketfhir_ios | ||
|
||
# Initialize Go modules in the root directory if go.mod does not exist | ||
# Ensure Go modules are initialized | ||
if [ ! -f go.mod ]; then | ||
go mod init pocketfhir | ||
fi | ||
|
||
# Tidy up Go modules in the root directory | ||
go mod tidy | ||
# Install necessary tools | ||
go get -u golang.org/x/mobile/bind | ||
go install golang.org/x/mobile/cmd/gomobile@latest | ||
gomobile init | ||
|
||
# Build the PocketFHIR server for iOS (arm64 architecture) | ||
echo "Building PocketFHIR for iOS..." | ||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o pocketfhir_ios ./src | ||
echo "iOS PocketFHIR build completed." | ||
# Build PocketFHIR .framework for iOS | ||
echo "Building PocketFHIR .framework for iOS..." | ||
gomobile bind -target=ios -o pocketfhir.framework ./pocketfhir | ||
if [ $? -ne 0 ]; then | ||
echo "iOS build failed!" | ||
exit 1 | ||
fi | ||
|
||
# Start the PocketFHIR server in the background (for the regular platform) | ||
./pocketfhir serve & | ||
# Move the framework to the appropriate iOS directory | ||
mv pocketfhir.framework ../fhir_ant/ios/libs/pocketfhir.framework | ||
|
||
echo "PocketFHIR server started." | ||
echo "PocketFHIR iOS build completed successfully." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.