Skip to content

Commit ead6dad

Browse files
authored
Upgrade build tools and bump to latest libpd (#124)
* Upgrade build tools * Fix #118 - Update libpd submodule reference * Raise minimum API level to 28 due to 'glob' function usage in libpd
1 parent 459edb6 commit ead6dad

File tree

19 files changed

+221
-186
lines changed

19 files changed

+221
-186
lines changed

.github/workflows/android.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v3
22+
with:
23+
java-version: '17'
24+
distribution: 'adopt'
2025
- run: |
2126
git submodule sync --recursive
2227
git submodule update --init --recursive

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "PdCore/src/main/jni/libpd"]
22
path = PdCore/src/main/jni/libpd
3-
url = git://github.com/libpd/libpd.git
3+
url = https://github.com/libpd/libpd.git

CircleOfFifths/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ android {
88
compileSdkVersion rootProject.compileSdkVersion
99
buildToolsVersion rootProject.buildToolsVersion
1010
ndkVersion rootProject.ndkVersion
11+
namespace = 'org.puredata.android.fifths'
1112

1213
defaultConfig {
1314
applicationId "org.puredata.android.fifths"

CircleOfFifths/src/org/puredata/android/fifths/CircleOfFifths.java

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,17 @@ public void setTop(int top) {
129129
@Override
130130
public void onClick(View v) {
131131
int newOption;
132-
switch (v.getId()) {
133-
case R.id.domdim:
132+
int id = v.getId();
133+
if (id == R.id.domdim) {
134134
newOption = 2;
135-
break;
136-
case R.id.majmin:
135+
} else if (id == R.id.majmin) {
137136
newOption = 4;
138-
break;
139-
case R.id.sixth:
137+
} else if (id == R.id.sixth) {
140138
newOption = 6;
141-
break;
142-
case R.id.susp:
139+
} else if (id == R.id.susp) {
143140
newOption = 8;
144-
break;
145-
default:
141+
} else {
146142
newOption = 0;
147-
break;
148143
}
149144
if (option == newOption) {
150145
resetOptions();
@@ -168,17 +163,13 @@ public boolean onCreateOptionsMenu(Menu menu) {
168163
@Override
169164
public boolean onOptionsItemSelected(MenuItem item) {
170165
AlertDialog.Builder ad = new AlertDialog.Builder(this);
171-
switch (item.getItemId()) {
172-
case R.id.about_item:
166+
int itemId = item.getItemId();
167+
if (itemId == R.id.about_item) {
173168
ad.setTitle(R.string.about_title);
174169
ad.setMessage(R.string.about_msg);
175-
break;
176-
case R.id.help_item:
170+
} else if (itemId == R.id.help_item) {
177171
ad.setTitle(R.string.help_title);
178172
ad.setMessage(R.string.help_msg);
179-
break;
180-
default:
181-
break;
182173
}
183174
ad.setNeutralButton(android.R.string.ok, null);
184175
ad.setCancelable(true);

PdCore/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ android {
1818
compileSdkVersion rootProject.compileSdkVersion
1919
buildToolsVersion rootProject.buildToolsVersion
2020
ndkVersion rootProject.ndkVersion
21+
namespace = 'org.puredata.android.service'
2122

2223
defaultConfig {
2324
minSdkVersion rootProject.minSdkVersion

PdCore/src/main/jni/Application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
APP_PLATFORM := android-17
1+
APP_PLATFORM := android-28
22
APP_OPTIM := release
33
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64

PdCore/src/main/jni/libpd

Submodule libpd updated 120 files

PdTest/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ android {
1111
compileSdkVersion rootProject.compileSdkVersion
1212
buildToolsVersion rootProject.buildToolsVersion
1313
ndkVersion rootProject.ndkVersion
14+
namespace = 'org.puredata.android.test'
1415

1516
defaultConfig {
1617
minSdkVersion rootProject.minSdkVersion

PdTest/src/org/puredata/android/test/PdTest.java

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,13 @@ public boolean onCreateOptionsMenu(Menu menu) {
231231

232232
@Override
233233
public boolean onOptionsItemSelected(MenuItem item) {
234-
switch (item.getItemId()) {
235-
case R.id.about_item:
234+
if (item.getItemId() == R.id.about_item) {
236235
AlertDialog.Builder ad = new AlertDialog.Builder(this);
237236
ad.setTitle(R.string.about_title);
238237
ad.setMessage(R.string.about_msg);
239238
ad.setNeutralButton(android.R.string.ok, null);
240239
ad.setCancelable(true);
241240
ad.show();
242-
break;
243-
default:
244-
break;
245241
}
246242
return true;
247243
}
@@ -258,29 +254,25 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String permissi
258254

259255
@Override
260256
public void onClick(View v) {
261-
switch (v.getId()) {
262-
case R.id.play_button:
257+
int id = v.getId();
258+
if (id == R.id.play_button) {
263259
if (pdService.isRunning()) {
264260
stopAudio();
265261
} else if (recordAudioPermissionGranted()) {
266262
startAudio();
267263
} else {
268264
requestAudioPermission();
269265
}
270-
case R.id.left_box:
266+
267+
PdBase.sendFloat("left", left.isChecked() ? 1 : 0);
268+
} else if (id == R.id.left_box) {
271269
PdBase.sendFloat("left", left.isChecked() ? 1 : 0);
272-
break;
273-
case R.id.right_box:
270+
} else if (id == R.id.right_box) {
274271
PdBase.sendFloat("right", right.isChecked() ? 1 : 0);
275-
break;
276-
case R.id.mic_box:
272+
} else if (id == R.id.mic_box) {
277273
PdBase.sendFloat("mic", mic.isChecked() ? 1 : 0);
278-
break;
279-
case R.id.pref_button:
274+
} else if (id == R.id.pref_button) {
280275
startActivity(new Intent(this, PdPreferences.class));
281-
break;
282-
default:
283-
break;
284276
}
285277
}
286278

ScenePlayer/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ android {
1010
compileSdkVersion rootProject.compileSdkVersion
1111
buildToolsVersion rootProject.buildToolsVersion
1212
ndkVersion rootProject.ndkVersion
13+
namespace = 'org.puredata.android.scenes'
1314

1415
defaultConfig {
1516
minSdkVersion rootProject.minSdkVersion

ScenePlayer/src/com/lamerman/FileDialog.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ protected void onListItemClick(ListView l, View v, int position, long id) {
155155
lastPositions.put(currentPath, position);
156156
getDir(path.get(position));
157157
} else {
158-
new AlertDialog.Builder(this).setIcon(R.drawable.icon).setTitle(
158+
new AlertDialog.Builder(this)
159+
.setIcon(org.puredata.android.service.R.drawable.icon)
160+
.setTitle(
159161
"[" + selectedFile.getName() + "] "
160162
+ getText(R.string.cant_read_folder))
161163
.setPositiveButton("OK",

ScenePlayer/src/org/puredata/android/scenes/SceneSelection.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,13 @@ public boolean onCreateOptionsMenu(Menu menu) {
217217
@Override
218218
public boolean onOptionsItemSelected(MenuItem item) {
219219
AlertDialog.Builder ad = new AlertDialog.Builder(this);
220-
switch (item.getItemId()) {
221-
case R.id.selection_about_item:
220+
int itemId = item.getItemId();
221+
if (itemId == R.id.selection_about_item) {
222222
ad.setTitle(R.string.selection_about_title);
223223
ad.setMessage(R.string.selection_about_msg);
224-
break;
225-
case R.id.selection_help_item:
224+
} else if (itemId == R.id.selection_help_item) {
226225
ad.setTitle(R.string.selection_help_title);
227226
ad.setMessage(R.string.selection_help_msg);
228-
break;
229-
default:
230-
break;
231227
}
232228
ad.setNeutralButton(android.R.string.ok, null);
233229
ad.setCancelable(true);

Voice-O-Rama/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dependencies {
77
android {
88
compileSdkVersion rootProject.compileSdkVersion
99
buildToolsVersion rootProject.buildToolsVersion
10+
namespace = 'at.or.at.voiceorama'
1011

1112
defaultConfig {
1213
minSdkVersion rootProject.minSdkVersion

Voice-O-Rama/src/at/or/at/voiceorama/VoiceORama.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,13 @@ public boolean onCreateOptionsMenu(Menu menu) {
207207

208208
@Override
209209
public boolean onOptionsItemSelected(MenuItem item) {
210-
switch (item.getItemId()) {
211-
case R.id.about_item:
210+
if (item.getItemId() == R.id.about_item) {
212211
AlertDialog.Builder ad = new AlertDialog.Builder(this);
213212
ad.setTitle(R.string.about_title);
214213
ad.setMessage(R.string.about_msg);
215214
ad.setNeutralButton(android.R.string.ok, null);
216215
ad.setCancelable(true);
217216
ad.show();
218-
break;
219-
default:
220-
break;
221217
}
222218
return true;
223219
}

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:4.1.3'
7+
classpath 'com.android.tools.build:gradle:8.0.2'
88
}
99
}
1010

@@ -39,9 +39,9 @@ allprojects {
3939
}
4040

4141
ext {
42-
minSdkVersion = 17
43-
compileSdkVersion = 30
44-
buildToolsVersion = '30.0.2'
42+
minSdkVersion = 28
43+
compileSdkVersion = 34
44+
buildToolsVersion = '34.0.0'
4545
androidxLegacySupportVersion = '1.0.0'
46-
ndkVersion = '21.4.7075529' // https://developer.android.com/ndk/downloads#lts-downloads
46+
ndkVersion = '25.2.9519653' // https://developer.android.com/ndk/downloads#lts-downloads
4747
}

gradle/wrapper/gradle-wrapper.jar

2.63 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)