Skip to content

Commit

Permalink
[Simulator/Android] Bump to latest dependencies + other improvements (#…
Browse files Browse the repository at this point in the history
…376)

Co-authored-by: mickbot-92 <e3rck4b4[at]duck[dot]com>

* Bumping to latest stable dependencies and Gradle.
  * [CI] Building with JDK 21 instead of with JDK 11 (JDK 17 works fine too if you remove the latest line of build.gradle).
  * Using `mavenCentral()` instead of [deprecated](https://docs.gradle.org/current/userguide/upgrading_version_6.html#jcenter_deprecation) `jcenter()`
* Removing useless Google plugins.
* Setting `compileSdk` to 33 : Upsilon no longer requires the Notification permission.
* versionCode : compiling with the current Unix/Epoch timestamp.
* versionName : using the `UPSILON_VERSION` variable instead of the Omega one + adding the date of compiling.
* Some improvements about icons.
* [CI] Using the latests `uses: ` to make the warning about NodeJS deprecation disappear.

Many thanks to @Yaya-Cout (and to @pi-dev500 too :) 🫡
  • Loading branch information
mickbot-92 authored Oct 20, 2024
1 parent 89def88 commit 172f168
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Build the Docker image
Expand Down
53 changes: 29 additions & 24 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fxcg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install dependencies
Expand All @@ -36,7 +36,7 @@ jobs:
id: get-latest-commit-hash
- name: Cache gint/fxsdk installation
id: cache-gint
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.local/*/*
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
path: 'output/release/simulator/fxcg/epsilon.g3a'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon.g3a
path: output/release/simulator/fxcg/epsilon.g3a
Expand All @@ -81,7 +81,7 @@ jobs:
runs-on: ubuntu-latest
container: devkitpro/devkitarm:latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: true
- run: sudo apt-get update
Expand All @@ -94,20 +94,25 @@ jobs:
- run: echo "PATH=.:$PATH" >> $GITHUB_ENV
- run: make -j2 PLATFORM=simulator TARGET=3ds
- run: make -j2 PLATFORM=simulator TARGET=3ds epsilon.cia
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-3ds.3dsx
path: output/release/simulator/3ds/epsilon.3dsx
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-3ds.cia
path: output/release/simulator/3ds/epsilon.cia
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- run: wget -nv https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip
- run: unzip -q android-ndk-r21e-linux-x86_64.zip
- run: make -j2 PLATFORM=simulator TARGET=android NDK_PATH=./android-ndk-r21e
Expand All @@ -123,7 +128,7 @@ jobs:
path: 'output/release/simulator/android/epsilon.apk'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-android.apk
path: output/release/simulator/android/epsilon.apk
Expand All @@ -132,7 +137,7 @@ jobs:
steps:
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- uses: numworks/setup-arm-toolchain@2020-q2
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: mkdir final-output
Expand Down Expand Up @@ -176,7 +181,7 @@ jobs:
path: 'final-output/'
destination: 'upsilon-binfiles.appspot.com/dev/n100/'
parent: false
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-binpack-n0100.tgz
path: binpack-n0100.tgz
Expand All @@ -185,7 +190,7 @@ jobs:
steps:
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- uses: numworks/setup-arm-toolchain@2020-q2
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: make -j2 MODEL=n0110 epsilon.dfu
Expand All @@ -211,7 +216,7 @@ jobs:
path: 'output/release/device/n0110/binpack/'
destination: 'upsilon-binfiles.appspot.com/dev/n110/'
parent: false
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-binpack-n0110.tgz
path: output/release/device/n0110/binpack-n0110.tgz
Expand All @@ -220,7 +225,7 @@ jobs:
steps:
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- uses: numworks/setup-arm-toolchain@2022-08
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: make -j2 MODEL=n0110 bootloader
Expand Down Expand Up @@ -249,7 +254,7 @@ jobs:
path: 'output/release/device/bootloader/binpack/'
destination: 'upsilon-binfiles.appspot.com/dev/n110/'
parent: false
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-binpack-bootloader.tgz
path: output/release/device/bootloader/binpack-bootloader.tgz
Expand All @@ -260,7 +265,7 @@ jobs:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config make mingw-w64-x86_64-python3 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng
Expand All @@ -279,7 +284,7 @@ jobs:
path: 'output/release/simulator/windows/epsilon.exe'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-windows.exe
path: output/release/simulator/windows/epsilon.exe
Expand All @@ -289,7 +294,7 @@ jobs:
- uses: numworks/setup-emscripten@master
with:
sdk: latest
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: make -j2 PLATFORM=simulator TARGET=web
Expand All @@ -307,15 +312,15 @@ jobs:
path: 'output/release/simulator/web/epsilon.js'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-web.zip
path: output/release/simulator/web/epsilon.zip
linux:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: make -j2 PLATFORM=simulator
Expand All @@ -333,7 +338,7 @@ jobs:
path: 'output/release/simulator/linux/epsilon.bin'
destination: 'upsilon-binfiles.appspot.com/dev/simulator/'
parent: false
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-linux.bin
path: output/release/simulator/linux/epsilon.bin
Expand All @@ -342,13 +347,13 @@ jobs:
runs-on: macOS-latest
steps:
- run: brew install numworks/tap/epsilon-sdk
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: make -j2 PLATFORM=simulator
- run: make -j2 PLATFORM=simulator ARCH=x86_64 test.bin
- run: output/release/simulator/macos/x86_64/test.bin --headless
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-macos.zip
path: output/release/simulator/macos/epsilon.app
Expand All @@ -357,12 +362,12 @@ jobs:
runs-on: macOS-latest
steps:
- run: brew install numworks/tap/epsilon-sdk
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- run: make -j2 PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0
- run: make -j2 PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 APPLE_PLATFORM=ios-simulator
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: epsilon-ios.ipa
path: output/release/simulator/ios/epsilon.ipa
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/metric-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
- name: Install ARM toolchain
uses: numworks/setup-arm-toolchain@2020-q2
- name: Checkout PR base
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.event.pull_request.base.sha }}
path: base
- name: Build base
run: make -j2 -C base MODEL=n0110 epsilon.elf
- name: Checkout PR head
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.event.pull_request.head.sha }}
Expand All @@ -29,7 +29,7 @@ jobs:
id: binary_size
run: echo "::set-output name=table::$(python3 head/build/metrics/binary_size.py base/output/release/device/n0110/epsilon.elf head/output/release/device/n0110/epsilon.elf --labels Base Head --sections .text .rodata .bss .data --custom 'Total (RAM)' .data .bss --custom 'Total (ROM)' .text .rodata .data --escape)"
- name: Add comment
uses: actions/github-script@v3.0.0
uses: actions/github-script@v7
with:
script: |
await github.issues.createComment({
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ git checkout upsilon-dev

```bash
make MODEL=n0100 clean
make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j(nproc)
make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc)
```

Now, run either:
Expand All @@ -280,7 +280,7 @@ to directly flash the calculator after pressing simultaneously `reset` and `6` b
or:

```bash
make MODEL=n0100 OMEGA_USERNAME="" binpack -j(nproc)
make MODEL=n0100 OMEGA_USERNAME="" binpack -j$(nproc)
```

to make binpack which you can flash to the calculator from [TI-Planet's WebDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Binpacks are a great way to share a custom build of Upsilon to friends.
Expand Down Expand Up @@ -417,7 +417,7 @@ You need devkitPro and devkitARM installed and in your path (instructions [here]
git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git
cd Upsilon
git checkout upsilon-dev
make PLATFORM=simulator TARGET=3ds -j(nproc)
make PLATFORM=simulator TARGET=3ds -j$(nproc)
```

You can then put epsilon.3dsx on a SD card to run it from the HBC or use 3dslink to launch it over the network:
Expand Down
6 changes: 3 additions & 3 deletions ion/src/simulator/android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ ifndef ARCH

$(BUILD_DIR)/app/res/mipmap/ic_launcher.png: ion/src/simulator/assets/logo.svg | $$(@D)/.
$(call rule_label,CONVERT)
$(Q) convert -background "#b1403b" $< $@
$(Q) convert -background "#5c83ab" $< $@

$(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_foreground.png: ion/src/simulator/assets/logo.svg | $$(@D)/.
$(call rule_label,CONVERT)
$(Q) convert -background none $< -resize 1024x1024 -gravity center -background none -extent 1024x1024 $@
$(Q) convert -background none $< -resize 694x694 -gravity center -background none -extent 1024x1024 $@

$(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_monochrome.png: ion/src/simulator/assets/logo_monochrome.svg | $$(@D)/.
$(call rule_label,CONVERT)
Expand Down Expand Up @@ -68,7 +68,7 @@ apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/

$(BUILD_DIR)/%.apk: $(apk_deps)
$(call rule_label,GRADLE)
$(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) OMEGA_VERSION=$(OMEGA_VERSION) BUILD_DIR=$(BUILD_DIR) EPSILON_VARIANT=$* ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle assembleRelease
$(Q) ANDROID_HOME=$(ANDROID_HOME) UPSILON_VERSION=$(UPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) EPSILON_VARIANT=$* ion/src/simulator/android/gradlew -p ion/src/simulator/android assembleRelease
$(Q) cp $(BUILD_DIR)/app/outputs/apk/release/android-release*.apk $@

endif
26 changes: 14 additions & 12 deletions ion/src/simulator/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ def fileIfPath(path) {

buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.android.tools.build:gradle:8.7.1'
}
}

allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
buildDir = BUILD_DIR
Expand All @@ -32,14 +31,15 @@ allprojects {
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
namespace = "io.github.upsilon.simulator"
compileSdkVersion 35
defaultConfig {
applicationId "io.github.upsilon.simulator"
minSdkVersion 16
targetSdkVersion 29
def (major, minor, patch) = System.getenv('OMEGA_VERSION').toLowerCase().tokenize('.').collect{it.toInteger()}
versionCode major*1000000 + minor*10000 + patch * 100
versionName System.getenv('OMEGA_VERSION')
minSdkVersion 21
targetSdkVersion 33
def d=new Date()
versionCode Instant.now().getEpochSecond().toInteger()
versionName LocalDate.now().format("yyyyMMdd")+'-'+System.getenv('UPSILON_VERSION')
}
signingConfigs {
environment {
Expand Down Expand Up @@ -77,6 +77,8 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:1.0.2"
implementation "com.google.android.gms:play-services-analytics:16.0.7"
implementation "androidx.appcompat:appcompat:1.7.0"
implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.21"))
}

java{toolchain{languageVersion=JavaLanguageVersion.of(21)}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion ion/src/simulator/android/src/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.upsilon.simulator"
android:installLocation="auto">

<uses-feature android:glEsVersion="0x00020000" />
Expand All @@ -23,6 +22,7 @@
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
import android.provider.Settings;
import android.util.Log;

import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
import com.google.android.gms.analytics.HitBuilders;

import org.libsdl.app.SDLActivity;
import org.libsdl.app.SDL;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/yellow" />
<background android:drawable="@color/blue" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>
Loading

0 comments on commit 172f168

Please sign in to comment.