rename app ID from app.timesafari.app to app.timesafari & adjust tests (Java 20 works)

This commit is contained in:
2025-03-16 17:28:47 -06:00
parent 6c538de762
commit 2337dc64e0
7 changed files with 10 additions and 36 deletions

Binary file not shown.

View File

@@ -1,10 +1,10 @@
apply plugin: 'com.android.application'
android {
namespace "app.timesafari.app"
namespace "app.timesafari"
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "app.timesafari.app"
applicationId "app.timesafari"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1

View File

@@ -15,6 +15,6 @@ public class ExampleInstrumentedTest {
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("app.timesafari.app", appContext.getPackageName());
assertEquals("app.timesafari", appContext.getPackageName());
}
}

View File

@@ -1,26 +0,0 @@
package com.getcapacitor.myapp;
import static org.junit.Assert.*;
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.getcapacitor.app", appContext.getPackageName());
}
}

View File

@@ -77,13 +77,12 @@ const checkConnectedDevices = async (log) => {
// Verify Java installation
const verifyJavaInstallation = (log) => {
log('🔍 Checking Java version...');
const javaHome = '/usr/lib/jvm/java-17-openjdk';
log('🔍 Checking Java...');
const javaHome = process.env.JAVA_HOME;
if (!existsSync(javaHome)) {
throw new Error(`Required Java 17 not found at ${javaHome}. Please install OpenJDK 17.`);
throw new Error(`Required Java not found at ${javaHome}. Please install OpenJDK.`);
}
log('✅ Java 17 found');
return { JAVA_HOME: javaHome };
log('✅ Java found');
};
// Generate test data using generate_data.ts
@@ -265,9 +264,10 @@ async function runAndroidTests() {
await generateTestData(log);
await checkConnectedDevices(log);
const env = { ...process.env, ...verifyJavaInstallation(log) };
await verifyJavaInstallation(log);
await buildWebAssets(log);
await configureAndroidProject(log);
const env = process.env;
await buildAndTestAndroid(log, env);
await runAndroidApp(log, env);

View File

@@ -74,7 +74,7 @@ execute_deeplink() {
echo "---"
else
# Stop the app before executing the deep link
adb shell am force-stop app.timesafari.app
adb shell am force-stop app.timesafari
sleep 1 # Give it a moment to fully stop
if adb shell am start -W -a android.intent.action.VIEW \