Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions .github/actions/create/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Setup & Build Android Mode"
description: "Setup and build the Processing Android Mode"
runs:
using: "composite"
steps:
- name: Install Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Build with Gradle
shell: bash
run: |
echo sdk.dir=/usr/local/lib/android/sdk/ >> local.properties
./gradlew libs:processing-core:build

- name: Create the mode
shell: bash
run: |
cd processing
echo sdk.dir=/usr/local/lib/android/sdk/ >> local.properties
./gradlew dist
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Branch Builds
on:
push:
paths-ignore:
- '**/*.md'
- '.all-contributorsrc'

jobs:
build:
name: Build Android Mode
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup and Build Android Mode
uses: ./.github/actions/create

- name: Add artifact
uses: actions/upload-artifact@v4
with:
name: AndroidMode
path: ./processing/dist/AndroidMode.zip
retention-days: 1
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Releases
on:
workflow_dispatch:
inputs:
version_number:
description: "What is the version number?"
required: true
version_pretty:
description: "What is the pretty version name?"
required: true

jobs:
build:
name: Build Android Mode Release
runs-on: ubuntu-latest
permissions:
packages: write
contents: write

steps:
- name: Checkout Repository
uses: actions/checkout@v4

# replace the version numbers in ./processing/mode/mode.properties
- name: Set Version Number
run: |
VERSION_NUMBER=${{ github.event.inputs.version_number }}
VERSION_PRETTY=${{ github.event.inputs.version_pretty }}
echo "Setting version to $VERSION_NUMBER ($VERSION_PRETTY)"
sed -i "s/^version=.*$/version=$VERSION_NUMBER/" ./processing/mode/mode.properties
sed -i "s/^prettyVersion=.*$/prettyVersion=$VERSION_PRETTY/" ./processing/mode/mode.properties
cat ./processing/mode/mode.properties

- name: Setup and Build Android Mode
uses: ./.github/actions/create

- name: Add artifact
uses: actions/upload-artifact@v4
with:
name: AndroidMode
path: ./processing/dist/AndroidMode.zip
retention-days: 1

- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: Release Android Mode ${{ github.event.inputs.version_number }} (${{ github.event.inputs.version_pretty }})
file: ./processing/dist/*
file_glob: true
make_latest: true
tag: android-${{ github.event.inputs.version_number }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.gradle
.idea
!.idea/icon.svg

**/examples/**/AndroidManifest.xml

Expand Down
5 changes: 5 additions & 0 deletions .idea/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
android.enableJetifier=true
android.useAndroidX=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx4g
43 changes: 24 additions & 19 deletions processing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,26 @@ task dist {
FileUtils.copyDirectory(file("mode/tools/SDKUpdater/src"),
file("${root}/tools/SDKUpdater/src"))

FileUtils.copyDirectory(file("mode/libraries/vr/examples"),
file("${root}/libraries/vr/examples"))
FileUtils.copyDirectory(file("mode/libraries/vr/library"),
file("${root}/libraries/vr/library"))
FileUtils.copyDirectory(file("mode/libraries/vr/libs"),
file("${root}/libraries/vr/libs"))
FileUtils.copyDirectory(file("../libs/processing-vr/src/main/java/"),
file("${root}/libraries/vr/src"))
Files.copy(file("mode/libraries/vr/library.properties").toPath(),
file("${root}/libraries/vr/library.properties").toPath(), REPLACE_EXISTING)

FileUtils.copyDirectory(file("mode/libraries/ar/examples"),
file("${root}/libraries/ar/examples"))
FileUtils.copyDirectory(file("mode/libraries/ar/library"),
file("${root}/libraries/ar/library"))
FileUtils.copyDirectory(file("../libs/processing-ar/src/main/java/"),
file("${root}/libraries/ar/src"))
Files.copy(file("mode/libraries/ar/library.properties").toPath(),
file("${root}/libraries/ar/library.properties").toPath(), REPLACE_EXISTING)
// FileUtils.copyDirectory(file("mode/libraries/vr/examples"),
// file("${root}/libraries/vr/examples"))
// FileUtils.copyDirectory(file("mode/libraries/vr/library"),
// file("${root}/libraries/vr/library"))
// FileUtils.copyDirectory(file("mode/libraries/vr/libs"),
// file("${root}/libraries/vr/libs"))
// FileUtils.copyDirectory(file("../libs/processing-vr/src/main/java/"),
// file("${root}/libraries/vr/src"))
// Files.copy(file("mode/libraries/vr/library.properties").toPath(),
// file("${root}/libraries/vr/library.properties").toPath(), REPLACE_EXISTING)

// FileUtils.copyDirectory(file("mode/libraries/ar/examples"),
// file("${root}/libraries/ar/examples"))
// FileUtils.copyDirectory(file("mode/libraries/ar/library"),
// file("${root}/libraries/ar/library"))
// FileUtils.copyDirectory(file("../libs/processing-ar/src/main/java/"),
// file("${root}/libraries/ar/src"))

// Files.copy(file("mode/libraries/ar/library.properties").toPath(),
// file("${root}/libraries/ar/library.properties").toPath(), REPLACE_EXISTING)

File distFolder = file("dist")
distFolder.mkdirs()
Expand All @@ -173,3 +174,7 @@ task dist {
file("dist/AndroidMode.txt").toPath(), REPLACE_EXISTING)
}
}

tasks.register('develop') {
dependsOn tasks.dist
}
4 changes: 4 additions & 0 deletions processing/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ dependencies {
implementation name: "android"
implementation "androidx.legacy:legacy-support-v4:${v4legacyVersion}"
implementation "com.google.android.support:wearable:${wearVersion}"
// all jars in the libs folder
implementation fileTree(dir: "${rootDir}/build/libs", include: ['*.jar'])

}

sourceSets.main {
Expand Down Expand Up @@ -61,6 +64,7 @@ tasks.named('clean').configure {
}

tasks.named('compileJava').configure {
dependsOn(tasks.named("extractAarJars"))
doFirst {
String[] deps = ["wearable.jar"]
deps.each { fn ->
Expand Down
2 changes: 1 addition & 1 deletion processing/mode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
implementationCopy "org.slf4j:slf4j-api:${slf4jVersion}"
implementationCopy "org.slf4j:slf4j-simple:${slf4jVersion}"

implementation fileTree(include: ["jdi.jar", "jdimodel.jar", "core.jar", "pde.jar", "JavaMode.jar"], dir: 'mode')
implementation fileTree(include: ["jdi.jar", "jdimodel.jar", "core.jar", "pde.jar", "JavaMode.jar", "gradle-tooling-api-7.2.jar"], dir: 'mode')
}

// This task copies the gradle tooling jar into the mode folder
Expand Down
16 changes: 8 additions & 8 deletions processing/mode/mode.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name = Android Mode for Processing 4
authorList = [The Processing Foundation](https://processingfoundation.org/)
url = https://android.processing.org
sentence = This mode lets you use Processing to create Android apps
name=Android Mode for Processing 4
authorList=[The Processing Foundation](https://processingfoundation.org/)
url=https://android.processing.org
sentence=This mode lets you use Processing to create Android apps
paragraph =
imports=processing.mode.java.JavaMode
version = 412
prettyVersion = 4.6.0
minRevision = 1283
maxRevision = 0
minRevision=1283
maxRevision=0
version=412
prettyVersion=4.6.0
2 changes: 1 addition & 1 deletion processing/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include ':mode', ':core', ':mode:libraries:vr', ':mode:libraries:ar', 'mode:tools:SDKUpdater'
include ':mode', ':core', 'mode:tools:SDKUpdater'