@elurjs/android 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/index.mjs +11 -0
- package/package.json +29 -4
- package/template/.gitkeep +0 -0
- package/template/app/build.gradle.kts +192 -0
- package/template/app/proguard-rules-elur.pro +12 -0
- package/template/app/proguard-rules.pro +3 -0
- package/template/app/src/main/AndroidManifest.xml +81 -0
- package/template/app/src/main/assets/oss-notices.txt +153 -0
- package/template/app/src/main/assets/tck_pixel.png +0 -0
- package/template/app/src/main/cpp/CMakeLists.txt +117 -0
- package/template/app/src/main/cpp/dlEncoder.h +117 -0
- package/template/app/src/main/cpp/dlEncoderJsi.cpp +315 -0
- package/template/app/src/main/cpp/dlEncoderQjs.cpp +394 -0
- package/template/app/src/main/cpp/dlOps.inc +145 -0
- package/template/app/src/main/cpp/elurBridge.cpp +1350 -0
- package/template/app/src/main/cpp/elurBridgeHermes.cpp +1294 -0
- package/template/app/src/main/cpp/elurSkia.cpp +287 -0
- package/template/app/src/main/cpp/elurSkiaTree.cpp +448 -0
- package/template/app/src/main/cpp/elurUiWorklet.cpp +1233 -0
- package/template/app/src/main/cpp/elurYoga.cpp +1060 -0
- package/template/app/src/main/cpp/elurYoga.h +82 -0
- package/template/app/src/main/cpp/hermes-libs/LICENSE +21 -0
- package/template/app/src/main/cpp/hermes-libs/arm64-v8a/libhermesvm.so +0 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/AsyncDebuggerAPI.h +276 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/CompileJS.h +97 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/DebuggerAPI.h +502 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/CrashManager.h +107 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/CtorConfig.h +145 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/DebuggerTypes.h +193 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/GCConfig.h +211 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/GCTripwireContext.h +40 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/HermesExport.h +14 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/JSOutOfMemoryError.h +27 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/RuntimeConfig.h +141 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/Public/SamplingProfiler.h +270 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/RuntimeTaskRunner.h +64 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/SynthTrace.h +1566 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/SynthTraceParser.h +37 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/ThreadSafetyAnalysis.h +75 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/TimerStats.h +23 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/TraceInterpreter.h +334 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/TracingRuntime.h +328 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/CDPAgent.h +131 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/CDPDebugAPI.h +73 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/CallbackOStream.h +89 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/ConsoleMessage.h +135 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/DebuggerDomainAgent.h +280 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/DebuggerDomainCoordinator.h +137 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/DomainAgent.h +107 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/DomainState.h +140 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/HeapProfilerDomainAgent.h +71 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/JSONValueInterfaces.h +40 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/MessageConverters.h +82 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/MessageInterfaces.h +72 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/MessageTypes.h +1279 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/MessageTypesInlines.h +313 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/ProfilerDomainAgent.h +38 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/RemoteObjectConverters.h +77 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/RemoteObjectsTable.h +127 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/cdp/RuntimeDomainAgent.h +138 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/Dummy.h +24 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/Extensions.h +20 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/ExtensionsBytecode.h +23 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/Intrinsics.h +44 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/JSIUtils.h +123 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/TextEncoder.h +29 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/contrib/ContribDummy.h +24 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/contrib/ContribExtensions.h +23 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/contrib/TextDecoder.h +30 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/extensions/contrib/TextDecoderUtils.h +113 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/hermes.h +242 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes/hermes_tracing.h +52 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_abi/HermesABIHelpers.h +295 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_abi/HermesABIRuntimeWrapper.h +25 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_abi/hermes_abi.h +642 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_abi/hermes_vtable.h +29 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/HermesSandboxRuntime.h +41 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_compiled.h +12 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_dbg_compiled-impl.h +8516 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_dbg_compiled.h +137 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_opt_compiled-impl.h +3945 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/hermes_sandbox_impl_opt_compiled.h +119 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/wasm-rt-fb.h +124 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/wasm-rt-impl.h +66 -0
- package/template/app/src/main/cpp/hermes-libs/include/hermes_sandbox/external/wasm-rt.h +456 -0
- package/template/app/src/main/cpp/hermes-libs/include/jsi/JSIDynamic.h +26 -0
- package/template/app/src/main/cpp/hermes-libs/include/jsi/decorator.h +1157 -0
- package/template/app/src/main/cpp/hermes-libs/include/jsi/hermes-interfaces.h +242 -0
- package/template/app/src/main/cpp/hermes-libs/include/jsi/instrumentation.h +132 -0
- package/template/app/src/main/cpp/hermes-libs/include/jsi/jsi-inl.h +434 -0
- package/template/app/src/main/cpp/hermes-libs/include/jsi/jsi.h +2266 -0
- package/template/app/src/main/cpp/hermes-libs/include/jsi/jsilib.h +59 -0
- package/template/app/src/main/cpp/hermes-libs/include/jsi/threadsafe.h +79 -0
- package/template/app/src/main/cpp/hermes-libs/jsi-impl/jsi.cpp +1111 -0
- package/template/app/src/main/cpp/hermes-libs/x86_64/libhermesvm.so +0 -0
- package/template/app/src/main/java/com/elur/universal/BinaryCodec.kt +121 -0
- package/template/app/src/main/java/com/elur/universal/DlDecoder.kt +260 -0
- package/template/app/src/main/java/com/elur/universal/DlOpsDecode.kt +158 -0
- package/template/app/src/main/java/com/elur/universal/ElurBoxDrawable.kt +161 -0
- package/template/app/src/main/java/com/elur/universal/ElurBridge.kt +238 -0
- package/template/app/src/main/java/com/elur/universal/ElurBridgeHermes.kt +223 -0
- package/template/app/src/main/java/com/elur/universal/ElurCanvasView.kt +202 -0
- package/template/app/src/main/java/com/elur/universal/ElurCryptoModule.kt +206 -0
- package/template/app/src/main/java/com/elur/universal/ElurCustomLayout.kt +185 -0
- package/template/app/src/main/java/com/elur/universal/ElurEditText.kt +17 -0
- package/template/app/src/main/java/com/elur/universal/ElurFontRegistry.kt +190 -0
- package/template/app/src/main/java/com/elur/universal/ElurHttpModule.kt +306 -0
- package/template/app/src/main/java/com/elur/universal/ElurImageService.kt +348 -0
- package/template/app/src/main/java/com/elur/universal/ElurLicensesActivity.kt +84 -0
- package/template/app/src/main/java/com/elur/universal/ElurListView.kt +954 -0
- package/template/app/src/main/java/com/elur/universal/ElurManifest.kt +117 -0
- package/template/app/src/main/java/com/elur/universal/ElurMetrics.kt +325 -0
- package/template/app/src/main/java/com/elur/universal/ElurModuleRegistrar.kt +14 -0
- package/template/app/src/main/java/com/elur/universal/ElurPermissionGate.kt +36 -0
- package/template/app/src/main/java/com/elur/universal/ElurRenderer.kt +6164 -0
- package/template/app/src/main/java/com/elur/universal/ElurRowYoga.kt +130 -0
- package/template/app/src/main/java/com/elur/universal/ElurScrollView.kt +240 -0
- package/template/app/src/main/java/com/elur/universal/ElurShellView.kt +117 -0
- package/template/app/src/main/java/com/elur/universal/ElurSkiaCanvasView.kt +162 -0
- package/template/app/src/main/java/com/elur/universal/ElurSkiaTreeRenderer.kt +968 -0
- package/template/app/src/main/java/com/elur/universal/ElurStateModule.kt +69 -0
- package/template/app/src/main/java/com/elur/universal/ElurSwipeDriver.kt +34 -0
- package/template/app/src/main/java/com/elur/universal/ElurTckModule.kt +99 -0
- package/template/app/src/main/java/com/elur/universal/ElurTextMeasure.kt +16 -0
- package/template/app/src/main/java/com/elur/universal/ElurTrace.kt +24 -0
- package/template/app/src/main/java/com/elur/universal/ElurUiModule.kt +48 -0
- package/template/app/src/main/java/com/elur/universal/ElurUiWorklet.kt +305 -0
- package/template/app/src/main/java/com/elur/universal/JsBridge.kt +67 -0
- package/template/app/src/main/java/com/elur/universal/JsThread.kt +189 -0
- package/template/app/src/main/java/com/elur/universal/MainActivity.kt +844 -0
- package/template/app/src/main/java/com/elur/universal/ModuleRegistry.kt +701 -0
- package/template/app/src/main/java/com/elur/universal/YogaRowScope.kt +97 -0
- package/template/app/src/main/res/values/ids.xml +10 -0
- package/template/app/src/main/res/values/strings.xml +8 -0
- package/template/app/src/main/res/values-es/strings.xml +5 -0
- package/template/app/src/main/res/xml/network_security_config.xml +10 -0
- package/template/build.gradle.kts +5 -0
- package/template/gradle/libs.versions.toml +12 -0
- package/template/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/template/gradle.properties +23 -0
- package/template/gradlew +251 -0
- package/template/gradlew.bat +94 -0
- package/template/settings.gradle.kts +32 -0
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @elurjs/android
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Android platform target for `@elurjs/universal` (Platform Views / Skia opt-in, QuickJS-ng / Hermes, Gradle template).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bunx elur add android
|
|
9
|
+
bun run dev:android
|
|
10
|
+
bun run build:android
|
|
11
|
+
```
|
package/index.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elurjs/android — descriptor del paquete de plataforma Android (ADR-0223).
|
|
3
|
+
* Expone la ruta de la plantilla Gradle/Kotlin/JNI para `elur add android`.
|
|
4
|
+
*/
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const pkgDir = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
|
|
10
|
+
/** Directorio de la plantilla Gradle empaquetada (`template/`). */
|
|
11
|
+
export const templateDir = join(pkgDir, "template");
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elurjs/android",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Elur Universal — Android target (Gradle/Kotlin/JNI template + ES5/Hermes toolchain).",
|
|
7
|
+
"main": "./index.mjs",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.mjs",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"index.mjs",
|
|
14
|
+
"template",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"prepack": "bun ../../cli/sync-platform-packages.mjs --only android"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@babel/core": "^8.0.5",
|
|
22
|
+
"@babel/parser": "8.0.5",
|
|
23
|
+
"@babel/preset-env": "^8.0.5"
|
|
24
|
+
},
|
|
25
|
+
"optionalDependencies": {
|
|
26
|
+
"hermes-compiler": "260318099.0.2"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@elurjs/universal": "0.2.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import java.util.Properties
|
|
2
|
+
|
|
3
|
+
plugins {
|
|
4
|
+
alias(libs.plugins.android.application)
|
|
5
|
+
alias(libs.plugins.kotlin.android)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
android {
|
|
9
|
+
namespace = "com.elur.universal"
|
|
10
|
+
compileSdk {
|
|
11
|
+
version = release(36)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
defaultConfig {
|
|
15
|
+
applicationId = "com.elur.natprobe"
|
|
16
|
+
minSdk = 24
|
|
17
|
+
targetSdk = 36
|
|
18
|
+
versionCode = 1
|
|
19
|
+
versionName = "1.0.0"
|
|
20
|
+
|
|
21
|
+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
22
|
+
|
|
23
|
+
ndk {
|
|
24
|
+
abiFilters += listOf("arm64-v8a", "x86_64")
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
externalNativeBuild {
|
|
28
|
+
cmake {
|
|
29
|
+
// c++_shared: DT_NEEDED de libhermesvm.so (Hermes V1)
|
|
30
|
+
arguments("-DANDROID_STL=c++_shared")
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// T-6: firma de release — keystore/release.properties (gitignored)
|
|
36
|
+
// o env ELUR_STORE_FILE/ELUR_STORE_PASSWORD/ELUR_KEY_ALIAS/
|
|
37
|
+
// ELUR_KEY_PASSWORD. Sin credenciales, release sigue firmado debug
|
|
38
|
+
// (perfil medible on-device — ADR-0083); la firma real nunca vive
|
|
39
|
+
// en el repo.
|
|
40
|
+
signingConfigs {
|
|
41
|
+
create("release") {
|
|
42
|
+
val props = Properties()
|
|
43
|
+
val propsFile = rootProject.file("keystore/release.properties")
|
|
44
|
+
if (propsFile.exists()) propsFile.inputStream().use { props.load(it) }
|
|
45
|
+
(props.getProperty("storeFile") ?: System.getenv("ELUR_STORE_FILE"))
|
|
46
|
+
?.let { storeFile = file(it) }
|
|
47
|
+
storePassword =
|
|
48
|
+
props.getProperty("storePassword") ?: System.getenv("ELUR_STORE_PASSWORD")
|
|
49
|
+
keyAlias =
|
|
50
|
+
props.getProperty("keyAlias") ?: System.getenv("ELUR_KEY_ALIAS")
|
|
51
|
+
keyPassword =
|
|
52
|
+
props.getProperty("keyPassword") ?: System.getenv("ELUR_KEY_PASSWORD")
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
buildTypes {
|
|
57
|
+
// ADR-0083: el id real lo lleva release; debug añade el sufijo
|
|
58
|
+
// .dev para que ambos convivan sin colisión de prefs/paquetas.
|
|
59
|
+
debug {
|
|
60
|
+
applicationIdSuffix = ".dev"
|
|
61
|
+
}
|
|
62
|
+
release {
|
|
63
|
+
// T-6: -Pelur.minify=true activa R8 + shrinkResources con las
|
|
64
|
+
// keep-rules generadas (proguard-rules-elur.pro — bindings y
|
|
65
|
+
// entry points JNI del shell).
|
|
66
|
+
isMinifyEnabled = (findProperty("elur.minify") as String?) == "true"
|
|
67
|
+
isShrinkResources = (findProperty("elur.minify") as String?) == "true"
|
|
68
|
+
val hasReleaseSigning =
|
|
69
|
+
rootProject.file("keystore/release.properties").exists() ||
|
|
70
|
+
System.getenv("ELUR_STORE_FILE") != null
|
|
71
|
+
signingConfig = signingConfigs.getByName(
|
|
72
|
+
if (hasReleaseSigning) "release" else "debug"
|
|
73
|
+
)
|
|
74
|
+
proguardFiles(
|
|
75
|
+
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
76
|
+
"proguard-rules.pro",
|
|
77
|
+
"proguard-rules-elur.pro"
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// T-6: -Pelur.splits=true → APK por ABI + universal; universal
|
|
83
|
+
// queda para distribución directa y los splits para Play/ABI-aware.
|
|
84
|
+
splits {
|
|
85
|
+
abi {
|
|
86
|
+
isEnable = (findProperty("elur.splits") as String?) == "true"
|
|
87
|
+
reset()
|
|
88
|
+
include("arm64-v8a", "x86_64")
|
|
89
|
+
isUniversalApk = true
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
compileOptions {
|
|
93
|
+
sourceCompatibility = JavaVersion.VERSION_11
|
|
94
|
+
targetCompatibility = JavaVersion.VERSION_11
|
|
95
|
+
}
|
|
96
|
+
buildFeatures {
|
|
97
|
+
// U13: BuildConfig.DEBUG gatea la superficie dev (extras de
|
|
98
|
+
// intent, /data/local/tmp, prefs persistidas) — release la cierra.
|
|
99
|
+
buildConfig = true
|
|
100
|
+
}
|
|
101
|
+
kotlinOptions {
|
|
102
|
+
jvmTarget = "11"
|
|
103
|
+
}
|
|
104
|
+
externalNativeBuild {
|
|
105
|
+
cmake {
|
|
106
|
+
path = file("src/main/cpp/CMakeLists.txt")
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
packaging {
|
|
110
|
+
jniLibs {
|
|
111
|
+
useLegacyPackaging = true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
testOptions {
|
|
115
|
+
// ModuleRegistry/ElurStateModule llaman android.util.Log — en
|
|
116
|
+
// JVM los stubs de android.* devuelven default en vez de lanzar
|
|
117
|
+
// (los tests JVM cubren lógica, no el logcat).
|
|
118
|
+
unitTests.isReturnDefaultValues = true
|
|
119
|
+
}
|
|
120
|
+
sourceSets {
|
|
121
|
+
named("main") {
|
|
122
|
+
// libhermesvm.so + libfbjni.so (Hermes V1 runtime, HBC 99)
|
|
123
|
+
jniLibs.srcDir("src/main/cpp/hermes-libs")
|
|
124
|
+
// ADR-0078/0103: los bindings Android de los paquetes los
|
|
125
|
+
// emite el bloque gestionado de abajo (elur build) —
|
|
126
|
+
// package dir realpath + /android/src/main/java.
|
|
127
|
+
// BEGIN ELUR MODULE SOURCES (generated — do not edit)
|
|
128
|
+
java.srcDir("../../../packages/i18n/android/src/main/java")
|
|
129
|
+
java.srcDir("../../../packages/kv/android/src/main/java")
|
|
130
|
+
java.srcDir("../../../packages/location/android/src/main/java")
|
|
131
|
+
// END ELUR MODULE SOURCES
|
|
132
|
+
}
|
|
133
|
+
named("test") {
|
|
134
|
+
// U15: corpus común del wire — mismo archivo que valida el
|
|
135
|
+
// encoder TS y la paridad nativa (ADR-0069).
|
|
136
|
+
resources.srcDir("../../../tests/wire")
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
dependencies {
|
|
142
|
+
// libfbjni.so + clases Java (HybridData) — DT_NEEDED de libhermesvm.so
|
|
143
|
+
implementation("com.facebook.fbjni:fbjni:0.7.0")
|
|
144
|
+
// Yoga: yogacore vendored en framework/native/yoga (ADR-0018) — el
|
|
145
|
+
// árbol vive en C++; la dep com.facebook.yoga (aar Java) ya no se usa.
|
|
146
|
+
implementation("com.facebook.soloader:soloader:0.10.5")
|
|
147
|
+
implementation("com.google.android.material:material:1.12.0")
|
|
148
|
+
implementation("androidx.annotation:annotation:1.9.1")
|
|
149
|
+
// androidx explícitas (ADR-0114) — core ya se usaba transitivo vía
|
|
150
|
+
// material/recyclerview (ViewCompat/WindowInsetsCompat): se declara.
|
|
151
|
+
implementation("androidx.core:core:1.16.0")
|
|
152
|
+
// ComponentActivity + OnBackPressedDispatcher: unifica el back
|
|
153
|
+
// legacy (<33) con OnBackInvoked (33+) y el progreso predictivo
|
|
154
|
+
// (34+) en OnBackPressedCallback — elimina el dual-path manual.
|
|
155
|
+
implementation("androidx.activity:activity:1.10.1")
|
|
156
|
+
// WindowMetricsCalculator — viewport inicial eager (onCreate, antes
|
|
157
|
+
// del primer layout); under edge-to-edge bounds == container real.
|
|
158
|
+
implementation("androidx.window:window:1.4.0")
|
|
159
|
+
// Perfetto/systrace sections en el path de commit (Trace.beginSection).
|
|
160
|
+
implementation("androidx.tracing:tracing:1.3.0")
|
|
161
|
+
// Baseline Profiles: instala el perfil en el primer arranque cuando
|
|
162
|
+
// el módulo de benchmark lo genera (Macrobenchmark — tooling §5).
|
|
163
|
+
implementation("androidx.profileinstaller:profileinstaller:1.4.1")
|
|
164
|
+
// Coil 3 (ADR-0115): engine de fetch+decode del path remoto de
|
|
165
|
+
// imágenes — disk cache, okhttp, downsampling al bucket destino.
|
|
166
|
+
// La capa semántica (identidad src+bucket, waiters dedup, budgets,
|
|
167
|
+
// purga por holder) queda en ElurImageService — Coil solo provee
|
|
168
|
+
// fetchRemoteDecoded. data:/assets siguen por el path propio.
|
|
169
|
+
implementation("io.coil-kt.coil3:coil:3.2.0")
|
|
170
|
+
implementation("io.coil-kt.coil3:coil-network-okhttp:3.2.0")
|
|
171
|
+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")
|
|
172
|
+
// EdDSA puro-Java (ADR-0184): Ed25519 para dispositivos sin provider
|
|
173
|
+
// capaz en el stack JCA — API<33 universal y Conscrypt antiguo (el
|
|
174
|
+
// emulador API 35 no lo trae). Se registra como provider de reserva
|
|
175
|
+
// en ElurCryptoModule; isSupported() sigue midiendo la ruta real.
|
|
176
|
+
implementation("net.i2p.crypto:eddsa:0.3.0")
|
|
177
|
+
// ADR-0054 — RecyclerView: host nativo de `list` con renderPolicy
|
|
178
|
+
// "native" (ventana/recycle/bind a nivel item, cero round-trip JS).
|
|
179
|
+
implementation("androidx.recyclerview:recyclerview:1.4.0")
|
|
180
|
+
testImplementation(libs.junit)
|
|
181
|
+
// U13: org.json en JVM para tests del verificador de manifiesto
|
|
182
|
+
// (ElurManifest es Kotlin puro — la API coincide con android).
|
|
183
|
+
testImplementation("org.json:json:20250107")
|
|
184
|
+
// §5 tooling — instrumentación on-device:
|
|
185
|
+
// UIAutomator conduce el dispositivo; ATF (Accessibility Test
|
|
186
|
+
// Framework de Google, vía espresso-accessibility) valida la
|
|
187
|
+
// jerarquía de Views real en cada check espresso.
|
|
188
|
+
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
|
189
|
+
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
|
190
|
+
androidTestImplementation("androidx.test.espresso:espresso-accessibility:3.6.1")
|
|
191
|
+
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0")
|
|
192
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Generated by cli/gen-host-integration.mjs — do not edit.
|
|
2
|
+
# ADR-0103/T-6: keep rules del shell + bindings de paquetes.
|
|
3
|
+
# El engine llama métodos Java por JNI (postToJs/callHandler/dispatch) —
|
|
4
|
+
# sin keep, R8 minificado renombra la superficie del bridge.
|
|
5
|
+
-keep class com.elur.universal.** { *; }
|
|
6
|
+
-keepclassmembers class * {
|
|
7
|
+
@android.webkit.JavascriptInterface <methods>;
|
|
8
|
+
}
|
|
9
|
+
# Bindings de paquetes (bindings.android.class de los plugin.json):
|
|
10
|
+
-keep class com.elurjs.i18n.ElurI18nModule { *; }
|
|
11
|
+
-keep class com.elurjs.kv.ElurKvModule { *; }
|
|
12
|
+
-keep class com.elurjs.location.ElurLocationModule { *; }
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
+
|
|
4
|
+
<!-- image src http(s): fetch en background thread (loadImage). -->
|
|
5
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
6
|
+
|
|
7
|
+
<!-- Los permisos de módulos (@elurjs/location → ACCESS_COARSE_LOCATION,
|
|
8
|
+
etc.) se materializan en el bloque gestionado de abajo por
|
|
9
|
+
`elur build` (ADR-0102, cli/gen-host-integration.mjs) — los
|
|
10
|
+
sourceSets de Gradle no mergean manifests de paquete. -->
|
|
11
|
+
|
|
12
|
+
<!-- V13: adjustResize — el IME encoge el contenedor, el layout
|
|
13
|
+
listener reporta el viewport reducido a Yoga y la app recoloca
|
|
14
|
+
el contenido sobre el teclado. Sin el flag el sistema hace pan:
|
|
15
|
+
la ventana se desplaza sin resize y el árbol nunca se entera. -->
|
|
16
|
+
|
|
17
|
+
<!-- BEGIN ELUR MODULE PERMISSIONS (generated — do not edit) -->
|
|
18
|
+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- @elurjs/location -->
|
|
19
|
+
<!-- END ELUR MODULE PERMISSIONS -->
|
|
20
|
+
|
|
21
|
+
<application
|
|
22
|
+
android:allowBackup="true"
|
|
23
|
+
android:label="@string/app_name"
|
|
24
|
+
android:supportsRtl="true"
|
|
25
|
+
android:networkSecurityConfig="@xml/network_security_config"
|
|
26
|
+
android:theme="@style/Theme.Material3.Light.NoActionBar"
|
|
27
|
+
>
|
|
28
|
+
<!-- §5 tooling: Macrobenchmark — shell puede perfilar el proceso
|
|
29
|
+
(StartupTimingMetric/trace sections) sin root. -->
|
|
30
|
+
<profileable android:shell="true" />
|
|
31
|
+
|
|
32
|
+
<!-- Resizeable (U21/ADR-0075): sin opt-out — con targetSdk 36 el
|
|
33
|
+
sistema lo ignora en pantallas ≥600dp y API 37 lo elimina.
|
|
34
|
+
El renderer soporta relayout: configChanges entrega el
|
|
35
|
+
resize a onConfigurationChanged → setViewport + re-medida
|
|
36
|
+
de hojas (multi-ventana, freeform y foldables cubiertos).
|
|
37
|
+
Nota MIUI: el caption freeform de HyperOS que motivó el
|
|
38
|
+
opt-out original no es base de arquitectura — si reaparece
|
|
39
|
+
se mitiga en el recognizer de toques, no desactivando
|
|
40
|
+
resize. -->
|
|
41
|
+
<!-- singleTask: un `am start` (FLAG_ACTIVITY_NEW_TASK implícito)
|
|
42
|
+
sobre la app viva reusa la task existente → onNewIntent →
|
|
43
|
+
relaunch ordenado. Con singleTop creaba una SEGUNDA task y una
|
|
44
|
+
segunda instancia viva compartiendo los globals nativos del .so
|
|
45
|
+
→ init sobre runtime ajeno = SIGSEGV. La defensa en el bridge
|
|
46
|
+
(token de sesión + teardown) queda como backstop. -->
|
|
47
|
+
<activity
|
|
48
|
+
android:name="com.elur.universal.MainActivity"
|
|
49
|
+
android:exported="true"
|
|
50
|
+
android:launchMode="singleTask"
|
|
51
|
+
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|fontScale|keyboard|keyboardHidden|navigation|uiMode"
|
|
52
|
+
android:windowSoftInputMode="adjustResize"
|
|
53
|
+
>
|
|
54
|
+
<intent-filter>
|
|
55
|
+
<action android:name="android.intent.action.MAIN" />
|
|
56
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
57
|
+
</intent-filter>
|
|
58
|
+
<!-- Deep links: elur://app/<path> → router.push(path). -->
|
|
59
|
+
<intent-filter>
|
|
60
|
+
<action android:name="android.intent.action.VIEW" />
|
|
61
|
+
<category android:name="android.intent.category.DEFAULT" />
|
|
62
|
+
<category android:name="android.intent.category.BROWSABLE" />
|
|
63
|
+
<data android:scheme="natprobe" android:host="app" />
|
|
64
|
+
</intent-filter>
|
|
65
|
+
<!-- App Links verificados (https): requieren dominio real +
|
|
66
|
+
assetlinks.json en el host — añadir <data android:scheme=
|
|
67
|
+
"https" android:host="..." /> + autoVerify=true. -->
|
|
68
|
+
</activity>
|
|
69
|
+
|
|
70
|
+
<!-- Avisos OSS: scheme://app/_licenses lo intercepta MainActivity
|
|
71
|
+
antes del router JS — nativa y no-exportada a propósito (se
|
|
72
|
+
abre solo desde la propia app o adb). -->
|
|
73
|
+
<activity
|
|
74
|
+
android:name="com.elur.universal.ElurLicensesActivity"
|
|
75
|
+
android:exported="false"
|
|
76
|
+
android:label="Licencias"
|
|
77
|
+
android:theme="@style/Theme.Material3.Light.NoActionBar"
|
|
78
|
+
/>
|
|
79
|
+
</application>
|
|
80
|
+
|
|
81
|
+
</manifest>
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Avisos de terceros — Elur Universal
|
|
2
|
+
|
|
3
|
+
Este archivo recoge las licencias de los componentes de terceros que el
|
|
4
|
+
proyecto **distribuye** (código vendorizado o binarios). Las dependencias
|
|
5
|
+
solo de desarrollo (npm devDependencies) no se distribuyen y no
|
|
6
|
+
aparecen aquí.
|
|
7
|
+
|
|
8
|
+
## Componentes empaquetados
|
|
9
|
+
|
|
10
|
+
| Componente | Licencia | Dónde |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| Yoga (vendorizado) | MIT — Facebook, Inc. and its affiliates | `native/yoga/` (`native/yoga/LICENSE`) |
|
|
13
|
+
| Hermes (binario `libhermesvm.so`) | MIT — Meta Platforms, Inc. and affiliates | `targets/android/app/src/main/cpp/hermes-libs/` (su `LICENSE` viaja junto al binario) |
|
|
14
|
+
| QuickJS-NG (descargado en build, commit fijado) | MIT — F. Bellard, C. Gordon, B. Noordhuis, S. Ibarra Corretgé | `FetchContent` en `targets/*/CMakeLists.txt` |
|
|
15
|
+
| idiomorph (empaquetado dentro de `@elurjs/kit`) | 0BSD | `node_modules/@elurjs/kit/dist/lib/` |
|
|
16
|
+
| `@elurjs/core` / `@elurjs/kit` | MIT — Deiver Vasquez | dependencias npm |
|
|
17
|
+
| Fuentes DejaVu | Bitstream Vera + Arev (ver texto completo) | `examples/mareas/fonts/`; copiadas por el build a `assets/fonts/` (Android), `generated/fonts/` (Linux) y `dist*/fonts/` (web) — cada copia lleva `LICENSE-DejaVu.txt` |
|
|
18
|
+
| Skia (solo si se activa `supportsSkia`) | BSD-3-Clause — Google Inc. | `targets/android/app/src/main/cpp/skia-libs/` (no versionado; se incorpora al habilitar el backend) |
|
|
19
|
+
|
|
20
|
+
## Dependencias del host Android (APK)
|
|
21
|
+
|
|
22
|
+
Bibliotecas bajo **Apache License 2.0** (texto en `LICENSE` de la raíz):
|
|
23
|
+
AndroidX (`core`, `activity`, `annotation`, `window`, `tracing`,
|
|
24
|
+
`profileinstaller`, `recyclerview`), Material Components
|
|
25
|
+
(`com.google.android.material`), Coil 3 (`io.coil-kt.coil3`), OkHttp,
|
|
26
|
+
Kotlin coroutines, `com.facebook.fbjni`, `com.facebook.soloader`.
|
|
27
|
+
|
|
28
|
+
## Enlace dinámico del host Linux
|
|
29
|
+
|
|
30
|
+
El host enlaza en tiempo de ejecución contra bibliotecas del sistema:
|
|
31
|
+
**GTK 4, GLib, Pango** (LGPL-2.1+), **libsoup 3** (LGPL-2.0+) y
|
|
32
|
+
**fontconfig** (licencia MIT-like). No se distribuyen con el proyecto.
|
|
33
|
+
Si empaquetas el host con esas bibliotecas (p. ej. AppImage), incluye
|
|
34
|
+
sus textos LGPL y permite su sustitución — con enlace dinámico ya se
|
|
35
|
+
cumple.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Textos de licencia
|
|
40
|
+
|
|
41
|
+
### MIT — Yoga / Hermes
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
MIT License
|
|
45
|
+
|
|
46
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
47
|
+
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
49
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
50
|
+
in the Software without restriction, including without limitation the rights
|
|
51
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
52
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
53
|
+
furnished to do so, subject to the following conditions:
|
|
54
|
+
|
|
55
|
+
The above copyright notice and this permission notice shall be included in all
|
|
56
|
+
copies or substantial portions of the Software.
|
|
57
|
+
|
|
58
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
59
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
60
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
61
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
62
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
63
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
64
|
+
SOFTWARE.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### MIT — QuickJS-NG
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
The MIT License (MIT)
|
|
71
|
+
|
|
72
|
+
Copyright (c) 2017-2026 Fabrice Bellard
|
|
73
|
+
Copyright (c) 2017-2024 Charlie Gordon
|
|
74
|
+
Copyright (c) 2023-2026 Ben Noordhuis
|
|
75
|
+
Copyright (c) 2023-2026 Saúl Ibarra Corretgé
|
|
76
|
+
|
|
77
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
78
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
79
|
+
in the Software without restriction, including without limitation the rights
|
|
80
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
81
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
82
|
+
furnished to do so, subject to the following conditions:
|
|
83
|
+
|
|
84
|
+
The above copyright notice and this permission notice shall be included in
|
|
85
|
+
all copies or substantial portions of the Software.
|
|
86
|
+
|
|
87
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
88
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
89
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
90
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
91
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
92
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
93
|
+
SOFTWARE.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 0BSD — idiomorph
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
Zero-Clause BSD
|
|
100
|
+
=============
|
|
101
|
+
|
|
102
|
+
Permission to use, copy, modify, and/or distribute this software for
|
|
103
|
+
any purpose with or without fee is hereby granted.
|
|
104
|
+
|
|
105
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
|
106
|
+
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
107
|
+
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
|
|
108
|
+
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
|
|
109
|
+
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
|
110
|
+
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
|
111
|
+
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### BSD-3-Clause — Skia (solo si se habilita)
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
Copyright (c) 2011 Google Inc. All rights reserved.
|
|
118
|
+
|
|
119
|
+
Redistribution and use in source and binary forms, with or without
|
|
120
|
+
modification, are permitted provided that the following conditions are
|
|
121
|
+
met:
|
|
122
|
+
|
|
123
|
+
* Redistributions of source code must retain the above copyright
|
|
124
|
+
notice, this list of conditions and the following disclaimer.
|
|
125
|
+
|
|
126
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
127
|
+
notice, this list of conditions and the following disclaimer in
|
|
128
|
+
the documentation and/or other materials provided with the
|
|
129
|
+
distribution.
|
|
130
|
+
|
|
131
|
+
* Neither the name of the copyright holder nor the names of its
|
|
132
|
+
contributors may be used to endorse or promote products derived
|
|
133
|
+
from this software without specific prior written permission.
|
|
134
|
+
|
|
135
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
136
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
137
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
138
|
+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT
|
|
139
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
140
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
141
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
142
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
143
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
144
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
145
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Fuentes DejaVu
|
|
149
|
+
|
|
150
|
+
Texto completo en `examples/mareas/fonts/LICENSE-DejaVu.txt` (mismo
|
|
151
|
+
archivo que el build copia junto a los `.ttf` en cada artefacto).
|
|
152
|
+
Condiciones principales: redistribución libre conservando el aviso; si
|
|
153
|
+
la fuente se modifica debe renombrarse; no puede venderse suelta.
|
|
Binary file
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.22)
|
|
2
|
+
project(elur-bridge)
|
|
3
|
+
|
|
4
|
+
# QuickJS-ng @60984dc (post-v0.17.0) via FetchContent — pineado al mismo
|
|
5
|
+
# commit que el clone de referencia en la raíz del workspace, para que el
|
|
6
|
+
# oracle de paridad dev (QJS_BIN) y el runtime de device no diverjan.
|
|
7
|
+
# BC_VERSION 28 (bump respecto al tag 0.16.2) — ADR-0156.
|
|
8
|
+
include(FetchContent)
|
|
9
|
+
FetchContent_Declare(
|
|
10
|
+
quickjs
|
|
11
|
+
URL https://github.com/quickjs-ng/quickjs/archive/60984dc07cbb6b7885303b9542944b114203e918.tar.gz
|
|
12
|
+
)
|
|
13
|
+
FetchContent_MakeAvailable(quickjs)
|
|
14
|
+
|
|
15
|
+
# 4 fuentes core de quickjs-ng (qjs_sources en su CMakeLists)
|
|
16
|
+
set(QJS_SOURCES
|
|
17
|
+
${quickjs_SOURCE_DIR}/dtoa.c
|
|
18
|
+
${quickjs_SOURCE_DIR}/libregexp.c
|
|
19
|
+
${quickjs_SOURCE_DIR}/libunicode.c
|
|
20
|
+
${quickjs_SOURCE_DIR}/quickjs.c
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
add_library(quickjs STATIC ${QJS_SOURCES})
|
|
24
|
+
target_include_directories(quickjs PUBLIC ${quickjs_SOURCE_DIR})
|
|
25
|
+
target_compile_definitions(quickjs PRIVATE _GNU_SOURCE)
|
|
26
|
+
# El runtime embebido no usa std/os modules
|
|
27
|
+
target_compile_definitions(quickjs PRIVATE QJS_DISABLE_DEBUGGER)
|
|
28
|
+
|
|
29
|
+
# CESM (ADR-0055) + Yoga: código C++ compartido en framework/native/ —
|
|
30
|
+
# engine-agnostic y platform-agnostic; Android solo lo consume.
|
|
31
|
+
set(ELUR_NATIVE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../native)
|
|
32
|
+
|
|
33
|
+
# yogacore vendored (yoga 3.2.1 — ADR-0110) — árbol de layout único en
|
|
34
|
+
# C++ (P1-TREE). 3.x reorganiza las fuentes en subdirs (algorithm/, node/…)
|
|
35
|
+
# y exige C++20 (enums/YogaEnums.h usa concepts + <bit>).
|
|
36
|
+
file(GLOB_RECURSE YOGA_SOURCES ${ELUR_NATIVE_DIR}/yoga/*.cpp)
|
|
37
|
+
add_library(yogacore STATIC ${YOGA_SOURCES})
|
|
38
|
+
target_include_directories(yogacore PUBLIC ${ELUR_NATIVE_DIR})
|
|
39
|
+
target_compile_options(yogacore PRIVATE -fexceptions -frtti)
|
|
40
|
+
set_target_properties(yogacore PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON)
|
|
41
|
+
|
|
42
|
+
add_library(elur-cesm INTERFACE)
|
|
43
|
+
target_include_directories(elur-cesm INTERFACE ${ELUR_NATIVE_DIR})
|
|
44
|
+
|
|
45
|
+
add_library(elur-bridge SHARED elurBridge.cpp dlEncoderQjs.cpp elurYoga.cpp elurUiWorklet.cpp ${ELUR_NATIVE_DIR}/layout/elur_layout_style.cpp)
|
|
46
|
+
target_include_directories(elur-bridge PRIVATE ${ELUR_NATIVE_DIR})
|
|
47
|
+
target_link_libraries(elur-bridge PRIVATE quickjs yogacore elur-cesm log)
|
|
48
|
+
# T-6: 16KB page size (Play, nov 2025) — los .so propios salen con
|
|
49
|
+
# p_align=4096 por default del NDK; max-page-size=16384 alinea los
|
|
50
|
+
# segmentos PT_LOAD para dispositivos 16KB (arm64/x86_64).
|
|
51
|
+
target_link_options(elur-bridge PRIVATE -Wl,-z,max-page-size=16384)
|
|
52
|
+
|
|
53
|
+
# Skia raster backend para `canvas` renderPolicy:"custom" (ADR-0123, §5.6):
|
|
54
|
+
# lib propia (carga lazy desde ElurSkiaCanvasView) — si el prebuilt no está,
|
|
55
|
+
# la cap `skia` reporta false y el nodo cae al backend Platform Views.
|
|
56
|
+
# Los artefactos (libskia.a + include/) son locales (gitignored): copiar
|
|
57
|
+
# desde el build del PoC o reconstruir Skia m147a.
|
|
58
|
+
set(SKIA_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/skia-libs/${ANDROID_ABI})
|
|
59
|
+
if(EXISTS "${SKIA_LIBS_DIR}/libskia.a")
|
|
60
|
+
add_library(skia STATIC IMPORTED)
|
|
61
|
+
set_property(TARGET skia PROPERTY IMPORTED_LOCATION ${SKIA_LIBS_DIR}/libskia.a)
|
|
62
|
+
add_library(elur-skia SHARED elurSkia.cpp)
|
|
63
|
+
target_include_directories(elur-skia PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/skia-libs)
|
|
64
|
+
target_compile_options(elur-skia PRIVATE -fexceptions -frtti)
|
|
65
|
+
set_target_properties(elur-skia PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
|
|
66
|
+
target_link_libraries(elur-skia PRIVATE skia jnigraphics log)
|
|
67
|
+
target_link_options(elur-skia PRIVATE -Wl,-z,max-page-size=16384)
|
|
68
|
+
message(STATUS "Skia prebuilt found for ${ANDROID_ABI} — building elur-skia")
|
|
69
|
+
|
|
70
|
+
# Carril Skia de árbol completo (propuesta skia-renderer-arbol, fase
|
|
71
|
+
# 4 — surface:"custom" en elur.app.json / -e surface custom en dev).
|
|
72
|
+
# Monta native/skia-tree compartido; el glue aquí es solo superficie
|
|
73
|
+
# ANativeWindow raster + ops/input/medida por JNI. Sin prebuilt la
|
|
74
|
+
# cap `skiaTree` reporta false y el host cae a views con warn.
|
|
75
|
+
add_library(elur-skiatree SHARED
|
|
76
|
+
elurSkiaTree.cpp
|
|
77
|
+
${ELUR_NATIVE_DIR}/skia-tree/elur_skia_tree.cpp)
|
|
78
|
+
target_include_directories(elur-skiatree PRIVATE
|
|
79
|
+
${CMAKE_CURRENT_SOURCE_DIR}/skia-libs
|
|
80
|
+
${ELUR_NATIVE_DIR})
|
|
81
|
+
target_compile_options(elur-skiatree PRIVATE -fexceptions -frtti)
|
|
82
|
+
set_target_properties(elur-skiatree PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
|
|
83
|
+
target_link_libraries(elur-skiatree PRIVATE skia android log)
|
|
84
|
+
target_link_options(elur-skiatree PRIVATE -Wl,-z,max-page-size=16384)
|
|
85
|
+
else()
|
|
86
|
+
message(STATUS "Skia prebuilt not found for ${ANDROID_ABI} — canvas 'custom' y surface 'custom' degradarán a views")
|
|
87
|
+
endif()
|
|
88
|
+
|
|
89
|
+
# Hermes V1 (libhermesvm.so, HBC 99 — matchea hermesc 260318099.0.2) vendorizado
|
|
90
|
+
# en hermes-libs/<abi>/ desde com.facebook.hermes:hermes-android 260318099.0.2.
|
|
91
|
+
# jsi se compila desde hermes@260318099.0.0-stable (su IRuntime ABI no es la
|
|
92
|
+
# de react-android). Requiere ANDROID_STL=c++_shared (DT_NEEDED de libhermesvm).
|
|
93
|
+
set(HERMES_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hermes-libs/${ANDROID_ABI})
|
|
94
|
+
if(EXISTS "${HERMES_LIBS_DIR}/libhermesvm.so")
|
|
95
|
+
add_library(hermesvm SHARED IMPORTED)
|
|
96
|
+
set_property(TARGET hermesvm PROPERTY IMPORTED_LOCATION ${HERMES_LIBS_DIR}/libhermesvm.so)
|
|
97
|
+
|
|
98
|
+
# jsi compilado desde hermes@260318099.0.0-stable — la API IRuntime de
|
|
99
|
+
# Hermes V1 no es la de react-android (Runtime& vs IRuntime&). Nuestro
|
|
100
|
+
# libjsi.so satisface el DT_NEEDED de libhermesvm.so y el bridge.
|
|
101
|
+
add_library(jsi SHARED hermes-libs/jsi-impl/jsi.cpp)
|
|
102
|
+
target_include_directories(jsi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/hermes-libs/include)
|
|
103
|
+
target_compile_options(jsi PRIVATE -Wno-non-virtual-dtor -fexceptions -frtti)
|
|
104
|
+
set_target_properties(jsi PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
|
|
105
|
+
target_link_options(jsi PRIVATE -Wl,-z,max-page-size=16384)
|
|
106
|
+
|
|
107
|
+
add_library(elur-bridge-hermes SHARED elurBridgeHermes.cpp dlEncoderJsi.cpp elurYoga.cpp ${ELUR_NATIVE_DIR}/layout/elur_layout_style.cpp)
|
|
108
|
+
target_include_directories(elur-bridge-hermes PRIVATE
|
|
109
|
+
${CMAKE_CURRENT_SOURCE_DIR}/hermes-libs/include ${ELUR_NATIVE_DIR})
|
|
110
|
+
target_compile_options(elur-bridge-hermes PRIVATE -fexceptions -frtti)
|
|
111
|
+
set_target_properties(elur-bridge-hermes PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
|
|
112
|
+
target_link_libraries(elur-bridge-hermes PRIVATE hermesvm jsi yogacore elur-cesm log)
|
|
113
|
+
target_link_options(elur-bridge-hermes PRIVATE -Wl,-z,max-page-size=16384)
|
|
114
|
+
message(STATUS "Hermes V1 found for ${ANDROID_ABI} — building elur-bridge-hermes")
|
|
115
|
+
else()
|
|
116
|
+
message(STATUS "Hermes V1 not found for ${ANDROID_ABI} — skipping elur-bridge-hermes")
|
|
117
|
+
endif()
|