Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gradle build system to the whole repository #1

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ce06ac8
run app with the jetpack compose runner
Stefterv Nov 14, 2024
e082481
Run app with Java Mode
Stefterv Nov 14, 2024
07f05f3
Deprecation indicators and removed unused resources
Stefterv Nov 14, 2024
1983e5c
Merge branch 'processing:main' into main-gradle
Stefterv Nov 14, 2024
70208d3
Build sketches with new app bundler
Stefterv Nov 14, 2024
78da74d
Added all modules for JAR filesystem
Stefterv Nov 14, 2024
b1e4066
Work with external JDK
Stefterv Nov 14, 2024
d98cab9
Distribution icons
Stefterv Nov 14, 2024
9405e4a
First functional Composable
Stefterv Nov 14, 2024
27313b2
Proper styling
Stefterv Nov 14, 2024
28ab38a
Lottie animations
Stefterv Nov 14, 2024
a82ac33
Contribution Manager UI Test
Stefterv Nov 17, 2024
66cdcba
.idea meta files
Stefterv Nov 17, 2024
6be8114
Show local contributions
Stefterv Nov 17, 2024
cce5856
isUpdate & isInstalled & Contribution Pane
Stefterv Nov 17, 2024
86c5406
Contribution panel
Stefterv Nov 17, 2024
46b5d6c
Animation Test
Stefterv Nov 17, 2024
1adfe87
Added to the sketch menu
Stefterv Nov 17, 2024
138db84
Cleaned up ignored files
Stefterv Nov 17, 2024
3c27a73
Merge branch 'processing:main' into main-gradle
Stefterv Dec 7, 2024
8e29df6
backwards compatibility with ant
Stefterv Dec 9, 2024
fe25597
re-add bin files
Stefterv Dec 9, 2024
70a116a
.idea files
Stefterv Dec 9, 2024
b599df1
gradle ci/cd
Stefterv Dec 9, 2024
b33e095
Add generated code
Stefterv Dec 9, 2024
720793f
Update build-gradle.yml
Stefterv Dec 9, 2024
b031578
Create processing.png
Stefterv Dec 9, 2024
5697f33
Update build-gradle.yml
Stefterv Dec 9, 2024
1628d57
pre-processor gradle
Stefterv Dec 9, 2024
4f68bce
preprocessor decoupling
Stefterv Dec 9, 2024
ce4f379
Update build.gradle.kts
Stefterv Dec 9, 2024
5c40f12
windows fix
Stefterv Dec 9, 2024
fcc9ef1
LSP gradle build
Stefterv Dec 9, 2024
86f0d85
Added tests
Stefterv Dec 9, 2024
adf88f6
Fixed the tests
Stefterv Dec 9, 2024
1b09894
Fixed regressions
Stefterv Dec 14, 2024
805d8b2
Update build.gradle.kts
Stefterv Dec 14, 2024
85e84cf
Fixed another regression
Stefterv Dec 14, 2024
caada42
Fixed another regression
Stefterv Dec 14, 2024
852454f
Fixed load keywords
Stefterv Dec 14, 2024
4e893f9
get installed JDK platform independent
Stefterv Dec 14, 2024
89e991d
Reapply .gitignore
Stefterv Dec 14, 2024
91101c3
fixed missing preproc output
Stefterv Dec 14, 2024
63b251b
Update JavaBuild.java
Stefterv Dec 14, 2024
609ec6e
Embed JDK
Stefterv Dec 14, 2024
c7b77a4
Set permissions in Gradle instead
Stefterv Dec 14, 2024
a246d62
support windows
Stefterv Dec 14, 2024
8f58cd3
Update build-gradle.yml
Stefterv Dec 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/build-gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Pre-releases with Gradle
on:
push:
paths-ignore:
- '**/*.md'
- '.all-contributorsrc'

