refactor(ffi-linkage): Phase 9.2d — rename foreign_path → runtime_path (coupled .sx↔.zig↔hook)
The JNI/runtime-class path (Decision 5, Runtime* family). Coordinated across the hook boundary so the BuildOptions accessor + its registered hook string stay in sync: - src/: RuntimeClassDecl.foreign_path→runtime_path, splitForeignPath→splitRuntimePath, foreignPathToJavaName→runtimePathToJavaName, jni_main_foreign_paths→ jni_main_runtime_paths, hookJniMainForeignPathAt→hookJniMainRuntimePathAt, and the hook string 'BuildOptions.jni_main_foreign_path_at'→'…runtime_path_at'. - library/: build.sx accessor jni_main_foreign_path_at→jni_main_runtime_path_at + bundle.sx call sites + the local var → runtime_path + a comment. - specs.md: the accessor name + <foreign_path_with_dots> doc refs. - Regenerated 37 .ir snapshots: every program importing build declares the renamed @BuildOptions.jni_main_runtime_path_at hook stub — symbol-name change only (verified the .ir diff is ONLY this rename; reverted orthogonal empty-file normalization). Suite green (646 corpus / 444 unit, 0 failed).
This commit is contained in:
@@ -42,7 +42,7 @@ test "rejects non-main decl" {
|
||||
const a = std.testing.allocator;
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "Foo",
|
||||
.foreign_path = "co/example/Foo",
|
||||
.runtime_path = "co/example/Foo",
|
||||
.runtime = .jni_class,
|
||||
.is_main = false, // ← not main
|
||||
};
|
||||
@@ -73,7 +73,7 @@ test "void onCreate(Bundle) with default Activity superclass" {
|
||||
} };
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "SxApp",
|
||||
.foreign_path = "co/swipelab/sx_runtime/SxNativeActivity",
|
||||
.runtime_path = "co/swipelab/sx_runtime/SxNativeActivity",
|
||||
.runtime = .jni_class,
|
||||
.is_main = true,
|
||||
.members = &.{member},
|
||||
@@ -116,7 +116,7 @@ test "primitive params" {
|
||||
} };
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "Sx",
|
||||
.foreign_path = "co/sample/Sx",
|
||||
.runtime_path = "co/sample/Sx",
|
||||
.runtime = .jni_class,
|
||||
.is_main = true,
|
||||
.members = &.{member},
|
||||
@@ -157,7 +157,7 @@ test "declaration-only methods are skipped" {
|
||||
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "Sx",
|
||||
.foreign_path = "co/example/Sx",
|
||||
.runtime_path = "co/example/Sx",
|
||||
.runtime = .jni_class,
|
||||
.is_main = true,
|
||||
.members = &.{ bodied, decl_only },
|
||||
@@ -194,7 +194,7 @@ test "#extends Alias resolves through class registry" {
|
||||
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "Sx",
|
||||
.foreign_path = "co/example/Sx",
|
||||
.runtime_path = "co/example/Sx",
|
||||
.runtime = .jni_class,
|
||||
.is_main = true,
|
||||
.members = &.{ extends_member, method_member },
|
||||
@@ -204,7 +204,7 @@ test "#extends Alias resolves through class registry" {
|
||||
try std.testing.expect(std.mem.indexOf(u8, out, "extends co.example.MyParentActivity") != null);
|
||||
}
|
||||
|
||||
test "default-package class (no slash in foreign_path)" {
|
||||
test "default-package class (no slash in runtime_path)" {
|
||||
const a = std.testing.allocator;
|
||||
var arena = std.heap.ArenaAllocator.init(a);
|
||||
defer arena.deinit();
|
||||
@@ -222,7 +222,7 @@ test "default-package class (no slash in foreign_path)" {
|
||||
} };
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "Sx",
|
||||
.foreign_path = "SxNoPackage",
|
||||
.runtime_path = "SxNoPackage",
|
||||
.runtime = .jni_class,
|
||||
.is_main = true,
|
||||
.members = &.{member},
|
||||
@@ -253,7 +253,7 @@ test "lib_name renders System.loadLibrary static init block" {
|
||||
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "SxApp",
|
||||
.foreign_path = "co/example/SxApp",
|
||||
.runtime_path = "co/example/SxApp",
|
||||
.runtime = .jni_class,
|
||||
.is_main = true,
|
||||
.members = &.{method},
|
||||
@@ -296,7 +296,7 @@ test "field declarations render as private Java fields" {
|
||||
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "SxApp",
|
||||
.foreign_path = "co/example/SxApp",
|
||||
.runtime_path = "co/example/SxApp",
|
||||
.runtime = .jni_class,
|
||||
.is_main = true,
|
||||
.members = &.{ view_field, w_field, method },
|
||||
@@ -334,7 +334,7 @@ test "#implements clauses on the class header" {
|
||||
|
||||
const fcd: ast.RuntimeClassDecl = .{
|
||||
.name = "SxApp",
|
||||
.foreign_path = "co/example/SxApp",
|
||||
.runtime_path = "co/example/SxApp",
|
||||
.runtime = .jni_class,
|
||||
.is_main = true,
|
||||
.members = &.{ impl_a, impl_b, method },
|
||||
|
||||
Reference in New Issue
Block a user