Skip to content

Commit

Permalink
add ios build
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinayagarwal committed Feb 19, 2024
1 parent 11672d5 commit 45daade
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/actions/do-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ inputs:
runs:
using: composite
steps:
- name: 'Build Android'
id: build-android-linux
- name: 'Build Android or iOS'
id: build-android-ios
run: |
cd build/android-linux-aarch64
cd build/${{ inputs.platform }}
make LOG=cmdlines static-libs-image
shell: bash
if: inputs.platform == 'android-linux-aarch64'
if: inputs.platform == 'android-linux-aarch64' || inputs.platform == 'ios-mac-aarch64'

- name: 'Build'
id: build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ jobs:
--with-jvm-variants=minimal
--host=aarch64-linux-android
--target=aarch64-linux-android
${{ matrix.flags }}
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
${{ matrix.flags }}
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
echo "Dumping config.log:" &&
cat config.log &&
Expand Down
126 changes: 126 additions & 0 deletions .github/workflows/build-ios-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
#
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

name: 'Build (ios)'

on:
workflow_call:
inputs:
platform:
required: true
type: string
runs-on:
required: true
type: string
extra-conf-options:
required: false
type: string
make-target:
required: false
type: string
default: 'product-bundles test-bundles'
debug-levels:
required: false
type: string
default: '[ "release" ]'
xcode-toolset-version:
required: true
type: string
configure-arguments:
required: false
type: string
make-arguments:
required: false
type: string

jobs:
build-macos:
name: build
runs-on: ${{ inputs.runs-on }}

strategy:
fail-fast: false
matrix:
debug-level: ${{ fromJSON(inputs.debug-levels) }}
include:
- debug-level: debug
flags: --with-debug-level=fastdebug
suffix: -debug

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v4

- name: 'Get the BootJDK'
id: bootjdk
uses: ./.github/actions/get-bootjdk
with:
platform: ${{ inputs.platform }}

- name: 'Get JTReg'
id: jtreg
uses: ./.github/actions/get-jtreg

- name: 'Get GTest'
id: gtest
uses: ./.github/actions/get-gtest

- name: 'Install toolchain and dependencies'
run: |
# Run Homebrew installation and xcode-select
brew install autoconf make cups@2.3.6
sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-toolset-version }}.app/Contents/Developer
# This will make GNU make available as 'make' and not only as 'gmake'
echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH
- name: 'Configure'
run: >
bash configure
--with-conf-name=ios-macos-aarch64
--enable-headless-only
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
--openjdk-target=aarch64-macos-ios \
--with-cups-include=/opt/homebrew/Cellar/cups/2.3.6 \
--with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
${{ matrix.flags }}
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
echo "Dumping config.log:" &&
cat config.log &&
exit 1)
- name: 'Build'
id: build
uses: ./.github/actions/do-build
with:
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ios-mac-aarch64
debug-suffix: '${{ matrix.suffix }}'

- name: 'Upload bundles'
uses: ./.github/actions/upload-bundles
with:
platform: ios-mac-aarch64
debug-suffix: '${{ matrix.suffix }}'
23 changes: 19 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ on:
workflow_dispatch:
inputs:
platforms:
description: 'Platform(s) to execute on (comma separated, e.g. "android-linux-aarch64, linux-x64, macos, aarch64")'
description: 'Platform(s) to execute on (comma separated, e.g. "android-linux-aarch64, ios-macos-aarch64, linux-x64, macos, aarch64")'
required: true
default: 'android-linux-aarch64, linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
default: 'android-linux-aarch64, ios-macos-aarch64, linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
configure-arguments:
description: 'Additional configure arguments'
required: false
Expand All @@ -59,6 +59,7 @@ jobs:
runs-on: ubuntu-22.04
outputs:
android-linux-aarch64: ${{ steps.include.outputs.android-linux-aarch64 }}
ios-macos-aarch64: ${{ steps.include.outputs.ios-macos-aarch64 }}
linux-x64: ${{ steps.include.outputs.linux-x64 }}
linux-x86: ${{ steps.include.outputs.linux-x86 }}
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
Expand Down Expand Up @@ -89,7 +90,7 @@ jobs:
echo 'false'
return
else
input='android-linux-aarch64'
input='android-linux-aarch64, ios-macos-aarch64'
fi
fi
Expand All @@ -112,6 +113,7 @@ jobs:
}
echo "android-linux-aarch64=$(check_platform android-linux-aarch64 android linux aarch64)" >> $GITHUB_OUTPUT
echo "ios-macos-aarch64=$(check_platform ios-macos-aarch64 ios macos aarch64)" >> $GITHUB_OUTPUT
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
Expand All @@ -129,7 +131,7 @@ jobs:
build-android-linux-aarch64:
name: android-linux-aarch64
needs: select
uses: ./.github/workflows/build-android-linux.yml
uses: ./.github/workflows/build-android-static.yml
with:
platform: linux-x64
gcc-major-version: '10'
Expand All @@ -138,6 +140,18 @@ jobs:
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
if: needs.select.outputs.android-linux-aarch64 == 'true'

build-ios-mac-aarch64:
name: ios-mac-aarch64
needs: select
uses: ./.github/workflows/build-ios-static.yml
with:
platform: macos-aarch64
runs-on: 'macos-14'
xcode-toolset-version: '14.3.1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.ios-macos-aarch64 == 'true'

build-linux-x64:
name: linux-x64
needs: select
Expand Down Expand Up @@ -363,6 +377,7 @@ jobs:
if: always()
needs:
- build-android-linux-aarch64
- build-ios-macos-aarch64
- build-linux-x64
- build-linux-x86
- build-linux-x64-hs-nopch
Expand Down

0 comments on commit 45daade

Please sign in to comment.