commit 08614ef4542d9d02d53e2bec2572c4b04ab86d6e
parent 53359170f6b9cb6d37f31eab835563db4355f4ff
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Sat, 16 Sep 2023 23:30:29 +0200
SourceVersion stub
Diffstat:
5 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/core/build.gradle.kts b/core/build.gradle.kts
@@ -41,6 +41,7 @@ dependencies {
implementation(libs.androidx.documentfile)
implementation(libs.rhino)
+ implementation(project(":stub"))
implementation(project(":mapper"))
implementation(project(":native"))
}
\ No newline at end of file
diff --git a/settings.gradle.kts b/settings.gradle.kts
@@ -21,3 +21,4 @@ include(":core")
include(":app")
include(":mapper")
include(":native")
+include(":stub")+
\ No newline at end of file
diff --git a/stub/.gitignore b/stub/.gitignore
@@ -0,0 +1 @@
+/build+
\ No newline at end of file
diff --git a/stub/build.gradle.kts b/stub/build.gradle.kts
@@ -0,0 +1,14 @@
+plugins {
+ alias(libs.plugins.androidLibrary)
+ alias(libs.plugins.kotlinAndroid)
+}
+
+
+android {
+ namespace = rootProject.ext["applicationId"].toString() + ".stub"
+ compileSdk = 34
+
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+}
diff --git a/stub/src/main/java/javax/lang/model/SourceVersion.java b/stub/src/main/java/javax/lang/model/SourceVersion.java
@@ -0,0 +1,23 @@
+package javax.lang.model;
+
+// Rhino misses this class in the android platform
+@SuppressWarnings("unused")
+public enum SourceVersion {
+ RELEASE_0,
+ RELEASE_1,
+ RELEASE_2,
+ RELEASE_3,
+ RELEASE_4,
+ RELEASE_5,
+ RELEASE_6,
+ RELEASE_7,
+ RELEASE_8,
+ RELEASE_9,
+ RELEASE_10,
+ RELEASE_11;
+
+ @SuppressWarnings("unused")
+ public static SourceVersion latestSupported() {
+ return RELEASE_8;
+ }
+}