Skip to content

Commit

Permalink
Linux-compatible build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Nov 11, 2020
1 parent 591dd5c commit 0b4f7e6
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 76 deletions.
136 changes: 68 additions & 68 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,51 @@ env:
skia_release: m87-4893488

jobs:
# shared:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - uses: actions/setup-java@v1
# with:
# java-version: '11.0.8'
# - run: ./script/ci_deploy_shared.sh
# env:
# SPACE_TOKEN: ${{ secrets.SPACE_TOKEN }}
# - uses: actions/upload-artifact@v2
# with:
# name: skija-shared
# path: target/*.jar
shared:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v1
with:
java-version: '11.0.8'
- run: ./ci/deploy_shared.sh
env:
SPACE_TOKEN: ${{ secrets.SPACE_TOKEN }}
- uses: actions/upload-artifact@v2
with:
name: skija-shared
path: target/*.jar

# macos:
# runs-on: macos-10.15
# needs: shared
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - uses: seanmiddleditch/gha-setup-ninja@master
# - uses: actions/setup-java@v1
# with:
# java-version: '11.0.8'
# - name: Download Skia
# run: |
# curl --fail --location --silent --show-error https://github.com/JetBrains/skia-build/releases/download/${{ env.skia_release }}/Skia-${{ env.skia_release }}-macos-Release-x64.zip > Skia-${{ env.skia_release }}-macos-Release-x64.zip.zip
# unzip -qq Skia-${{ env.skia_release }}-macos-Release-x64.zip.zip -d third_party/skia
# - run: ./script/native.sh
# - uses: actions/upload-artifact@v2
# with:
# name: skija-macos
# path: target/native/*.dylib
# - run: ./ci/deploy_macos.sh
# env:
# SPACE_TOKEN: ${{ secrets.SPACE_TOKEN }}
macos:
runs-on: macos-10.15
needs: shared
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/setup-java@v1
with:
java-version: '11.0.8'
- name: Download Skia
run: |
curl --fail --location --silent --show-error https://github.com/JetBrains/skia-build/releases/download/${{ env.skia_release }}/Skia-${{ env.skia_release }}-macos-Release-x64.zip > Skia-${{ env.skia_release }}-macos-Release-x64.zip.zip
unzip -qq Skia-${{ env.skia_release }}-macos-Release-x64.zip.zip -d third_party/skia
- run: ./script/native.sh
- uses: actions/upload-artifact@v2
with:
name: skija-macos
path: target/native/*.dylib
- run: ./ci/deploy_macos.sh
env:
SPACE_TOKEN: ${{ secrets.SPACE_TOKEN }}

linux:
runs-on: ubuntu-latest
container: tonsky/ubuntu-14.04:latest
# needs: shared
needs: shared
steps:
- run: |
echo "/usr/lib/binutils-2.26/bin" >> $GITHUB_PATH
Expand All @@ -80,31 +80,31 @@ jobs:
env:
SPACE_TOKEN: ${{ secrets.SPACE_TOKEN }}

# windows:
# runs-on: windows-2019
# needs: shared
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - uses: microsoft/[email protected]
# - uses: ilammy/[email protected]
# - uses: seanmiddleditch/gha-setup-ninja@master
# - uses: actions/setup-java@v1
# with:
# java-version: '11.0.8'
# - name: Download Skia
# shell: bash
# run: |
# curl --fail --location --silent --show-error https://github.com/JetBrains/skia-build/releases/download/${{ env.skia_release }}/Skia-${{ env.skia_release }}-windows-Release-x64.zip > Skia-${{ env.skia_release }}-windows-Release-x64.zip.zip
# unzip -qq Skia-${{ env.skia_release }}-windows-Release-x64.zip.zip -d third_party/skia
# - shell: bash
# run: ./script/native.sh
# - uses: actions/upload-artifact@v2
# with:
# name: skija-windows
# path: target/native/*.dll
# - shell: bash
# run: ./script/ci_deploy_windows.sh
# env:
# SPACE_TOKEN: ${{ secrets.SPACE_TOKEN }}
windows:
runs-on: windows-2019
needs: shared
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: microsoft/[email protected]
- uses: ilammy/[email protected]
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/setup-java@v1
with:
java-version: '11.0.8'
- name: Download Skia
shell: bash
run: |
curl --fail --location --silent --show-error https://github.com/JetBrains/skia-build/releases/download/${{ env.skia_release }}/Skia-${{ env.skia_release }}-windows-Release-x64.zip > Skia-${{ env.skia_release }}-windows-Release-x64.zip.zip
unzip -qq Skia-${{ env.skia_release }}-windows-Release-x64.zip.zip -d third_party/skia
- shell: bash
run: ./script/native.sh
- uses: actions/upload-artifact@v2
with:
name: skija-windows
path: target/native/*.dll
- shell: bash
run: ./ci/deploy_windows.sh
env:
SPACE_TOKEN: ${{ secrets.SPACE_TOKEN }}
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM tonsky/ubuntu-14.04:latest

WORKDIR /root/skija

ADD . ./
RUN curl --fail --location --silent --show-error https://github.com/JetBrains/skia-build/releases/download/m87-4893488/Skia-m87-4893488-linux-Release-x64.zip > Skia-m87-4893488-linux-Release-x64.zip.zip
RUN unzip -qq Skia-m87-4893488-linux-Release-x64.zip.zip -d third_party/skia
7 changes: 6 additions & 1 deletion examples/lwjgl/script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ if [[ ! -f target/build_timestamp ]]; then
touch -t 200912310000 target/build_timestamp
fi

find src -name "*.java" -newer target/build_timestamp | xargs javac --release 11 -cp $CLASSPATH -d target/classes
XARG=""
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
XARG=--no-run-if-empty
fi

find src -name "*.java" -newer target/build_timestamp | xargs $XARG javac --release 11 -cp $CLASSPATH -d target/classes

touch target/build_timestamp
19 changes: 12 additions & 7 deletions script/build_incremental.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,40 @@ if [[ ! -f $ANNOTATIONS ]] || [[ ! -f $LOMBOK ]] ; then
mvn compile
fi

XARG=""
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
XARG=--no-run-if-empty
fi

mkdir -p target/classes/org/jetbrains/skija
find src/main/java/org/jetbrains/skija/lombok.config -newer target/build_timestamp | xargs -I '{}' cp '{}' target/classes/org/jetbrains/skija
find src -name "*.java" -newer target/build_timestamp | xargs javac --release 11 -cp target/classes:target/test-classes:$ANNOTATIONS:$LOMBOK
find src -name "*.java" -newer target/build_timestamp | xargs $XARG javac -encoding UTF8 --release 11 -cp target/classes:target/test-classes:$ANNOTATIONS:$LOMBOK

# move impl
mkdir -p target/classes/org/jetbrains/skija/impl
find src/main/java/org/jetbrains/skija/impl -name '*.class' | xargs -I '{}' mv '{}' target/classes/org/jetbrains/skija/impl
find src/main/java/org/jetbrains/skija/impl -name '*.class' | xargs $XARG -I '{}' mv '{}' target/classes/org/jetbrains/skija/impl

# move shaper
mkdir -p target/classes/org/jetbrains/skija/shaper
find src/main/java/org/jetbrains/skija/shaper -name '*.class' | xargs -I '{}' mv '{}' target/classes/org/jetbrains/skija/shaper
find src/main/java/org/jetbrains/skija/shaper -name '*.class' | xargs $XARG -I '{}' mv '{}' target/classes/org/jetbrains/skija/shaper

# move paragraph
mkdir -p target/classes/org/jetbrains/skija/paragraph
find src/main/java/org/jetbrains/skija/paragraph -name '*.class' | xargs -I '{}' mv '{}' target/classes/org/jetbrains/skija/paragraph
find src/main/java/org/jetbrains/skija/paragraph -name '*.class' | xargs $XARG -I '{}' mv '{}' target/classes/org/jetbrains/skija/paragraph

# move skija
find src/main/java -name '*.class' | xargs -I '{}' mv '{}' target/classes/org/jetbrains/skija

# move test/paragraph
mkdir -p target/test-classes/org/jetbrains/skija/paragraph
find src/test/java/org/jetbrains/skija/paragraph -name '*.class' | xargs -I '{}' mv '{}' target/test-classes/org/jetbrains/skija/paragraph
find src/test/java/org/jetbrains/skija/paragraph -name '*.class' | xargs $XARG -I '{}' mv '{}' target/test-classes/org/jetbrains/skija/paragraph

# move test/test
mkdir -p target/test-classes/org/jetbrains/skija/test
find src/test/java/org/jetbrains/skija/test -name '*.class' | xargs -I '{}' mv '{}' target/test-classes/org/jetbrains/skija/test
find src/test/java/org/jetbrains/skija/test -name '*.class' | xargs $XARG -I '{}' mv '{}' target/test-classes/org/jetbrains/skija/test

# move test
find src/test/java/org/jetbrains/skija -name '*.class' | xargs -I '{}' mv '{}' target/test-classes/org/jetbrains/skija
find src/test/java/org/jetbrains/skija -name '*.class' | xargs $XARG -I '{}' mv '{}' target/test-classes/org/jetbrains/skija

touch target/build_timestamp

Expand Down

0 comments on commit 0b4f7e6

Please sign in to comment.