summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-11-03 21:15:50 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-11-03 21:15:50 +0100
commit310575e1f0bf4fedb3a3cfdae11a3e7c999db0d7 (patch)
treeebf40a376c41bbfbb635e9f3e6d6f171b72f5c2f
parent1ca1aa006528b440ca226f9bb52e16af0b08c9b4 (diff)
Remove unused leftovers
-rw-r--r--stubs/src/kotlin/proxy/KotlinProxyLog.java75
-rw-r--r--test_project/gradle.properties3
2 files changed, 1 insertions, 77 deletions
diff --git a/stubs/src/kotlin/proxy/KotlinProxyLog.java b/stubs/src/kotlin/proxy/KotlinProxyLog.java
index 49a390e..50e347a 100644
--- a/stubs/src/kotlin/proxy/KotlinProxyLog.java
+++ b/stubs/src/kotlin/proxy/KotlinProxyLog.java
@@ -10,73 +10,18 @@ import java.io.IOException;
*
* Every stub method/constructor and every stub class load is recorded here,
* in order, so you can see exactly which stubs AGP/KGP touch.
- *
- * System properties:
- * kotlin.proxy.log log file path (default: &lt;user.dir&gt;/build/kotlin-proxy.log)
- * kotlin.proxy.log.mode "all" (default) | "classes" (class loads only) | "off"
*/
public final class KotlinProxyLog {
- private static BufferedWriter writer;
- private static boolean inited = false;
- private static final String MODE = System.getProperty("kotlin.proxy.log.mode", "all");
-
private KotlinProxyLog() {
}
- private static synchronized void ensure() {
- if (inited) {
- return;
- }
- inited = true;
- try {
- String path = System.getProperty("kotlin.proxy.log",
- System.getProperty("user.dir") + "/build/kotlin-proxy.log");
- File f = new File(path);
- if (f.getParentFile() != null) {
- f.getParentFile().mkdirs();
- }
- writer = new BufferedWriter(new FileWriter(f, true));
- writer.write("# kotlin-proxy log started; mode=" + MODE + "\n");
- } catch (Exception e) {
- writer = null;
- }
- }
-
- /** Called from a stub class static initializer. Proves the stub shadows the real class. */
- public static void loaded(Class<?> stubClass) {
- if ("off".equals(MODE)) {
- return;
- }
- String from = "?";
- try {
- if (stubClass.getProtectionDomain().getCodeSource() != null
- && stubClass.getProtectionDomain().getCodeSource().getLocation() != null) {
- from = stubClass.getProtectionDomain().getCodeSource().getLocation().toString();
- }
- } catch (Throwable t) {
- // ignore
- }
- log("LOAD " + stubClass.getName() + " <- " + from);
- }
-
- /** Called from every stub method/constructor body. */
- public static void call(String member, Class<?> stubClass) {
- if ("off".equals(MODE) || "classes".equals(MODE)) {
- return;
- }
- log("CALL " + stubClass.getName() + "." + member);
- }
-
/**
* String-based overload used by the bytecode-generated stubs (they pass
* the dotted class name rather than a Class literal). Resolves the
* already-loaded class to recover its code source location.
*/
public static void loaded(String dotName) {
- if ("off".equals(MODE)) {
- return;
- }
String from = "?";
try {
Class<?> c = Class.forName(dotName, false,
@@ -92,9 +37,6 @@ public final class KotlinProxyLog {
}
public static void call(String member, String dotName) {
- if ("off".equals(MODE) || "classes".equals(MODE)) {
- return;
- }
log("CALL " + dotName + "." + member);
}
@@ -105,9 +47,6 @@ public final class KotlinProxyLog {
* (replaced) compiler.
*/
public static void call(String member, String dotName, Object arg) {
- if ("off".equals(MODE) || "classes".equals(MODE)) {
- return;
- }
log("CALL " + dotName + "." + member + " arg=" + dump(arg));
}
@@ -177,20 +116,6 @@ public final class KotlinProxyLog {
}
private static void log(String line) {
- ensure();
- BufferedWriter w = writer;
- if (w != null) {
- try {
- w.write(Thread.currentThread().getName() + " | " + line);
- w.newLine();
- w.flush(); // survive JVM exit without a full buffer
- } catch (IOException e) {
- // logging must never break the build
- }
- }
- // Fixed-path marker: works even when the daemon JVM has no
- // -Dkotlin.proxy.log, so we can prove the stub was actually loaded
- // in the out-of-process daemon regardless of its working directory.
try {
String marker = System.getProperty("kotlin.proxy.marker", "/tmp/kotlin-proxy-marker.txt");
synchronized (KotlinProxyLog.class) {
diff --git a/test_project/gradle.properties b/test_project/gradle.properties
index d8e0a36..622d075 100644
--- a/test_project/gradle.properties
+++ b/test_project/gradle.properties
@@ -6,8 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
-# -Dkotlin.proxy.log -> where the stub jar writes its LOAD/CALL proof log
-org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -Dkotlin.proxy.log=/home/the_jk/source/kotlin_proxy/test_project/build/kotlin-proxy.log
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects