From 0b4f7e6d49c540b66de2a7dcf84959f913a48beb Mon Sep 17 00:00:00 2001 From: Nikita Prokopov Date: Wed, 11 Nov 2020 23:01:52 +0100 Subject: [PATCH] Linux-compatible build scripts --- .github/workflows/build.yml | 136 ++++++++++++++++----------------- Dockerfile | 7 ++ examples/lwjgl/script/build.sh | 7 +- script/build_incremental.sh | 19 +++-- 4 files changed, 93 insertions(+), 76 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38dc90cb..3842cca5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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/setup-msbuild@v1.0.1 - # - uses: ilammy/msvc-dev-cmd@v1.3.0 - # - 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/setup-msbuild@v1.0.1 + - uses: ilammy/msvc-dev-cmd@v1.3.0 + - 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 }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..61fca68e --- /dev/null +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/examples/lwjgl/script/build.sh b/examples/lwjgl/script/build.sh index 639d7309..e08c6726 100755 --- a/examples/lwjgl/script/build.sh +++ b/examples/lwjgl/script/build.sh @@ -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 \ No newline at end of file diff --git a/script/build_incremental.sh b/script/build_incremental.sh index ff643f01..f93ab3c8 100755 --- a/script/build_incremental.sh +++ b/script/build_incremental.sh @@ -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