jobs:
build:
name: Create Pre-release for ${{ matrix.os_prefix }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
# # compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit)
# - os: self-hosted
# os_prefix: linux
# arch: arm
- os: ubuntu-latest
os_prefix: linux
arch: x64
- os: windows-latest
os_prefix: windows
arch: x64
- os: macos-latest
os_prefix: macos
arch: x64
- os: macos-latest
os_prefix: macos
arch: aarch64
# - os: macos-latest
# os_prefix: linux
# arch: aarch64
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Checkout Examples Repository
uses: actions/checkout@v4
with:
repository: processing/processing-examples
path: processing-examples
- name: Install Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
architecture: ${{ matrix.arch }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew packageDistributionForCurrentOS
- name: Add artifact
uses: actions/upload-artifact@v4
with:
name: processing-${{github.sha}}${{ matrix.os_prefix }}-${{ matrix.arch }}
path: |
./app/build/compose/binaries/**/*.dmg
./app/build/compose/binaries/**/*.msi
./app/build/compose/binaries/**/*.deb
retention-days: 1
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,9 @@ processing-examples
.gradle
core/build/
build/publish/
app/build
java/build/
/build/reports
/java/bin
/java/libraries/svg/bin
/java/preprocessor/build
6 changes: 6 additions & 0 deletions .idea/artifacts/app_desktop.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/artifacts/app_jvm.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions app/.project

This file was deleted.

168 changes: 168 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.compose.internal.de.undercouch.gradle.tasks.download.Download

plugins{
id("java")

kotlin("jvm") version libs.versions.kotlin
alias(libs.plugins.compose.compiler)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.serialization)

id("de.undercouch.download") version "5.6.0"
}

group = rootProject.group

repositories{
mavenCentral()
google()
maven { url = uri("https://jogamp.org/deployment/maven") }
}

sourceSets{
main{
java{
srcDirs("src")
}
kotlin{
srcDirs("src")
}
resources{
srcDirs("src","../build/shared/")
}
}
}

compose.desktop {
application {
mainClass = "processing.app.ui.Splash"

nativeDistributions{
includeAllModules = true
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "Processing"
packageVersion = rootProject.version as String

macOS{
bundleID = "org.processingfoundation.processing.app"
iconFile = project.file("../build/macos/processing.icns")
}
windows{
iconFile = project.file("../build/windows/processing.ico")
}
linux {
iconFile = project.file("../build/linux/processing.png")
}

// Allow swing to use the system look and feel
jvmArgs(
"-Dapple.awt.application.appearance=system"
)
appResourcesRootDir.set(layout.buildDirectory.dir("resources-bundled"))
}
}
}

val compottieVersion = "2.0.0-rc02"

dependencies {
implementation("com.formdev:flatlaf:3.4.1")

implementation("net.java.dev.jna:jna:5.12.1")
implementation("net.java.dev.jna:jna-platform:5.12.1")

implementation(project(":core"))
runtimeOnly(project(":java"))
implementation(project(":java:preprocessor"))

implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)

implementation(compose.desktop.currentOs)

implementation("io.github.alexzhirkevich:compottie:${compottieVersion}")

implementation("com.charleskorn.kaml:kaml:0.65.0")
}

tasks.register<Copy>("addCore"){
dependsOn(project(":core").tasks.jar)
from("../core/build/libs/")
include("*.jar")
into("build/resources/main/core/library")
}
tasks.jar { dependsOn("addCore") }
tasks.processResources{ finalizedBy("addCore") }

tasks.register<Download>("downloadJDK") {
val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
val arch: String = System.getProperty("os.arch").let { originalArch ->
when (originalArch) {
"amd64" -> "x64"
"x86_64" -> "x64"
else -> originalArch
}
}

val platform = when {
os.isWindows -> "windows"
os.isMacOsX -> "mac"
else -> "linux"
}
val javaVersion = "17"
val imageType = "jdk"

src("https://api.adoptium.net/v3/binary/latest/" +
"$javaVersion/ga/" +
"$platform/" +
"$arch/" +
"$imageType/" +
"hotspot/normal/eclipse?project=jdk")

val extension = if (os.isWindows) "zip" else "tar.gz"
dest(layout.buildDirectory.file("jdk-$platform-$arch.$extension"))
overwrite(false)
}
tasks.register<Copy>("unzipJDK") {
val dl = tasks.findByPath("downloadJDK") as Download
dependsOn(dl)

val os: OperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
val archive = if (os.isWindows) {
zipTree(dl.dest)
} else {
tarTree(dl.dest)
}

from(archive)
into(layout.buildDirectory.dir("resources-bundled/common"))
}
afterEvaluate {
tasks.findByName("prepareAppResources")?.dependsOn("unzipJDK")
tasks.register("setExecutablePermissions") {
description = "Sets executable permissions on binaries in Processing.app resources"
group = "compose desktop"

doLast {
val resourcesPath = layout.buildDirectory.dir("compose/binaries")
fileTree(resourcesPath) {
include("**/resources/**/bin/**")
include("**/resources/**/*.sh")
include("**/resources/**/*.dylib")
include("**/resources/**/*.so")
include("**/resources/**/*.exe")
}.forEach { file ->
if (file.isFile) {
file.setExecutable(true, false)
}
}
}
}
tasks.findByName("createDistributable")?.finalizedBy("setExecutablePermissions")
}
Loading
Loading