[Build] Add FreeType support for CI
This commit is contained in:
1 parent
39a86991f2
commit
37bc815a06
4 files changed
+58
-24
No files matched your search
@@ -4,63 +4,97 @@ jobs:
|
|||||||
build-java:
|
build-java:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-20.04, macos-10.15]
|
||||||
name: Build Java [${{ matrix.os }}]
|
name: Build Java
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Java 8
|
- name: Set up Java 8
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 8
|
java-version: 8
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: eskatos/gradle-command-action@v1
|
uses: eskatos/gradle-command-action@v1
|
||||||
with:
|
with:
|
||||||
arguments: build
|
arguments: build
|
||||||
build-natives:
|
build-natives:
|
||||||
|
env:
|
||||||
|
FREETYPE_URL: https://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.gz
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-20.04, macos-10.15]
|
||||||
type: [win, linux, mac]
|
type: [win, linux, mac]
|
||||||
|
freetype: [true, false]
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- type: win
|
||||||
type: win
|
|
||||||
expected: /tmp/imgui/libsNative/windows64/imgui-java64.dll
|
expected: /tmp/imgui/libsNative/windows64/imgui-java64.dll
|
||||||
- os: ubuntu-latest
|
libName: imgui-java64.dll
|
||||||
type: linux
|
libNameFt: imgui-java64-ft.dll
|
||||||
|
- type: linux
|
||||||
expected: /tmp/imgui/libsNative/linux64/libimgui-java64.so
|
expected: /tmp/imgui/libsNative/linux64/libimgui-java64.so
|
||||||
- os: macos-latest
|
libName: libimgui-java64.so
|
||||||
type: mac
|
libNameFt: libimgui-java64-ft.so
|
||||||
|
- type: mac
|
||||||
expected: /tmp/imgui/libsNative/macosx64/libimgui-java64.dylib
|
expected: /tmp/imgui/libsNative/macosx64/libimgui-java64.dylib
|
||||||
|
libName: libimgui-java64.dylib
|
||||||
|
libNameFt: libimgui-java64-ft.dylib
|
||||||
exclude:
|
exclude:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-20.04
|
||||||
type: mac
|
type: mac
|
||||||
- os: macos-latest
|
- os: macos-10.15
|
||||||
type: win
|
type: win
|
||||||
- os: macos-latest
|
- os: macos-10.15
|
||||||
type: linux
|
type: linux
|
||||||
name: Build Natives [${{ matrix.os }}]-[${{ matrix.type }}]
|
name: Build Native (type=${{ matrix.type }}, freetype=${{ matrix.freetype }})
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository and submodules
|
- name: Checkout repository and submodules
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Set up Java 8
|
- name: Set up Java 8
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 8
|
java-version: 8
|
||||||
|
|
||||||
- name: Ant Version
|
- name: Ant Version
|
||||||
run: ant -version
|
run: ant -version
|
||||||
- if: matrix.os == 'ubuntu-latest'
|
|
||||||
|
- if: matrix.os == 'ubuntu-20.04'
|
||||||
name: Install MinGW-w64/GCC/G++
|
name: Install MinGW-w64/GCC/G++
|
||||||
run: sudo apt-get install mingw-w64 gcc-multilib g++-multilib
|
run: sudo apt install mingw-w64
|
||||||
- name: Build [${{ matrix.type }}]
|
|
||||||
|
- if: matrix.os == 'ubuntu-20.04' && matrix.type == 'linux' && matrix.freetype == true
|
||||||
|
name: FreeType - Install
|
||||||
|
run: sudo apt install libfreetype6-dev
|
||||||
|
|
||||||
|
- if: matrix.os == 'ubuntu-20.04' && matrix.type == 'win' && matrix.freetype == true
|
||||||
|
name: FreeType - Download
|
||||||
|
run: |
|
||||||
|
sudo wget -O /freetype.tar.gz ${{ env.FREETYPE_URL }}
|
||||||
|
sudo mkdir /freetype
|
||||||
|
sudo tar -xzf /freetype.tar.gz -C /freetype --strip-components=1
|
||||||
|
|
||||||
|
- if: matrix.os == 'ubuntu-20.04' && matrix.type == 'win' && matrix.freetype == true
|
||||||
|
name: FreeType - Compile & Install
|
||||||
|
working-directory: /freetype
|
||||||
|
run: |
|
||||||
|
sudo ./configure --with-zlib=no --with-bzip2=no --with-png=no --with-harfbuzz=no --with-brotli=no --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32
|
||||||
|
sudo make
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
- name: Build
|
||||||
uses: eskatos/gradle-command-action@v1
|
uses: eskatos/gradle-command-action@v1
|
||||||
with:
|
with:
|
||||||
arguments: :imgui-binding:generateLibs -Denvs=${{ matrix.type }}
|
arguments: :imgui-binding:generateLibs -Denvs=${{ matrix.type }} -Dfreetype=${{ matrix.freetype }}
|
||||||
- name: Check [${{ matrix.expected }}]
|
|
||||||
uses: andstor/file-existence-action@v1
|
- name: Upload Native
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
files: ${{ matrix.expected }}
|
name: ${{ matrix.freetype && matrix.libNameFt || matrix.libName }}
|
||||||
|
path: ${{ matrix.expected }}
|
||||||
|
if-no-files-found: error
|
||||||
@@ -3,5 +3,5 @@
|
|||||||
BASEDIR=$(dirname "$0")
|
BASEDIR=$(dirname "$0")
|
||||||
cd $BASEDIR/../../imgui-binding || exit
|
cd $BASEDIR/../../imgui-binding || exit
|
||||||
|
|
||||||
../gradlew clean generateLibs -Denvs=$* -Dlocal -Dfreetype
|
../gradlew clean generateLibs -Denvs=$* -Dlocal -Dfreetype=true
|
||||||
rm -frd libsNative
|
rm -frd libsNative
|
||||||
@@ -4,4 +4,4 @@ BASEDIR=$(dirname "$0")
|
|||||||
cd $BASEDIR/../../imgui-binding || exit
|
cd $BASEDIR/../../imgui-binding || exit
|
||||||
|
|
||||||
rm -frd /tmp/imgui
|
rm -frd /tmp/imgui
|
||||||
../gradlew clean generateLibs -Denvs=$* -Dfreetype
|
../gradlew clean generateLibs -Denvs=$* -Dfreetype=true
|
||||||
@@ -19,8 +19,8 @@ class GenerateLibs extends DefaultTask {
|
|||||||
private final boolean forLinux = buildEnvs?.contains('linux')
|
private final boolean forLinux = buildEnvs?.contains('linux')
|
||||||
private final boolean forMac = buildEnvs?.contains('mac')
|
private final boolean forMac = buildEnvs?.contains('mac')
|
||||||
|
|
||||||
private final boolean isLocal = System.properties.containsKey("local")
|
private final boolean isLocal = System.properties.containsKey('local')
|
||||||
private final boolean withFreeType = System.properties.containsKey("freetype")
|
private final boolean withFreeType = Boolean.valueOf(System.properties.getProperty('freetype', 'false'))
|
||||||
|
|
||||||
private final String sourceDir = project.file('src/main/java')
|
private final String sourceDir = project.file('src/main/java')
|
||||||
private final String classpath = project.file('build/classes/java/main')
|
private final String classpath = project.file('build/classes/java/main')
|
||||||
|
|||||||
Reference in new issue
Block a user