diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml index a9f4e522a7..c8b16c8c4b 100644 --- a/android/.idea/gradle.xml +++ b/android/.idea/gradle.xml @@ -10,6 +10,7 @@ diff --git a/android/embedded/.gitignore b/android/embedded/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/android/embedded/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/android/embedded/build.gradle b/android/embedded/build.gradle new file mode 100644 index 0000000000..741f859e6e --- /dev/null +++ b/android/embedded/build.gradle @@ -0,0 +1,40 @@ +plugins { + id 'com.android.library' + id 'org.jetbrains.kotlin.android' +} + +android { + compileSdk 32 + + defaultConfig { + minSdk 24 + targetSdk 32 + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles "consumer-rules.pro" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'com.google.android.material:material:1.8.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/android/embedded/consumer-rules.pro b/android/embedded/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/android/embedded/proguard-rules.pro b/android/embedded/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/android/embedded/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/android/embedded/src/androidTest/java/org/firebirdsql/android/embedded/ExampleInstrumentedTest.kt b/android/embedded/src/androidTest/java/org/firebirdsql/android/embedded/ExampleInstrumentedTest.kt new file mode 100644 index 0000000000..6706fd7d8d --- /dev/null +++ b/android/embedded/src/androidTest/java/org/firebirdsql/android/embedded/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package org.firebirdsql.android.embedded + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("org.firebirdsql.android.embedded.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/android/embedded/src/main/AndroidManifest.xml b/android/embedded/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..cd95b76fa2 --- /dev/null +++ b/android/embedded/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/android/embedded/src/test/java/org/firebirdsql/android/embedded/ExampleUnitTest.kt b/android/embedded/src/test/java/org/firebirdsql/android/embedded/ExampleUnitTest.kt new file mode 100644 index 0000000000..ca3deaf462 --- /dev/null +++ b/android/embedded/src/test/java/org/firebirdsql/android/embedded/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package org.firebirdsql.android.embedded + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/android/settings.gradle b/android/settings.gradle index 0a2caa3023..cf1a85ff65 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -14,3 +14,4 @@ dependencyResolutionManagement { } rootProject.name = "Firebird for Android" include ':app' +include ':embedded'