Skip to content

Commit fe152b7

Browse files
authored
Merge pull request #888 from Stefterv/main-gradle
Adding a Gradle Build system to the Processing IDE
2 parents 316a902 + f3a8ec6 commit fe152b7

File tree

126 files changed

+2494
-763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+2494
-763
lines changed

.github/workflows/build-gradle.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Pre-releases with Gradle
2+
on:
3+
push:
4+
paths-ignore:
5+
- '**/*.md'
6+
- '.all-contributorsrc'
7+
8+
jobs:
9+
build:
10+
name: Create Pre-release for ${{ matrix.os_prefix }} (${{ matrix.arch }})
11+
runs-on: ${{ matrix.os }}
12+
permissions:
13+
contents: write
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- os: [self-hosted, linux, ARM64]
19+
os_prefix: linux
20+
arch: aarch64
21+
- os: ubuntu-latest
22+
os_prefix: linux
23+
arch: x64
24+
- os: windows-latest
25+
os_prefix: windows
26+
arch: x64
27+
- os: macos-latest
28+
os_prefix: macos
29+
arch: x64
30+
- os: macos-latest
31+
os_prefix: macos
32+
arch: aarch64
33+
steps:
34+
- name: Checkout Repository
35+
uses: actions/checkout@v4
36+
- name: Install Java
37+
uses: actions/setup-java@v4
38+
with:
39+
java-version: '17'
40+
distribution: 'temurin'
41+
architecture: ${{ matrix.arch }}
42+
- name: Setup Gradle
43+
uses: gradle/actions/setup-gradle@v4
44+
- name: Build with Gradle
45+
run: ./gradlew packageDistributionForCurrentOS
46+
- name: Add instructions
47+
if: ${{ matrix.os_prefix == 'macos' }}
48+
run: |
49+
echo "run 'xattr -d com.apple.quarantine Processing-${version}.dmg' to remove the quarantine flag" > ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt
50+
- name: Add artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: processing-${{ github.ref_name }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-gradle
54+
path: |
55+
./app/build/compose/binaries/main/dmg/Processing-*.dmg
56+
./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt
57+
./app/build/compose/binaries/main/msi/Processing-*.msi
58+
./app/build/compose/binaries/main/deb/processing*.deb
59+
retention-days: 1

.github/workflows/build.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
permissions:
3030
contents: write
3131
strategy:
32+
fail-fast: false
3233
matrix:
3334
include:
3435
# compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit)
@@ -71,6 +72,6 @@ jobs:
7172
- name: Add artifact
7273
uses: actions/upload-artifact@v4
7374
with:
74-
name: processing-${{github.sha}}${{ matrix.os_prefix }}-${{ matrix.arch }}
75+
name: processing-${{ github.ref_name }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-ant
7576
path: ./build/${{ matrix.os_prefix }}/processing-${{github.sha}}-${{ matrix.os_prefix}}-*
7677
retention-days: 1
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Pull Requests with Gradle
2+
on:
3+
pull_request:
4+
paths-ignore:
5+
- '**/*.md'
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
name: Create Pull Request Build for ${{ matrix.os_prefix }} (${{ matrix.arch }})
12+
runs-on: ${{ matrix.os }}
13+
permissions:
14+
pull-requests: write
15+
contents: read
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: ubuntu-24.04-arm
21+
os_prefix: linux
22+
arch: aarch64
23+
- os: ubuntu-latest
24+
os_prefix: linux
25+
arch: x64
26+
- os: windows-latest
27+
os_prefix: windows
28+
arch: x64
29+
- os: macos-latest
30+
os_prefix: macos
31+
arch: x64
32+
- os: macos-latest
33+
os_prefix: macos
34+
arch: aarch64
35+
steps:
36+
- name: Checkout Repository
37+
uses: actions/checkout@v4
38+
- name: Install Java
39+
uses: actions/setup-java@v4
40+
with:
41+
java-version: '17'
42+
distribution: 'temurin'
43+
architecture: ${{ matrix.arch }}
44+
- name: Setup Gradle
45+
uses: gradle/actions/setup-gradle@v4
46+
- name: Build with Gradle
47+
run: ./gradlew packageDistributionForCurrentOS
48+
- name: Add instructions
49+
if: ${{ matrix.os_prefix == 'macos' }}
50+
run: |
51+
echo "run 'xattr -d com.apple.quarantine Processing-${version}.dmg' to remove the quarantine flag" > ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt
52+
- name: Add artifact
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: processing-pr${{ github.event.pull_request.number }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-gradle
56+
path: |
57+
./app/build/compose/binaries/main/dmg/Processing-*.dmg
58+
./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt
59+
./app/build/compose/binaries/main/msi/Processing-*.msi
60+
./app/build/compose/binaries/main/deb/processing*.deb
61+
retention-days: 5

.github/workflows/pull_request.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
pull-requests: write
1515
contents: read
1616
strategy:
17+
fail-fast: false
1718
matrix:
1819
include:
1920
# compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit)
@@ -51,20 +52,12 @@ jobs:
5152
architecture: ${{ matrix.arch }}
5253
- name: Setup Ant
5354
uses: cedx/setup-ant@v3
54-
# - name: Install Certificates for Code Signing
55-
# if: ${{ matrix.os_prefix == 'macos' }}
56-
# uses: apple-actions/import-codesign-certs@v3
57-
# with:
58-
# p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
59-
# p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
6055
- name: Build Release
6156
run: ant -noinput -buildfile build/build.xml ${{ matrix.os_prefix }}-dist -Dversion="${{ github.sha }}" -Dplatform=${{ matrix.os_prefix }}
62-
# env:
63-
# PROCESSING_APP_SIGNING: ${{ secrets.CERTIFICATES_P12 != '' }}
6457
- name: Add artifact
6558
uses: actions/upload-artifact@v4
6659
id: upload
6760
with:
68-
name: processing-${{github.sha}}${{ matrix.os_prefix }}-${{ matrix.arch }}
61+
name: processing-pr${{ github.event.pull_request.number }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-ant
6962
path: ./build/${{ matrix.os_prefix }}/processing-${{github.sha}}-${{ matrix.os_prefix}}-*
7063
retention-days: 5

.github/workflows/release-gradle.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Releases
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
version:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
build_number: ${{ steps.tag_info.outputs.build_number }}
11+
version: ${{ steps.tag_info.outputs.version }}
12+
steps:
13+
- name: Extract version and build number
14+
id: tag_info
15+
shell: bash
16+
run: |
17+
TAG_NAME="${GITHUB_REF#refs/tags/}"
18+
BUILD_NUMBER=$(echo "$TAG_NAME" | cut -d'-' -f2)
19+
VERSION=$(echo "$TAG_NAME" | cut -d'-' -f3)
20+
21+
# Set outputs for use in later jobs or steps
22+
echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT
23+
echo "version=$VERSION" >> $GITHUB_OUTPUT
24+
publish:
25+
name: Publish Processing Core to Maven Central
26+
runs-on: ubuntu-latest
27+
needs: version
28+
steps:
29+
- name: Checkout Repository
30+
uses: actions/checkout@v4
31+
- name: Setup Java
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: 'temurin'
35+
java-version: 17
36+
- name: Setup Gradle
37+
uses: gradle/actions/setup-gradle@v4
38+
- name: Build with Gradle
39+
run: ./gradlew publish
40+
env:
41+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
42+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
43+
44+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
45+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
46+
47+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
48+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
49+
50+
ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }}
51+
ORG_GRADLE_PROJECT_group: ${{ vars.PROCESSING_GROUP }}
52+
build:
53+
name: Publish Release for ${{ matrix.os_prefix }} (${{ matrix.arch }})
54+
runs-on: ${{ matrix.os }}
55+
needs: version
56+
permissions:
57+
contents: write
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
include:
62+
# compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit)
63+
- os: [self-hosted, linux, ARM]
64+
os_prefix: linux
65+
arch: arm
66+
- os: ubuntu-latest
67+
os_prefix: linux
68+
arch: x64
69+
- os: windows-latest
70+
os_prefix: windows
71+
arch: x64
72+
- os: macos-latest
73+
os_prefix: macos
74+
arch: x64
75+
- os: macos-latest
76+
os_prefix: macos
77+
arch: aarch64
78+
- os: macos-latest
79+
os_prefix: linux
80+
arch: aarch64
81+
steps:
82+
- name: Checkout Repository
83+
uses: actions/checkout@v4
84+
- name: Install Java
85+
uses: actions/setup-java@v4
86+
with:
87+
java-version: '17'
88+
distribution: 'temurin'
89+
architecture: ${{ matrix.arch }}
90+
- name: Setup Gradle
91+
uses: gradle/actions/setup-gradle@v4
92+
# - name: Install Certificates for Code Signing
93+
# if: ${{ matrix.os_prefix == 'macos' }}
94+
# uses: apple-actions/import-codesign-certs@v3
95+
# with:
96+
# p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
97+
# p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
98+
- name: Build with Gradle
99+
run: ./gradlew packageDistributionForCurrentOS
100+
env:
101+
ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }}
102+
ORG_GRADLE_PROJECT_group: ${{ vars.PROCESSING_GROUP }}
103+
104+
- name: Upload binaries to release
105+
uses: svenstaro/upload-release-action@v2
106+
with:
107+
repo_token: ${{ secrets.GITHUB_TOKEN }}
108+
file: |
109+
./app/build/compose/binaries/main/dmg/Processing-*.dmg
110+
./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt
111+
./app/build/compose/binaries/main/msi/Processing-*.msi
112+
./app/build/compose/binaries/main/deb/processing*.deb
113+
file_glob: true

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,14 @@ processing-examples
101101
.gradle
102102
core/build/
103103
build/publish/
104+
app/build
105+
java/build/
106+
/build/reports
107+
/java/bin
108+
/java/libraries/svg/bin
109+
/java/preprocessor/build
110+
/java/lsp/build
111+
/.kotlin/sessions
112+
/core/examples/build
113+
114+
.build/

.idea/artifacts/app_desktop.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/app_jvm.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/externalDependencies.xml .idea/compiler.xml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+6-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)